Skip to content

Commit 8acde6d

Browse files
committed
Update requirements.txt and toml for dependency fix. remove patchify requirement. Update Min python to 3.11
1 parent f724249 commit 8acde6d

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

portpy/photon/influence_matrix.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
from copy import deepcopy
2222
from scipy.sparse import csr_matrix
2323
import itertools
24-
from patchify import patchify
24+
try:
25+
from patchify import patchify
26+
except ImportError:
27+
patchify = None
2528
from typing import List, Union
2629
from .ct import CT
2730
from .beam import Beams
@@ -873,6 +876,11 @@ def down_sample_voxels(self, down_sample_xyz: List[int] = None):
873876
vox_map = []
874877
vox_weights = []
875878
slices, height, width = down_sample_xyz[2], down_sample_xyz[1], down_sample_xyz[0]
879+
if patchify is None:
880+
raise ImportError(
881+
"patchify is required for this functionality. "
882+
"Install it with: pip install portpy[all]"
883+
)
876884
patches = patchify(vox_3d, (slices, height, width), step=(slices, height, width))
877885
# pat = np.vstack(patches)
878886
# pat = np.vstack(pat)

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authors = [
1616
{ name = "Saad Nadeem", email = "nadeems@mskcc.org" },
1717
{ name = "Masoud Zarepisheh", email = "zarepism@mskcc.org" }
1818
]
19-
requires-python = ">=3.9"
19+
requires-python = ">=3.11"
2020
classifiers = [
2121
"Development Status :: 1 - Planning",
2222
"Intended Audience :: Science/Research",
@@ -42,8 +42,7 @@ dependencies = [
4242
"tabulate>=0.9.0",
4343
"jinja2==3.1.5",
4444
"typing-extensions>=4.8",
45-
"scikit-image>=0.23",
46-
"patchify>=0.2.3"
45+
"scikit-image>=0.23"
4746
]
4847

4948
[tool.setuptools.packages.find]
@@ -72,7 +71,7 @@ pythonpath = ["."]
7271
[project.optional-dependencies]
7372
mosek = ["Mosek>=9.3.14"]
7473
pydicom = ["pydicom>=2.2.0"]
75-
all = ["Mosek>=9.3.14", "pydicom>=2.2.0", "websocket-client>=1.8.0", "visdom>=0.2.4", "dominate>=2.6.0", "torch>=2.7.0", "torchfile>=0.1.0", "torchvision>=0.9.1", "huggingface-hub>=0.34.3"]
74+
all = ["Mosek>=9.3.14", "pydicom>=2.2.0", "websocket-client>=1.8.0", "visdom>=0.2.4", "dominate>=2.6.0", "torch>=2.7.0", "torchfile>=0.1.0", "torchvision>=0.9.1", "huggingface-hub>=0.34.3","patchify==0.2.3"]
7675
test = ["pytest>=8.0", "huggingface-hub>=0.34.3"]
7776
data = ["huggingface-hub>=0.34.3", "pydicom>=2.2.0"]
7877
ai = ["websocket-client>=1.8.0", "visdom>=0.2.4", "dominate>=2.6.0", "torch>=2.7.0", "torchfile>=0.1.0", "torchvision>=0.9.1"]

requirements.txt

-34 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)