Skip to content

Commit a386ba7

Browse files
authored
Upgrade ruff and enable isort rules (#2983)
Sort imports.
1 parent f63aeb4 commit a386ba7

File tree

85 files changed

+548
-526
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+548
-526
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v5.0.0
5+
rev: v6.0.0
66
hooks:
77
- id: check-added-large-files
88
- id: check-merge-conflict
@@ -12,7 +12,7 @@ repos:
1212
- id: trailing-whitespace
1313
- repo: https://github.com/astral-sh/ruff-pre-commit
1414
# Ruff version.
15-
rev: v0.12.0
15+
rev: v0.14.1
1616
hooks:
1717
# Run the linter.
1818
- id: ruff
@@ -28,7 +28,7 @@ repos:
2828
- python/sdist/pyproject.toml
2929

3030
- repo: https://github.com/asottile/pyupgrade
31-
rev: v3.20.0
31+
rev: v3.21.0
3232
hooks:
3333
- id: pyupgrade
3434
args: ["--py310-plus"]

doc/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import sys
1111
from enum import EnumType
1212
from unittest import mock
13+
1314
import sphinx
1415
from sphinx.transforms.post_transforms import ReferencesResolver
1516

@@ -19,8 +20,8 @@
1920
# for unclear reasons, the import of exhale_multiproject_monkeypatch
2021
# fails on some systems, because the the location of the editable install
2122
# is not automatically added to sys.path ¯\_(ツ)_/¯
22-
from importlib.metadata import Distribution
2323
import json
24+
from importlib.metadata import Distribution
2425
from urllib.parse import unquote_plus, urlparse
2526

2627
dist = Distribution.from_name("sphinx-contrib-exhale-multiproject")

doc/examples/example_errors.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@
2222
"from contextlib import suppress\n",
2323
"from pathlib import Path\n",
2424
"\n",
25+
"import amici\n",
2526
"import matplotlib.pyplot as plt\n",
2627
"import numpy as np\n",
27-
"\n",
28-
"import amici\n",
2928
"from amici import (\n",
30-
" simulation_status_to_str,\n",
31-
" SteadyStateSensitivityMode,\n",
29+
" SbmlImporter,\n",
3230
" SensitivityMethod,\n",
3331
" SensitivityOrder,\n",
32+
" SteadyStateSensitivityMode,\n",
33+
" import_model_module,\n",
3434
" run_simulation,\n",
35+
" simulation_status_to_str,\n",
3536
")\n",
3637
"from amici.petab.petab_import import import_petab_problem\n",
37-
"from amici.petab.simulations import simulate_petab, RDATAS, EDATAS\n",
38-
"from amici.plotting import plot_state_trajectories, plot_jacobian\n",
38+
"from amici.petab.simulations import EDATAS, RDATAS, simulate_petab\n",
39+
"from amici.plotting import plot_jacobian, plot_state_trajectories\n",
3940
"from petab.v1.sbml import get_sbml_model\n",
40-
"from amici import SbmlImporter, import_model_module\n",
4141
"\n",
4242
"try:\n",
4343
" import benchmark_models_petab\n",

doc/examples/example_jax/ExampleJax.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@
317317
"metadata": {},
318318
"outputs": [],
319319
"source": [
320-
"from amici.petab.simulations import simulate_petab\n",
321320
"import amici\n",
321+
"from amici.petab.simulations import simulate_petab\n",
322322
"\n",
323323
"amici_solver = amici_model.create_solver()\n",
324324
"amici_solver.set_sensitivity_order(amici.SensitivityOrder.first)\n",

0 commit comments

Comments
 (0)