From b93112877b62a9406efdd66bfc136726ad6a8737 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 19:42:55 +0000 Subject: [PATCH 1/2] chore: update pre-commit hooks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/psf/black-pre-commit-mirror: 23.9.1 → 23.10.0](https://github.com/psf/black-pre-commit-mirror/compare/23.9.1...23.10.0) - [github.com/astral-sh/ruff-pre-commit: v0.0.292 → v0.1.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.292...v0.1.1) - [github.com/pre-commit/mirrors-mypy: v1.6.0 → v1.6.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.6.0...v1.6.1) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3ab87f7..cc3f9b46 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,7 +4,7 @@ ci: repos: - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 + rev: 23.10.0 hooks: - id: black-jupyter @@ -24,13 +24,13 @@ repos: - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.0.292" + rev: "v0.1.1" hooks: - id: ruff args: ["--fix", "--show-fixes"] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.6.0 + rev: v1.6.1 hooks: - id: mypy files: '^src/decaylanguage/(decay|dec|utils)/' From 091744c39f5bfec391e664f2e06541ef73462f59 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 19:44:15 +0000 Subject: [PATCH 2/2] style: pre-commit fixes --- src/decaylanguage/decay/viewer.py | 4 +--- src/decaylanguage/modeling/goofit.py | 12 +++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/decaylanguage/decay/viewer.py b/src/decaylanguage/decay/viewer.py index 9a9fef6c..305d56fa 100644 --- a/src/decaylanguage/decay/viewer.py +++ b/src/decaylanguage/decay/viewer.py @@ -110,9 +110,7 @@ def html_table_label( if add_tags: label = f'<' else: - label = '<
'.format( - bgcolor=bgcolor - ) + label = f'<
' for i, n in enumerate(names): if add_tags: label += ''.format( diff --git a/src/decaylanguage/modeling/goofit.py b/src/decaylanguage/modeling/goofit.py index c0ab6c41..2359faeb 100644 --- a/src/decaylanguage/modeling/goofit.py +++ b/src/decaylanguage/modeling/goofit.py @@ -279,9 +279,7 @@ def make_lineshape(self, structure, masses): radius = 5.0 if "c" in self.particle.quarks.lower() else 1.5 if self.ls_enum == LS.RBW: - return 'new Lineshapes::RBW("{name}", {par}_M, {par}_W, {L}, {masses}, FF::BL2)'.format( - name=name, par=par, L=L, masses=masses - ) + return f'new Lineshapes::RBW("{name}", {par}_M, {par}_W, {L}, {masses}, FF::BL2)' if self.ls_enum == LS.GSpline: min_ = self.__class__.consts.loc[f"{self.name}::Spline::Min", "value"] max_ = self.__class__.consts.loc[f"{self.name}::Spline::Max", "value"] @@ -336,9 +334,7 @@ def make_spinfactor(self, final_states): for spin_factor in spin_factors: structure_list = ", ".join(map(str, structure)) factor.append( - ' new SpinFactor("SF", SF_4Body::{spin_factor.name:37}, {structure_list})'.format( - spin_factor=spin_factor, structure_list=structure_list - ) + f' new SpinFactor("SF", SF_4Body::{spin_factor.name:37}, {structure_list})' ) exit_ = "\n }));\n" return intro + ",\n".join(factor) + exit_ @@ -691,9 +687,7 @@ def make_spinfactor(self, final_states): for spin_factor in spin_factors: structure_list = ", ".join(map(str, structure)) factor.append( - ' SpinFactor("SF", SF_4Body.{spin_factor.name:37}, {structure_list})'.format( - spin_factor=spin_factor, structure_list=structure_list - ) + f' SpinFactor("SF", SF_4Body.{spin_factor.name:37}, {structure_list})' ) exit_ = "))\n" return intro + ",\n".join(factor) + exit_
{name}