From 0c5df26efc997ea04b2cc019dfa7d06c922707d0 Mon Sep 17 00:00:00 2001 From: Remco de Boer Date: Fri, 18 Jun 2021 14:04:03 +0200 Subject: [PATCH] fix: deactivate attr.s order when total_ordering (#73) * style: order kwargs in attr.s --- src/qrules/particle.py | 4 ++-- src/qrules/quantum_numbers.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qrules/particle.py b/src/qrules/particle.py index 7a39d853..8ec14886 100644 --- a/src/qrules/particle.py +++ b/src/qrules/particle.py @@ -52,7 +52,7 @@ def _to_float(value: SupportsFloat) -> float: @total_ordering -@attr.s(frozen=True, eq=False, hash=True) +@attr.s(eq=False, frozen=True, hash=True, order=False) class Spin: """Safe, immutable data container for spin **with projection**.""" @@ -120,7 +120,7 @@ def _to_spin(value: Union[Spin, Tuple[float, float]]) -> Spin: @total_ordering -@attr.s(frozen=True, order=False, repr=True, kw_only=True) +@attr.s(frozen=True, kw_only=True, order=False, repr=True) class Particle: # pylint: disable=too-many-instance-attributes """Immutable container of data defining a physical particle. diff --git a/src/qrules/quantum_numbers.py b/src/qrules/quantum_numbers.py index 29eddaca..d96f5776 100644 --- a/src/qrules/quantum_numbers.py +++ b/src/qrules/quantum_numbers.py @@ -17,7 +17,7 @@ @total_ordering -@attr.s(frozen=True, repr=False, eq=False, hash=True) +@attr.s(eq=False, frozen=True, hash=True, order=False, repr=False) class Parity: value: int = attr.ib(validator=instance_of(int))