Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jan 13, 2025
1 parent baadd49 commit 86ac1a5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
6 changes: 3 additions & 3 deletions src/decaylanguage/dec/dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,9 +1124,9 @@ def model(self, treelist: list[Tree]) -> Tree:
Doesn't do anything if no model_label is found.
"""
if isinstance(treelist[0], Tree):
assert (
treelist[0].data == "model_label"
), f"Instead of a subtree of type 'model_label' one of type {treelist[0].data} has been passed."
assert treelist[0].data == "model_label", (
f"Instead of a subtree of type 'model_label' one of type {treelist[0].data} has been passed."
)
return Tree("model", self._replacement(treelist[0].children[0]))

return Tree("model", treelist)
Expand Down
20 changes: 9 additions & 11 deletions src/decaylanguage/modeling/goofit.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,11 @@ def make_linefactor(self, final_states):

for structure in self.list_structure(final_states):
if self.decay_structure == DecayStructure.FF_12_34:
mass1 = f"M_{structure[0]+1}{structure[1]+1}"
mass2 = f"M_{structure[2]+1}{structure[3]+1}"
mass1 = f"M_{structure[0] + 1}{structure[1] + 1}"
mass2 = f"M_{structure[2] + 1}{structure[3] + 1}"
else:
mass1 = f"M_{structure[0]+1}{structure[1]+1}_{structure[2]+1}"
mass2 = f"M_{structure[0]+1}{structure[1]+1}"
mass1 = f"M_{structure[0] + 1}{structure[1] + 1}_{structure[2] + 1}"
mass2 = f"M_{structure[0] + 1}{structure[1] + 1}"
masses = [mass1, mass2]
for i_mass, sub in enumerate(self.vertexes):
factor.append(
Expand Down Expand Up @@ -419,9 +419,7 @@ def make_intro(cls, all_states):
header += "\nDK3P_DI = DecayInfo4()\n"

header += (
"\nline_factor_list = []"
"\nspin_factor_list = []"
"\namplitudes_list = []\n"
"\nline_factor_list = []\nspin_factor_list = []\namplitudes_list = []\n"
)

final_particles = set(all_states)
Expand Down Expand Up @@ -673,11 +671,11 @@ def make_linefactor(self, final_states):
factor = []
for structure in self.list_structure(final_states):
if self.decay_structure == DecayStructure.FF_12_34:
mass1 = f"M_{structure[0]+1}{structure[1]+1}"
mass2 = f"M_{structure[2]+1}{structure[3]+1}"
mass1 = f"M_{structure[0] + 1}{structure[1] + 1}"
mass2 = f"M_{structure[2] + 1}{structure[3] + 1}"
else:
mass1 = f"M_{structure[0]+1}{structure[1]+1}_{structure[2]+1}"
mass2 = f"M_{structure[0]+1}{structure[1]+1}"
mass1 = f"M_{structure[0] + 1}{structure[1] + 1}_{structure[2] + 1}"
mass2 = f"M_{structure[0] + 1}{structure[1] + 1}"
masses = [mass1, mass2]
for i_mass, sub in enumerate(self.vertexes):
factor.append(
Expand Down
6 changes: 3 additions & 3 deletions src/decaylanguage/utils/particleutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ def _from_group_dict_list(mat: dict[str, Any]) -> list[Particle]:
if mat["family"]:
if "_" in mat["family"]:
mat["family"] = mat["family"].strip("_")
name += f'({mat["family"]})'
name += f"({mat['family']})"
if mat["state"]:
name += f'({mat["state"]})'
name += f"({mat['state']})"

if mat.get("prime"):
name += "'"
Expand All @@ -148,7 +148,7 @@ def _from_group_dict_list(mat: dict[str, Any]) -> list[Particle]:
if mat["state"] is not None:
kw["J"] = float(mat["state"])

maxname = name + f'({mat["mass"]})' if mat["mass"] else name
maxname = name + f"({mat['mass']})" if mat["mass"] else name
if "charge" in mat and mat["charge"] is not None:
kw["three_charge"] = Charge_mapping[mat["charge"]]

Expand Down

0 comments on commit 86ac1a5

Please sign in to comment.