Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues authored Sep 6, 2024
1 parent 5fb08a5 commit 11c4dd9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/particle/particle/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class InvalidParticle(RuntimeError):
pass


# the neutron, proton and their anti-particles have two possible pdgid representations
# a) the bag of quarks b) the nucleus
# The proton and the neutron (and their anti-particles) have two possible PDG ID representations,
# a) a particle ("bag of quarks") or b) a nucleus.
_NON_UNIQUE_PDGIDS = {
2112: 1000000010,
2212: 1000010010,
Expand Down Expand Up @@ -626,6 +626,12 @@ def __lt__(self, other: Particle | int) -> bool:
return int(self.pdgid) < other

def __eq__(self, other: object) -> bool:
"""
Note
----
Ensure the comparison also works for the special cases of the proton and the neutron,
which have two PDG ID representations as particles or nuclei."""
"""
if isinstance(other, Particle):
other = other.pdgid
Expand Down

0 comments on commit 11c4dd9

Please sign in to comment.