diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f59d83f5..b921b70d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,7 +19,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.5.7" + rev: "v0.6.1" hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/src/decaylanguage/dec/dec.py b/src/decaylanguage/dec/dec.py index 07af2ce2..503d1b30 100644 --- a/src/decaylanguage/dec/dec.py +++ b/src/decaylanguage/dec/dec.py @@ -934,8 +934,7 @@ def print_decay_modes( "" if model_params_list == [] else " ".join(model_params_list) ) decay_chain: str = " ".join(list(dmdict["fs"])) # type: ignore[arg-type] - if len(decay_chain) > max_length: - max_length = len(decay_chain) + max_length = max(len(decay_chain), max_length) ls.append((dmdict["bf"], decay_chain, dmdict["model"], model_params)) # Sort decays by decreasing BF diff --git a/tests/decay/test_decay.py b/tests/decay/test_decay.py index 1525d3cc..8fa205d1 100644 --- a/tests/decay/test_decay.py +++ b/tests/decay/test_decay.py @@ -245,7 +245,7 @@ def test_DecayMode_number_of_final_states(): assert len(dm) == 4 -@pytest.fixture() +@pytest.fixture def dc(): dm1 = DecayMode(0.0124, "K_S0 pi0", model="PHSP") dm2 = DecayMode(0.692, "pi+ pi-") @@ -253,7 +253,7 @@ def dc(): return DecayChain("D0", {"D0": dm1, "K_S0": dm2, "pi0": dm3}) -@pytest.fixture() +@pytest.fixture def dc2(): dm1 = DecayMode(0.6770, "D0 pi+") dm2 = DecayMode(0.0124, "K_S0 pi0") diff --git a/tests/test_dec_full.py b/tests/test_dec_full.py index 7e7e38bc..f3cc92c0 100644 --- a/tests/test_dec_full.py +++ b/tests/test_dec_full.py @@ -96,7 +96,7 @@ def particle(self, items): return str(label) -@pytest.mark.skip() +@pytest.mark.skip def test_dec_full(): txt = data.basepath.joinpath("DECAY_LHCB.DEC").read_text() grammar = data.basepath.joinpath("decfile.lark").read_text()