Skip to content

Commit

Permalink
Revert "replaced other occurences of 'Any' with qn-types"
Browse files Browse the repository at this point in the history
This reverts commit 41e210f.
  • Loading branch information
grayson-helmholz committed Oct 18, 2024
1 parent 41e210f commit 9fd8404
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/qrules/conservation_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,8 @@
from attrs.converters import optional

from qrules.quantum_numbers import EdgeQuantumNumbers as EdgeQN
from qrules.quantum_numbers import (
EdgeQuantumNumberTypes,
NodeQuantumNumberTypes,
arange,
)
from qrules.quantum_numbers import NodeQuantumNumbers as NodeQN
from qrules.quantum_numbers import arange


def _is_boson(spin_magnitude: float) -> bool:
Expand All @@ -79,18 +75,15 @@ def __call__(self, qns: Any, /) -> bool: ...

class EdgeQNConservationRule(Protocol):
def __call__(
self,
ingoing_edge_qns: list[EdgeQuantumNumberTypes],
outgoing_edge_qns: list[EdgeQuantumNumberTypes],
/,
self, ingoing_edge_qns: list[Any], outgoing_edge_qns: list[Any], /
) -> bool: ...


class ConservationRule(Protocol):
def __call__(
self,
ingoing_edge_qns: list[EdgeQuantumNumberTypes],
outgoing_edge_qns: list[EdgeQuantumNumberTypes],
ingoing_edge_qns: list[Any],
outgoing_edge_qns: list[Any],
node_qns: Any,
/,
) -> bool: ...
Expand All @@ -100,7 +93,7 @@ def __call__(
# __call__ method in a concrete version of the generic are still containing the
# TypeVar types. See https://github.com/python/typing/issues/762
def additive_quantum_number_rule(
quantum_number: Union[EdgeQuantumNumberTypes, NodeQuantumNumberTypes],
quantum_number: type,
) -> Callable[[Any], EdgeQNConservationRule]:
r"""Class decorator for creating an additive conservation rule.
Expand Down

0 comments on commit 9fd8404

Please sign in to comment.