From 77ad83a4cded3080fcc10955e6a7e7d35a39cfd1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:49:11 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/qrules/conservation_rules.py | 9 +++------ src/qrules/topology.py | 15 +++++---------- src/qrules/transition.py | 6 ++---- 3 files changed, 10 insertions(+), 20 deletions(-) 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: