Skip to content

Commit

Permalink
Add isort (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsmkn committed Feb 25, 2022
1 parent 2586c5e commit 8f1ec64
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions .pre-commit-config.yaml
@@ -1,5 +1,3 @@
default_language_version:
python: python3.8
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
Expand All @@ -15,6 +13,10 @@ repos:
- id: pyupgrade
language: python
args: [--py37-plus]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 22.1.0
hooks:
Expand All @@ -27,7 +29,6 @@ repos:
language: python
additional_dependencies:
- flake8-bugbear
- flake8-import-order
- pep8-naming
# The following is disabled due to a runtime error
# - flake8-docstrings
Expand Down
2 changes: 1 addition & 1 deletion evalutils/io.py
Expand Up @@ -4,10 +4,10 @@
from pathlib import Path
from typing import Dict, List

from SimpleITK import GetArrayFromImage, ReadImage
from imageio import get_reader
from pandas import read_csv
from pandas.errors import EmptyDataError, ParserError
from SimpleITK import GetArrayFromImage, ReadImage

from .exceptions import FileLoaderError

Expand Down
1 change: 0 additions & 1 deletion evalutils/stats.py
Expand Up @@ -6,7 +6,6 @@
from numpy import ndarray
from scipy.ndimage import binary_erosion, convolve, generate_binary_structure


VOXELSPACING_TYPE = Optional[
Union[Tuple[Union[float, int], ...], List[Union[float, int]], float, int]
]
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Expand Up @@ -43,6 +43,11 @@ sphinx_autodoc_typehints = "*"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"
known_first_party = ["evalutils", "tests"]
line_length = 79

[tool.black]
line-length = 79
target-version = ['py37']
Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Expand Up @@ -6,10 +6,7 @@ python_version = 3.9
# disallow_untyped_defs = True

[flake8]
application-import-names =
evalutils
tests
import-order-style = pycharm
max-line-length = 79
docstring-convention = numpy
max-complexity = 10
select =
Expand Down
3 changes: 1 addition & 2 deletions tests/test_algorithm.py
Expand Up @@ -4,8 +4,8 @@
from pathlib import Path
from typing import Dict

import SimpleITK
import numpy as np
import SimpleITK
from pandas import DataFrame
from scipy.ndimage import center_of_mass, label

Expand All @@ -15,7 +15,6 @@
SegmentationAlgorithm,
)


TEMPLATE_TEST_DIR = (
Path(__file__).parent.parent
/ "evalutils"
Expand Down
2 changes: 1 addition & 1 deletion tests/test_stats.py
@@ -1,9 +1,9 @@
from typing import Tuple

import SimpleITK
import numpy as np
import pytest
import scipy.ndimage as ndimage
import SimpleITK
import sklearn
from numpy.testing import assert_array_almost_equal
from scipy.ndimage import generate_binary_structure
Expand Down

0 comments on commit 8f1ec64

Please sign in to comment.