Skip to content

Commit 43bf94d

Browse files
committed
Merge branch 'master' into v0.23.0dev
2 parents ad46d6c + bf81281 commit 43bf94d

10 files changed

Lines changed: 97 additions & 101 deletions

File tree

.github/workflows/run_unit_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: |
2929
python -m pip install --upgrade pip setuptools
30-
pip install -r requirements_test.txt
30+
pip install .[test]
3131
pip install ${{ matrix.dependencies }}
3232
- name: Lint with flake8
3333
run: |

.readthedocs.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,7 @@ formats: all
2424
# Optionally set the version of Python and requirements required to build your docs
2525
python:
2626
install:
27-
- requirements: requirements_docs.txt
28-
- path: .
27+
- method: pip
28+
path: .
29+
extra_requirements:
30+
- docs

docs/development.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Install requirements:
6161

6262
.. code-block:: none
6363
64-
pip install -r ~/highdicom/requirements_test.txt
64+
pip install .[test]
6565
6666
Run tests (including checks for PEP8 compliance):
6767

@@ -79,7 +79,7 @@ Install requirements:
7979

8080
.. code-block:: none
8181
82-
pip install -r ~/highdicom/requirements_docs.txt
82+
pip install .[docs]
8383
8484
Build documentation in *HTML* format:
8585

