Skip to content

Commit 8f952b9

Browse files
chore(deps): update pre-commit hooks (#660)
* chore(deps): update pre-commit hooks updates: - [github.com/astral-sh/ruff-pre-commit: v0.9.10 → v0.11.0](astral-sh/ruff-pre-commit@v0.9.10...v0.11.0) * style: pre-commit fixes * Remove unnecessary casts to int --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eduardo Rodrigues <[email protected]>
1 parent ce21cbd commit 8f952b9

File tree

3 files changed

+24
-6
lines changed

3 files changed

+24
-6
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repos:
1919
- id: end-of-file-fixer
2020

2121
- repo: https://github.com/astral-sh/ruff-pre-commit
22-
rev: "v0.9.10"
22+
rev: "v0.11.0"
2323
hooks:
2424
- id: ruff
2525
args: ["--fix", "--show-fixes"]

src/particle/particle/convert.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,26 @@ def unmap(mapping: dict[str, T]) -> Callable[[str], T]:
170170
# Read in the table, apply the converters, add names, ignore comments
171171
pdg_table = pd.read_csv(
172172
file_object,
173-
names="Mass,MassUpper,MassLower,Width,WidthUpper,WidthLower,I,G,J,P,C,Anti,"
174-
"ID,Charge,Rank,Status,Name,Quarks".split(","),
173+
names=[
174+
"Mass",
175+
"MassUpper",
176+
"MassLower",
177+
"Width",
178+
"WidthUpper",
179+
"WidthLower",
180+
"I",
181+
"G",
182+
"J",
183+
"P",
184+
"C",
185+
"Anti",
186+
"ID",
187+
"Charge",
188+
"Rank",
189+
"Status",
190+
"Name",
191+
"Quarks",
192+
],
175193
converters=PDG_converters,
176194
comment="#",
177195
)

src/particle/particle/utilities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def str_with_unc(value: float, upper: float | None, lower: float | None = None)
5858
if error == 0:
5959
return str(value)
6060

61-
value_digits = int(math.floor(math.log10(value)))
62-
error_digits = int(math.floor(math.log10(error) - math.log10(2.5)))
61+
value_digits = math.floor(math.log10(value))
62+
error_digits = math.floor(math.log10(error) - math.log10(2.5))
6363
# This is split based on the value being larger than 1000000 or smaller than 0.001 - scientific notation split
6464

6565
# This is normal notation
@@ -72,7 +72,7 @@ def str_with_unc(value: float, upper: float | None, lower: float | None = None)
7272
# This is scientific notation - a little odd, but better than the other options.
7373
else:
7474
fsv = f".{abs(error_digits - value_digits)}e"
75-
pure_error_digits = int(math.floor(math.log10(error)))
75+
pure_error_digits = math.floor(math.log10(error))
7676

7777
fse = ".0e" if error_digits == pure_error_digits else ".1e"
7878

0 commit comments

Comments
 (0)