Skip to content

Commit

Permalink
Add lower bounds to dependencies (#1246)
Browse files Browse the repository at this point in the history
* Add lower bounds to dependencies

* Add all lower bounds

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add bounds in test dependencies

* Fix Ruff error

* Add lower bound for packaging

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
fepegar and pre-commit-ci[bot] authored Dec 5, 2024
1 parent 9647c42 commit 0eb4f6f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
39 changes: 21 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,25 @@ classifiers = [
keywords = ["medical", "image processing", "pytorch", "augmentation", "mri"]
requires-python = ">=3.9,<3.13"
dependencies = [
"deprecated",
"humanize",
"nibabel",
"numpy>=1.15",
"scipy",
"simpleitk!=2.0.*,!=2.1.1.1",
"torch>=1.1",
"tqdm",
"typer",
"deprecated>=1.2",
"humanize>=0.1",
"nibabel>=3",
"numpy>=1.20",
"packaging>=20",
"rich>=10",
"scipy>=1.7",
"simpleitk >=1.3, !=2.0.*, !=2.1.1.1",
"torch>=1.9",
"tqdm>=4.40",
"typer>=0.1",
]

[project.optional-dependencies]
csv = [
"pandas",
"pandas>=1",
]
plot = [
"matplotlib",
"matplotlib>=3.4",
]

[project.scripts]
Expand All @@ -74,7 +76,8 @@ dev = [
{ include-group = "maintain" },
{ include-group = "test" },
"ipykernel",
"ruff",
"ruff>0.0.40",
"ipywidgets",
]
doc = [
"einops",
Expand All @@ -91,13 +94,13 @@ maintain = [
"pre-commit-uv",
]
test = [
"coverage",
"mypy",
"parameterized",
"pillow",
"pytest",
"coverage>=5",
"mypy>=0.800",
"parameterized>=0.7",
"pillow>=8",
"pytest>=5",
"pytest-cov",
"pytest-sugar",
"pytest-sugar>=0.10",
"tox-uv",
"types-deprecated",
]
Expand Down
1 change: 1 addition & 0 deletions tests/data/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def test_write_nd_with_a_read_it_with_b(save_lib, load_lib, dims):
tensor.squeeze(),
loaded_tensor.squeeze(),
msg=f'Save lib: {save_lib}; load lib: {load_lib}; dims: {dims}',
check_stride=False,
)
TorchioTestCase.assert_tensor_equal(affine, loaded_affine)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import numpy as np
import pytest
import torch
from packaging.version import Version

from torchio import LabelMap
from torchio import ScalarImage
Expand Down Expand Up @@ -80,7 +81,10 @@ def test_with_saved_dict(self):
landmarks_dict = {'image': landmarks}
landmarks_path = self.dir / 'landmarks_dict.pth'
torch.save(landmarks_dict, landmarks_path)
landmarks_dict = torch.load(landmarks_path, weights_only=False)
kwargs = {}
if Version(torch.__version__) >= Version('1.13'):
kwargs['weights_only'] = False
landmarks_dict = torch.load(landmarks_path, **kwargs)
transform = HistogramStandardization(landmarks_dict)
transform(self.dataset[0])

Expand Down
1 change: 1 addition & 0 deletions tests/transforms/preprocessing/test_to_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def test_las_to_ras(self):
self.assert_tensor_almost_equal(
transformed.t1.data,
torch.from_numpy(array_flip),
check_stride=False,
)

fixture = np.eye(4)
Expand Down

0 comments on commit 0eb4f6f

Please sign in to comment.