Skip to content

Commit 4320700

Browse files
chore: update pre-commit hooks (#4920)
* chore: 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) * Pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: kratman <[email protected]>
1 parent 4ba8cd8 commit 4320700

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/astral-sh/ruff-pre-commit
7-
rev: "v0.9.10"
7+
rev: "v0.11.0"
88
hooks:
99
- id: ruff
1010
args: [--fix, --show-fixes]

src/pybamm/experiment/step/base_step.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ def default_time_vector(self, tf, t0=0):
288288
period = self.default_period()
289289
else:
290290
period = self.period
291-
npts = max(int(round(np.abs(tf - t0) / period)) + 1, 2)
291+
npts = max(round(np.abs(tf - t0) / period) + 1, 2)
292292

293293
return np.linspace(t0, tf, npts)
294294

src/pybamm/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ def run_padding_rest(self, kwargs, rest_time, step_solution, inputs):
976976

977977
# Make sure we take at least 2 timesteps. The period is hardcoded to 10
978978
# minutes,the user can always override it by adding a rest step
979-
npts = max(int(round(rest_time / 600)) + 1, 2)
979+
npts = max(round(rest_time / 600) + 1, 2)
980980

981981
step_solution_with_rest = solver.step(
982982
step_solution,

src/pybamm/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def __str__(self):
272272
elif time < 60:
273273
return f"{time:.3f} s"
274274
output = []
275-
time = int(round(time))
275+
time = round(time)
276276
units = [(604800, "week"), (86400, "day"), (3600, "hour"), (60, "minute")]
277277
for k, name in units:
278278
f = time // k

0 commit comments

Comments
 (0)