Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ci:
autofix_commit_msg: "MAINT: implement pre-commit autofixes"
autoupdate_commit_msg: "MAINT: upgrade lock files"
autoupdate_schedule: quarterly
skip:
- ty
- uv-lock
Expand All @@ -12,7 +13,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.8.3
rev: 0.8.7
hooks:
- id: check-dev-files
args:
Expand All @@ -28,7 +29,7 @@ repos:
- id: strip-nb-whitespace

- repo: https://github.com/kynan/nbstripout
rev: 0.9.0
rev: 0.9.1
hooks:
- id: nbstripout
args:
Expand Down Expand Up @@ -56,7 +57,7 @@ repos:
metadata.vscode

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.1
rev: v0.15.2
hooks:
- id: ruff-check
args: [--fix]
Expand Down Expand Up @@ -97,7 +98,7 @@ repos:
- --in-place

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v9.6.0
rev: v9.7.0
hooks:
- id: cspell

Expand All @@ -118,12 +119,11 @@ repos:
name: ty
entry: ty check
args: [--no-progress, --output-format=concise]
pass_filenames: false
require_serial: true
language: system
types_or: [python, pyi, jupyter]

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.10.3
rev: 0.10.5
hooks:
- id: uv-lock
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ ignore-names = [
"PLC2701",
"PLR2004",
"PLR6301",
"RUF069",
"S101",
"SLF001",
"T20",
Expand Down
4 changes: 2 additions & 2 deletions src/ampform_dpd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def _get_best_reference_subsystems(decay: ThreeBodyDecay) -> FinalStateID:
resonances_per_subsystem = [
(k, len(decay.get_subsystem(k).chains)) for k in subsystem_ids
]
return max(resonances_per_subsystem, key=operator.itemgetter(1))[0] # ty:ignore[invalid-return-type]
return max(resonances_per_subsystem, key=operator.itemgetter(1))[0]


def _check_reference_subsystems(
Expand Down Expand Up @@ -528,7 +528,7 @@ def __pow__(self, other) -> DefinedExpression: ... # type:ignore[empty-body]

def create_mass_symbol_mapping(decay: ThreeBodyDecay) -> dict[sp.Symbol, float]:
return {
create_mass_symbol(decay.states[i]): decay.states[i].mass # ty:ignore[invalid-argument-type]
create_mass_symbol(decay.states[i]): decay.states[i].mass
for i in sorted(decay.states) # ensure that dict keys are sorted by state ID
}

Expand Down
6 changes: 3 additions & 3 deletions src/ampform_dpd/io/serialization/amplitude.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def formulate_aligned_amplitude(
wigner_generator = _AlignmentWignerGenerator(reference_subsystem)
_λ0, _λ1, _λ2, _λ3 = sp.symbols(R"\lambda_(:4)^{\prime}", rational=True)
states = get_states(model)
j0, j1, j2, j3 = (states[i].spin for i in sorted(states)) # ty:ignore[invalid-argument-type]
j0, j1, j2, j3 = (states[i].spin for i in sorted(states))
A = _generate_amplitude_index_bases()
amp_expr = PoolSum(
sum(
Expand Down Expand Up @@ -262,7 +262,7 @@ def _get_final_state_helicities(
if not isinstance(node, int):
continue
collected_helicities[node] = sp.Rational(helicity)
return {i: collected_helicities[i] for i in sorted(collected_helicities)} # ty:ignore[invalid-argument-type, invalid-return-type]
return {i: collected_helicities[i] for i in sorted(collected_helicities)}


def formulate_recoupling( # noqa: PLR0914
Expand Down Expand Up @@ -356,7 +356,7 @@ def get_existing_subsystem_ids(model: ModelDefinition) -> list[FinalStateID]:
distribution_def = get_distribution_def(model)
chain_defs = distribution_def["decay_description"]["chains"]
subsystem_ids = {get_spectator_id(c["topology"]) for c in chain_defs}
return sorted(subsystem_ids) # ty:ignore[invalid-return-type]
return sorted(subsystem_ids)


@unevaluated
Expand Down
4 changes: 1 addition & 3 deletions tests/adapter/test_qrules.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ def test_convert_transitions(xib2pkk_reaction: ReactionInfo):
def test_filter_min_ls(jpsi2pksigma_reaction: ReactionInfo):
reaction = jpsi2pksigma_reaction
transitions = tuple(
t
for t in reaction.transitions
if t.states[3].spin_projection == +0.5 # noqa: RUF069
t for t in reaction.transitions if t.states[3].spin_projection == +0.5
)

ls_couplings = _group_couplings(transitions)
Expand Down
Loading