Skip to content

Commit

Permalink
Particle.spin is now of type Fraction
Browse files Browse the repository at this point in the history
  • Loading branch information
grayson-helmholz committed Nov 8, 2024
1 parent 6bbf7c0 commit e8a184a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qrules/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class Particle:
pid: int = field(eq=False)
latex: str | None = field(eq=False, default=None)
# Unique properties
spin: float = field(converter=float)
spin: Fraction = field(converter=Fraction)
mass: float = field(converter=float)
width: float = field(converter=float, default=0.0)
charge: int = field(default=0)
Expand Down Expand Up @@ -486,7 +486,7 @@ def create_antiparticle(
isospin = -template_particle.isospin
parity: Parity | None = None
if template_particle.parity is not None:
if template_particle.spin.is_integer():
if template_particle.spin.denominator == 1:
parity = template_particle.parity
else:
parity = -template_particle.parity
Expand Down

0 comments on commit e8a184a

Please sign in to comment.