-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure neutron, proton and their anti-particles compare equal #622
Make sure neutron, proton and their anti-particles compare equal #622
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #622 +/- ##
==========================================
+ Coverage 96.07% 96.20% +0.13%
==========================================
Files 32 32
Lines 1324 1343 +19
==========================================
+ Hits 1272 1292 +20
+ Misses 52 51 -1 ☔ View full report in Codecov by Sentry. |
…ifferent representations
248d6a0
to
e96c95a
Compare
3855a0a
to
f7fd799
Compare
20a1817
to
b727c65
Compare
Thanks very much @maxnoe for the speedy action 👍! I've got something urgent to finish today but will get back to this really soon. I hope this also handles the feature #620. Oh, I see you got those quotes from the docstring for nuclei, which I probably got from somewhere such as periodictable when including the nuclei. It would be easier if no nucleus codes existed for the proton and neutron, but ... Indeed the scheme can also handle hypernuclei with a p or n being replaced by a Lambda. Some are known, and for example have been studied by ALICE and LHCb :-). |
b727c65
to
314d754
Compare
Yes, see the tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for this great PR. I believe you are done, but kindly confirm and I will merge. Thank you 👍!
Closes #620.
Yes, from my side this is ready |
Thank you again. |
@all-contributors please add @maxnoe for code |
I've put up a pull request to add @maxnoe! 🎉 |
I added two dicts that are build at import time, one mapping one pdgid to the alternative representation to implement the comparison and one with the "preferred" pdgid used for
__hash__
and to makefrom_name
work and always return the same pdgid.Edit: that's actually the official recommendation:
From that I infer though, that neutron and proton are not the only cases, also the delta resonance at least.
Closes #620.