pyproject.toml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
[build-system]
2+
requires = ["setuptools>=64"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "highdicom"
7+
dynamic = ["version"]
8+
description = "High-level DICOM abstractions."
9+
readme = "README.md"
10+
requires-python = ">=3.6"
11+
authors = [
12+
{ name = "Markus D. Herrmann" },
13+
]
14+
maintainers = [
15+
{ name = "Markus D. Herrmann" },
16+
{ name = "Christopher P. Bridge" },
17+
]
18+
classifiers = [
19+
"Development Status :: 4 - Beta",
20+
"Intended Audience :: Science/Research",
21+
"License :: OSI Approved :: MIT License",
22+
"Operating System :: MacOS",
23+
"Operating System :: Microsoft :: Windows",
24+
"Operating System :: POSIX :: Linux",
25+
"Programming Language :: Python :: 3",
26+
"Programming Language :: Python :: 3.6",
27+
"Programming Language :: Python :: 3.7",
28+
"Programming Language :: Python :: 3.8",
29+
"Programming Language :: Python :: 3.9",
30+
"Programming Language :: Python :: 3.10",
31+
"Programming Language :: Python :: 3.11",
32+
"Programming Language :: Python :: 3.12",
33+
"Topic :: Multimedia :: Graphics",
34+
"Topic :: Scientific/Engineering :: Information Analysis",
35+
]
36+
dependencies = [
37+
"numpy>=1.19",
38+
"pillow-jpls>=1.0",
39+
"pillow>=8.3",
40+
"pydicom>=2.3.0,!=2.4.0",
41+
]
42+
43+
[project.optional-dependencies]
44+
libjpeg = [
45+
"pylibjpeg-libjpeg>=1.3",
46+
"pylibjpeg-openjpeg>=1.2",
47+
"pylibjpeg>=1.4",
48+
]
49+
test = [
50+
"mypy==0.971",
51+
"pytest==7.1.2",
52+
"pytest-cov==3.0.0",
53+
"pytest-flake8==1.1.1",
54+
"numpy-stubs @ git+https://github.com/numpy/numpy-stubs@201115370a0c011d879d69068b60509accc7f750",
55+
]
56+
docs = [
57+
"sphinx-autodoc-typehints==1.17.0",
58+
"sphinx-pyreverse==0.0.17",
59+
"sphinx-rtd-theme==1.0.0",
60+
"sphinxcontrib-autoprogram==0.1.7",
61+
"sphinxcontrib-websupport==1.2.4",
62+
]
63+
64+
[project.urls]
65+
homepage = "https://github.com/imagingdatacommons/highdicom"
66+
documentation = "https://highdicom.readthedocs.io/"
67+
repository = "https://github.com/ImagingDataCommons/highdicom.git"
68+
69+
[tool.pytest.ini_options]
70+
addopts = "--doctest-modules"
71+
testpaths = ["tests"]
72+
log_cli_level = "INFO"
73+
74+
[tool.mypy]
75+
warn_unreachable = true
76+
77+
[[tool.mypy.overrides]]
78+
module = "mypy-pydicom.*"
79+
ignore_missing_imports = true
80+
81+
[[tool.mypy.overrides]]
82+
module = "mypy-PIL.*"
83+
ignore_missing_imports = true

requirements_docs.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

requirements_test.txt

Lines changed: 0 additions & 5 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,3 @@ test=pytest
55
max_line_length = 80
66
ignore = E121 E125 W504
77
statistics = True
8-
9-
[mypy]
10-
warn_unreachable = True
11-
12-
[mypy-pydicom.*]
13-
ignore_missing_imports = True
14-
15-
[mypy-PIL.*]
16-
ignore_missing_imports = True
17-
18-
[tool:pytest]
19-
python_files = tests/*.py
20-
log_cli_level = INFO
21-
addopts = --doctest-modules

setup.py

Lines changed: 0 additions & 65 deletions
This file was deleted.

src/highdicom/seg/sop.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2719,7 +2719,7 @@ def _check_and_cast_pixel_array(
27192719
else:
27202720
segments_overlap = SegmentsOverlapValues.NO
27212721

2722-
elif pixel_array.dtype in (np.float_, np.float32, np.float64):
2722+
elif pixel_array.dtype in (np.float32, np.float64):
27232723
unique_values = np.unique(pixel_array)
27242724
if np.min(unique_values) < 0.0 or np.max(unique_values) > 1.0:
27252725
raise ValueError(
@@ -2905,7 +2905,7 @@ def _get_segment_pixel_array(
29052905
(0 or 1).
29062906
29072907
"""
2908-
if pixel_array.dtype in (np.float_, np.float32, np.float64):
2908+
if pixel_array.dtype in (np.float32, np.float64):
29092909
# Based on the previous checks and casting, if we get here the
29102910
# output is a FRACTIONAL segmentation Floating-point numbers must
29112911
# be mapped to 8-bit integers in the range [0,

tests/test_seg.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ def fractional_transfer_syntax_uid(request):
743743
return request.param
744744

745745
@staticmethod
746-
@pytest.fixture(params=[np.bool_, np.uint8, np.uint16, np.float_])
746+
@pytest.fixture(params=[np.bool_, np.uint8, np.uint16, np.float64])
747747
def pix_type(request):
748748
return request.param
749749

@@ -1788,7 +1788,7 @@ def test_pixel_types_fractional(
17881788
max_fractional_value=max_fractional_value,
17891789
transfer_syntax_uid=fractional_transfer_syntax_uid
17901790
)
1791-
if pix_type == np.float_:
1791+
if pix_type == np.float64:
17921792
assert (
17931793
instance.SegmentsOverlap ==
17941794
SegmentsOverlapValues.UNDEFINED.value
@@ -1822,7 +1822,7 @@ def test_pixel_types_fractional(
18221822
max_fractional_value=max_fractional_value,
18231823
transfer_syntax_uid=fractional_transfer_syntax_uid
18241824
)
1825-
if pix_type == np.float_:
1825+
if pix_type == np.float64:
18261826
assert (
18271827
instance.SegmentsOverlap ==
18281828
SegmentsOverlapValues.UNDEFINED.value
@@ -2315,7 +2315,7 @@ def test_construction_empty_invalid_floats(self):
23152315
with pytest.raises(ValueError):
23162316
Segmentation(
23172317
source_images=[self._ct_image], # empty
2318-
pixel_array=self._ct_pixel_array.astype(np.float_) * 2,
2318+
pixel_array=self._ct_pixel_array.astype(np.float64) * 2,
23192319
segmentation_type=SegmentationTypeValues.FRACTIONAL.value,
23202320
segment_descriptions=(
23212321
self._segment_descriptions
@@ -2335,7 +2335,7 @@ def test_construction_empty_invalid_floats_binary(self):
23352335
with pytest.raises(ValueError):
23362336
Segmentation(
23372337
source_images=[self._ct_image],
2338-
pixel_array=self._ct_pixel_array.astype(np.float_) * 0.5,
2338+
pixel_array=self._ct_pixel_array.astype(np.float64) * 0.5,
23392339
segmentation_type=SegmentationTypeValues.BINARY.value,
23402340
segment_descriptions=(
23412341
self._segment_descriptions

0 commit comments

Comments
 (0)