From 05d51a81db5531f8b0382bbdd7107728447cb78a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 11:27:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docs/_extend_docstrings.py | 2 +- src/ampform/helicity/__init__.py | 2 +- src/ampform/helicity/align/_spin.py | 2 +- src/ampform/helicity/align/axisangle.py | 6 ++---- src/ampform/sympy/__init__.py | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/_extend_docstrings.py b/docs/_extend_docstrings.py index 0cda15306..a8a89dcf6 100644 --- a/docs/_extend_docstrings.py +++ b/docs/_extend_docstrings.py @@ -554,7 +554,7 @@ def __get_graphviz_state_transition_example( for state_id in [0, 1, -1]: dot = dot.replace( f'label="{state_id}: ', - f'label="{state_id+2}: ', + f'label="{state_id + 2}: ', ) return _graphviz_to_image(dot, indent=4, options={"align": "center"}) diff --git a/src/ampform/helicity/__init__.py b/src/ampform/helicity/__init__.py index d612c3f63..d31e4b83e 100644 --- a/src/ampform/helicity/__init__.py +++ b/src/ampform/helicity/__init__.py @@ -569,7 +569,7 @@ def __generate_amplitude_prefactor( self, transition: StateTransition ) -> sp.Rational | None: prefactor = get_prefactor(transition) - if prefactor != 1.0: # noqa: PLR2004 + if prefactor != 1.0: for node_id in transition.topology.nodes: raw_suffix = self.naming.generate_two_body_decay_suffix( transition, node_id diff --git a/src/ampform/helicity/align/_spin.py b/src/ampform/helicity/align/_spin.py index 7da156fd0..8cbc2658a 100644 --- a/src/ampform/helicity/align/_spin.py +++ b/src/ampform/helicity/align/_spin.py @@ -25,7 +25,7 @@ def create_spin_range( spin_projections = [] projection = Decimal(-spin_magnitude_float) while projection <= spin_magnitude_float: - if projection == -0.0: # noqa: PLR2004 + if projection == -0.0: projection = Decimal(0.0) spin_projections.append(float(projection)) projection += 1 diff --git a/src/ampform/helicity/align/axisangle.py b/src/ampform/helicity/align/axisangle.py index 90cfd31ff..383b26cb1 100644 --- a/src/ampform/helicity/align/axisangle.py +++ b/src/ampform/helicity/align/axisangle.py @@ -161,9 +161,7 @@ def get_helicity_rotation(state_id: int) -> Generator[PoolSum, None, None]: if is_opposite_helicity_state(topology, state_id): state_id = get_sibling_state_id(topology, state_id) phi, theta = get_helicity_angle_symbols(topology, state_id) - no_zero_spin = ( - transition.states[rotated_state_id].particle.mass == 0.0 # noqa: PLR2004 - ) + no_zero_spin = transition.states[rotated_state_id].particle.mass == 0.0 yield formulate_helicity_rotation( spin_magnitude, spin_projection=sp.Symbol(f"{next_idx_root}{idx_suffix}", rational=True), @@ -209,7 +207,7 @@ def formulate_wigner_rotation( summing over the Wigner-:math:`D` functions for this rotation. """ state = transition.states[rotated_state_id] - no_zero_spin = state.particle.mass == 0.0 # noqa: PLR2004 + no_zero_spin = state.particle.mass == 0.0 suffix = get_helicity_suffix(transition.topology, rotated_state_id) if helicity_symbol is None: spin_projection = state.spin_projection diff --git a/src/ampform/sympy/__init__.py b/src/ampform/sympy/__init__.py index c99ddc6f8..a2f983dec 100644 --- a/src/ampform/sympy/__init__.py +++ b/src/ampform/sympy/__init__.py @@ -253,7 +253,7 @@ def _is_regular_series(values: Sequence[SupportsFloat]) -> bool: sorted_values = sorted(values, key=float) for val, next_val in zip(sorted_values, sorted_values[1:]): difference = float(next_val) - float(val) - if difference != 1.0: # noqa: PLR2004 + if difference != 1.0: return False return True