Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 4, 2024
1 parent 8580b4f commit 05d51a8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/_extend_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"})

Expand Down
2 changes: 1 addition & 1 deletion src/ampform/helicity/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ampform/helicity/align/_spin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/ampform/helicity/align/axisangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ampform/sympy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 05d51a8

Please sign in to comment.