Skip to content

Commit

Permalink
Merge branch 'branch-25.02' into use-gcc-13-with-cuda-12-conda-builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice authored Jan 16, 2025
2 parents c276256 + 9477daa commit c00d8e0
Show file tree
Hide file tree
Showing 43 changed files with 492 additions and 453 deletions.
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ dependencies:
- gcc_linux-64=11.*
- imagecodecs>=2021.6.8
- ipython
- lazy_loader>=0.1
- lazy-loader>=0.4
- libcufile-dev=1.4.0.31
- libcufile=1.4.0.31
- libnvjpeg-dev=11.6.0.55
- libnvjpeg=11.6.0.55
- matplotlib-base
- matplotlib-base>=3.7
- nbsphinx
- ninja
- numpy>=1.23.4,<3.0a0
Expand All @@ -36,15 +36,15 @@ dependencies:
- pytest-cov>=2.12.1
- pytest-lazy-fixtures>=1.0.0
- pytest-xdist
- pytest>=6.2.4,<8.0.0a0
- pytest>=7.0.0,<9.0.0a0
- python>=3.10,<3.13
- pywavelets>=1.0
- pywavelets>=1.6
- recommonmark
- scikit-image>=0.19.0,<0.25.0a0
- scipy>=1.6.0
- scikit-image>=0.19.0,<0.26.0a0
- scipy>=1.11.2
- sphinx<6
- sysroot_linux-64==2.28
- tifffile>=2022.7.28
- tifffile>=2022.8.12
- yasm
- pip:
- opencv-python-headless>=4.6
Expand Down
14 changes: 7 additions & 7 deletions conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ dependencies:
- gcc_linux-64=13.*
- imagecodecs>=2021.6.8
- ipython
- lazy_loader>=0.1
- lazy-loader>=0.4
- libcufile-dev
- libnvjpeg-dev
- libnvjpeg-static
- matplotlib-base
- matplotlib-base>=3.7
- nbsphinx
- ninja
- numpy>=1.23.4,<3.0a0
Expand All @@ -35,15 +35,15 @@ dependencies:
- pytest-cov>=2.12.1
- pytest-lazy-fixtures>=1.0.0
- pytest-xdist
- pytest>=6.2.4,<8.0.0a0
- pytest>=7.0.0,<9.0.0a0
- python>=3.10,<3.13
- pywavelets>=1.0
- pywavelets>=1.6
- recommonmark
- scikit-image>=0.19.0,<0.25.0a0
- scipy>=1.6.0
- scikit-image>=0.19.0,<0.26.0a0
- scipy>=1.11.2
- sphinx<6
- sysroot_linux-64==2.28
- tifffile>=2022.7.28
- tifffile>=2022.8.12
- yasm
- pip:
- opencv-python-headless>=4.6
Expand Down
18 changes: 9 additions & 9 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ dependencies:
- output_types: [conda, requirements, pyproject]
packages:
- click
- lazy_loader>=0.1
- lazy-loader>=0.4
- numpy>=1.23.4,<3.0a0
- scikit-image>=0.19.0,<0.25.0a0
- scipy>=1.6.0
- scikit-image>=0.19.0,<0.26.0a0
- scipy>=1.11.2
- output_types: conda
packages:
- cupy>=12.0.0
Expand All @@ -293,17 +293,17 @@ dependencies:
- output_types: [conda, requirements, pyproject]
packages:
- psutil>=5.8.0
- pytest>=6.2.4,<8.0.0a0
- pytest>=7.0.0,<9.0.0a0
- pytest-cov>=2.12.1
- pytest-lazy-fixtures>=1.0.0
- pytest-xdist
- tifffile>=2022.7.28
- tifffile>=2022.8.12
- pooch>=1.6.0 # needed to download scikit-image sample data
- pywavelets>=1.0
- pywavelets>=1.6
- output_types: [conda]
packages:
- imagecodecs>=2021.6.8
- matplotlib-base
- matplotlib-base>=3.7
- openslide-python>=1.3.0
- pip
- pip:
Expand All @@ -313,9 +313,9 @@ dependencies:
# skip packages on arm64 that don't provide a wheel
- imagecodecs>=2021.6.8; platform_machine=='x86_64'
- openslide-python>=1.3.0; platform_machine=='x86_64'
- matplotlib
- matplotlib>=3.7
- opencv-python-headless>=4.6
- output_types: [pyproject]
packages:
# Already added to requirements via docs. This is for tests.
- numpydoc>=1.5
- numpydoc>=1.7
16 changes: 8 additions & 8 deletions python/cucim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ requires-python = ">=3.10"
dependencies = [
"click",
"cupy-cuda11x>=12.0.0",
"lazy_loader>=0.1",
"lazy-loader>=0.4",
"numpy>=1.23.4,<3.0a0",
"scikit-image>=0.19.0,<0.25.0a0",
"scipy>=1.6.0",
"scikit-image>=0.19.0,<0.26.0a0",
"scipy>=1.11.2",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
classifiers = [
"Development Status :: 4 - Beta",
Expand Down Expand Up @@ -58,18 +58,18 @@ Tracker = "https://github.com/rapidsai/cucim/issues"
[project.optional-dependencies]
test = [
"imagecodecs>=2021.6.8; platform_machine=='x86_64'",
"matplotlib",
"numpydoc>=1.5",
"matplotlib>=3.7",
"numpydoc>=1.7",
"opencv-python-headless>=4.6",
"openslide-python>=1.3.0; platform_machine=='x86_64'",
"pooch>=1.6.0",
"psutil>=5.8.0",
"pytest-cov>=2.12.1",
"pytest-lazy-fixtures>=1.0.0",
"pytest-xdist",
"pytest>=6.2.4,<8.0.0a0",
"pywavelets>=1.0",
"tifffile>=2022.7.28",
"pytest>=7.0.0,<9.0.0a0",
"pywavelets>=1.6",
"tifffile>=2022.8.12",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
developer = [
"black",
Expand Down
4 changes: 2 additions & 2 deletions python/cucim/src/cucim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
except ImportError:
pass

import lazy_loader as lazy
import lazy_loader as _lazy

__getattr__, __lazy_dir__, _ = lazy.attach_stub(__name__, __file__)
__getattr__, __lazy_dir__, _ = _lazy.attach_stub(__name__, __file__)


def __dir__():
Expand Down
40 changes: 31 additions & 9 deletions python/cucim/src/cucim/skimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@
exposure
Image intensity adjustment, e.g., histogram equalization, etc.
feature
Feature detection and extraction, e.g., texture analysis corners, etc.
Feature detection and extraction, e.g., texture analysis, corners, etc.
filters
Sharpening, edge finding, rank filters, thresholding, etc.
measure
Measurement of image properties, e.g., region properties and contours.
Measurement of image properties, e.g., region properties, moments.
metrics
Metrics corresponding to images, e.g. distance metrics, similarity, etc.
Metrics corresponding to images, e.g., distance metrics, similarity, etc.
morphology
Morphological operations, e.g., opening or skeletonization.
Morphological algorithms, e.g., closing, opening, skeletonization.
registration
Image registration algorithms, e.g., optical flow or phase cross
correlation.
restoration
Restoration algorithms, e.g., deconvolution algorithms, denoising, etc.
segmentation
Partitioning an image into multiple regions.
Algorithms to partition images into meaningful regions or boundaries.
transform
Geometric and other transforms, e.g., rotation or the Radon transform.
Geometric and other transformations, e.g., rotations, warp.
util
Generic utilities.
Expand Down Expand Up @@ -60,13 +63,32 @@
"""

import lazy_loader as lazy
import lazy_loader as _lazy

__getattr__, __lazy_dir__, _ = lazy.attach_stub(__name__, __file__)
__getattr__, __lazy_dir__, _ = _lazy.attach_stub(__name__, __file__)

# Don't use the `__all__` and `__dir__` returned by `attach_stub` since that
# one would expose utility functions we don't want to advertise in our
# top-level module anymore.
__all__ = [
"color",
"data",
"exposure",
"feature",
"filters",
"measure",
"metrics",
"morphology",
"registration",
"restoration",
"segmentation",
"transform",
"util",
]


def __dir__():
return __lazy_dir__()
return __all__.copy()


# Legacy imports into the root namespace; not advertised in __all__
Expand Down
2 changes: 0 additions & 2 deletions python/cucim/src/cucim/skimage/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import lazy_loader as lazy # noqa: F401

submodules = [
"color",
"data",
Expand Down
11 changes: 1 addition & 10 deletions python/cucim/src/cucim/skimage/_shared/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,12 @@

import cucim.skimage._vendored.ndimage as ndi

from .._shared.utils import (
DEPRECATED,
_supported_float_type,
convert_to_float,
deprecate_parameter,
)
from .._shared.utils import _supported_float_type, convert_to_float


@deprecate_parameter(
"output", new_name="out", start_version="24.06", stop_version="25.02"
)
def gaussian(
image,
sigma=1,
output=DEPRECATED,
mode="nearest",
cval=0,
preserve_range=False,
Expand Down
11 changes: 10 additions & 1 deletion python/cucim/src/cucim/skimage/_shared/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def assert_stacklevel(warnings, *, offset=-1):
When cucim.skimage raises warnings, the stacklevel should ideally be set
so that the origin of the warnings will point to the public function
that was called by the user and not necessarily the very place where the
warnings were emitted (which may be inside of some internal function).
warnings were emitted (which may be inside some internal function).
This utility function helps with checking that
the stacklevel was set correctly on warnings captured by `pytest.warns`.
Expand Down Expand Up @@ -84,10 +84,19 @@ def assert_stacklevel(warnings, *, offset=-1):
... )
... assert_stacklevel(record, offset=-3)
"""
__tracebackhide__ = True # Hide traceback for py.test

frame = inspect.stack()[1].frame # 0 is current frame, 1 is outer frame
line_number = frame.f_lineno + offset
filename = frame.f_code.co_filename
expected = f"{filename}:{line_number}"
for warning in warnings:
actual = f"{warning.filename}:{warning.lineno}"
assert actual == expected, f"{actual} != {expected}"
msg = (
"Warning with wrong stacklevel:\n"
f" Expected: {expected}\n"
f" Actual: {actual}\n"
f" {warning.category.__name__}: {warning.message}"
)
assert actual == expected, msg
18 changes: 4 additions & 14 deletions python/cucim/src/cucim/skimage/_shared/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,31 +319,21 @@ def test_warning_removed_param(self):
r".*_func_deprecated_params`."
)
with pytest.warns(FutureWarning, match=match):
assert _func_deprecated_params(1, 2) == (
1,
DEPRECATED,
DEPRECATED,
None,
)
assert _func_deprecated_params(1, 2) == (1, 2, DEPRECATED, None)
with pytest.warns(FutureWarning, match=match):
assert _func_deprecated_params(1, 2, 3) == (
1,
DEPRECATED,
DEPRECATED,
None,
)
assert _func_deprecated_params(1, 2, 3) == (1, 2, 3, None)
with pytest.warns(FutureWarning, match=match):
assert _func_deprecated_params(1, old0=2) == (
1,
DEPRECATED,
2,
DEPRECATED,
None,
)
with pytest.warns(FutureWarning, match=match):
assert _func_deprecated_params(1, old1=2) == (
1,
DEPRECATED,
DEPRECATED,
2,
None,
)

Expand Down
17 changes: 11 additions & 6 deletions python/cucim/src/cucim/skimage/_shared/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,19 @@ def fixed_func(*args, **kwargs):
# Extract value of deprecated parameter
if len(args) > deprecated_idx:
deprecated_value = args[deprecated_idx]
args = (
args[:deprecated_idx]
+ (DEPRECATED,)
+ args[deprecated_idx + 1 :]
)
# Overwrite old with DEPRECATED if replacement exists
if self.new_name is not None:
args = (
args[:deprecated_idx]
+ (DEPRECATED,)
+ args[deprecated_idx + 1 :]
)
if self.deprecated_name in kwargs.keys():
deprecated_value = kwargs[self.deprecated_name]
kwargs[self.deprecated_name] = DEPRECATED
# Overwrite old with DEPRECATED if replacement exists
if self.new_name is not None:
kwargs[self.deprecated_name] = DEPRECATED

# Extract value of new parameter (if present)
if new_idx is not False and len(args) > new_idx:
new_value = args[new_idx]
Expand Down
2 changes: 2 additions & 0 deletions python/cucim/src/cucim/skimage/color/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
"""Color space conversion."""

from .colorconv import (
ahx_from_rgb,
bex_from_rgb,
Expand Down
4 changes: 2 additions & 2 deletions python/cucim/src/cucim/skimage/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import lazy_loader as lazy
import lazy_loader as _lazy

__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
__getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__)
6 changes: 4 additions & 2 deletions python/cucim/src/cucim/skimage/exposure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import lazy_loader as lazy
"""Image intensity adjustment, e.g., histogram equalization, etc."""

__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
import lazy_loader as _lazy

__getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__)
6 changes: 4 additions & 2 deletions python/cucim/src/cucim/skimage/feature/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import lazy_loader as lazy
"""Feature detection and extraction, e.g., blobs, corners, etc."""

__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
import lazy_loader as _lazy

__getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__)
6 changes: 4 additions & 2 deletions python/cucim/src/cucim/skimage/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import lazy_loader as lazy
"""Sharpening, edge finding, thresholding, etc."""

__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
import lazy_loader as _lazy

__getattr__, __dir__, __all__ = _lazy.attach_stub(__name__, __file__)
Loading

0 comments on commit c00d8e0

Please sign in to comment.