diff --git a/src/qrules/conservation_rules.py b/src/qrules/conservation_rules.py index d627a8d2..2cb7ddce 100644 --- a/src/qrules/conservation_rules.py +++ b/src/qrules/conservation_rules.py @@ -75,15 +75,13 @@ def _is_particle_antiparticle_pair(pid1: int, pid2: int) -> bool: class GraphElementRule(Protocol): - def __call__(self, __qns: Any) -> bool: - ... + def __call__(self, __qns: Any) -> bool: ... class EdgeQNConservationRule(Protocol): def __call__( self, __ingoing_edge_qns: List[Any], __outgoing_edge_qns: List[Any] - ) -> bool: - ... + ) -> bool: ... class ConservationRule(Protocol): @@ -92,8 +90,7 @@ def __call__( __ingoing_edge_qns: List[Any], __outgoing_edge_qns: List[Any], __node_qns: Any, - ) -> bool: - ... + ) -> bool: ... # Note a generic would be more fitting here. However the type annotations of diff --git a/src/qrules/topology.py b/src/qrules/topology.py index d8490790..2fad0463 100644 --- a/src/qrules/topology.py +++ b/src/qrules/topology.py @@ -62,8 +62,7 @@ class _Comparable(Protocol): @abstractmethod - def __lt__(self, other: Any) -> bool: - ... + def __lt__(self, other: Any) -> bool: ... KT = TypeVar("KT", bound=_Comparable) @@ -875,28 +874,24 @@ def unfreeze(self) -> "MutableTransition[EdgeType, NodeType]": return MutableTransition(self.topology, self.states, self.interactions) @overload - def convert(self) -> "FrozenTransition[EdgeType, NodeType]": - ... + def convert(self) -> "FrozenTransition[EdgeType, NodeType]": ... @overload def convert( self, state_converter: Callable[[EdgeType], NewEdgeType] - ) -> "FrozenTransition[NewEdgeType, NodeType]": - ... + ) -> "FrozenTransition[NewEdgeType, NodeType]": ... @overload def convert( self, *, interaction_converter: Callable[[NodeType], NewNodeType] - ) -> "FrozenTransition[EdgeType, NewNodeType]": - ... + ) -> "FrozenTransition[EdgeType, NewNodeType]": ... @overload def convert( self, state_converter: Callable[[EdgeType], NewEdgeType], interaction_converter: Callable[[NodeType], NewNodeType], - ) -> "FrozenTransition[NewEdgeType, NewNodeType]": - ... + ) -> "FrozenTransition[NewEdgeType, NewNodeType]": ... def convert(self, state_converter=None, interaction_converter=None): # type: ignore[no-untyped-def] """Cast the edge and/or node properties to another type.""" diff --git a/src/qrules/transition.py b/src/qrules/transition.py index 04b51bcf..0c881707 100644 --- a/src/qrules/transition.py +++ b/src/qrules/transition.py @@ -379,12 +379,10 @@ def add_final_state_grouping( @overload def get_allowed_interaction_types( self, - ) -> Union[List[InteractionType], Dict[int, List[InteractionType]]]: - ... + ) -> Union[List[InteractionType], Dict[int, List[InteractionType]]]: ... @overload - def get_allowed_interaction_types(self, node_id: int) -> List[InteractionType]: - ... + def get_allowed_interaction_types(self, node_id: int) -> List[InteractionType]: ... def get_allowed_interaction_types(self, node_id=None): # type: ignore[no-untyped-def] if node_id is None: