Skip to content

Commit fa0013e

Browse files
committed
Use ruff to format code instead of black and isort
1 parent f33dc39 commit fa0013e

File tree

5 files changed

+12
-17
lines changed

5 files changed

+12
-17
lines changed

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,3 @@ module = [
6666
"scipy.*",
6767
]
6868
ignore_missing_imports = true
69-
70-
[tool.isort]
71-
profile = "black"
72-
multi_line_output = 3

stagpy/args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@
1111
import matplotlib.style as mpls
1212
from loam.cli import CLIManager, Subcmd
1313

14-
from . import ISOLATED
15-
from . import __doc__ as doc_module
1614
from . import (
15+
ISOLATED,
1716
_styles,
1817
commands,
1918
conf,
@@ -24,6 +23,7 @@
2423
rprof,
2524
time_series,
2625
)
26+
from . import __doc__ as doc_module
2727
from ._helpers import baredoc
2828
from .config import CONFIG_DIR
2929

stagpy/processing.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,7 @@ def init_c_overturn(step: Step) -> Rprof:
277277
def initprof(rpos: float) -> float:
278278
"""Theoretical initial profile."""
279279
if rpos < rsup:
280-
return xi0s * ((rtop**3 - rbot**3) / (rtop**3 - rpos**3)) ** (
281-
1 - k_fe
282-
)
280+
return xi0s * ((rtop**3 - rbot**3) / (rtop**3 - rpos**3)) ** (1 - k_fe)
283281
return xieut
284282

285283
rad = np.linspace(rbot, rtop, 500)

stagpy/stagyydata.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def _as_view_item(obj: int) -> None:
6262

6363

6464
def _as_view_item(
65-
obj: Union[Sequence[StepIndex], slice, int]
65+
obj: Union[Sequence[StepIndex], slice, int],
6666
) -> Union[Sequence[StepIndex], Sequence[slice], None]:
6767
"""Return None or a suitable iterable to build a _StepsView."""
6868
try:
@@ -423,7 +423,9 @@ def __getitem__(
423423
istep = int(istep) # type: ignore
424424
except ValueError:
425425
raise error.InvalidTimestepError(
426-
self.sdat, istep, "Time step should be an integer value" # type: ignore
426+
self.sdat,
427+
istep, # type: ignore
428+
"Time step should be an integer value",
427429
)
428430
if istep < 0:
429431
istep += len(self)

tox.ini

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,17 @@ python_files = test_*.py
3232
[testenv:fmt]
3333
skip_install = true
3434
deps =
35-
isort==5.12.0
36-
black==23.3.0
35+
ruff==0.1.9
3736
commands =
38-
isort stagpy/ tests/
39-
black stagpy/ tests/
37+
ruff check --select I --fix stagpy tests
38+
ruff format stagpy tests
4039

4140
[testenv:fmt-check]
4241
skip_install = true
4342
deps = {[testenv:fmt]deps}
4443
commands =
45-
isort --check stagpy/ tests/
46-
black --check stagpy/ tests/
44+
ruff check --select I stagpy tests
45+
ruff format --check stagpy tests
4746

4847
[gh]
4948
python =

0 commit comments

Comments
 (0)