Skip to content

Commit

Permalink
Merge pull request #589 from rapidsai/branch-23.08
Browse files Browse the repository at this point in the history
Forward-merge branch-23.08 to branch-23.10
  • Loading branch information
GPUtester authored Jul 26, 2023
2 parents 9ba54cc + f8e9b38 commit 1398579
Show file tree
Hide file tree
Showing 16 changed files with 156 additions and 216 deletions.
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- imagecodecs>=2021.6.8
- ipython
- jbig
- lazy_loader >=0.1
- libcufile-dev=1.4.0.31
- libcufile=1.4.0.31
- libnvjpeg-dev=11.6.0.55
Expand Down
1 change: 1 addition & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies:
- imagecodecs>=2021.6.8
- ipython
- jbig
- lazy_loader >=0.1
- libcufile-dev
- libnvjpeg-dev
- libnvjpeg-static
Expand Down
1 change: 1 addition & 0 deletions conda/recipes/cucim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ requirements:
- {{ pin_compatible('numpy') }}
- click
- cupy >=12.0.0
- lazy_loader >=0.1
- libcucim ={{ version }}
# - openslide # skipping here but benchmark binary would need openslide library
- python
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ dependencies:
- click
- cupy >=12.0.0
- jbig
- lazy_loader >=0.1
- libwebp-base
- numpy >=1.21.3
- scikit-image >=0.19.0,<0.22.0a0
Expand Down
2 changes: 2 additions & 0 deletions python/cucim/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,6 @@ include tox.ini .travis.yml .appveyor.yml .readthedocs.yml
include versioneer.py
include src/cucim/clara/*.so*

recursive-include src/cucim *.py *.pyi *.cu *.h *.npy *.txt *.md

global-exclude *.py[cod] __pycache__/*
1 change: 1 addition & 0 deletions python/cucim/ci/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ virtualenv>=16.6.0
pip>=19.1.1
setuptools>=18.0.1
six>=1.14.0
lazy_loader>=0.1
6 changes: 3 additions & 3 deletions python/cucim/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def read(*names, **kwargs):
url='https://developer.nvidia.com/multidimensional-image-processing',
packages=find_packages('src'),
package_dir={'cucim': 'src/cucim'},
package_data={"": ["*.pyi", "*.h", "*.cu"]},
include_package_data=True,
zip_safe=False,
classifiers=[
Expand All @@ -56,11 +57,10 @@ def read(*names, **kwargs):
'Programming Language :: C++',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
# 'Operating System :: OS Independent',
# 'Operating System :: Unix',
# 'Operating System :: POSIX',
Expand All @@ -87,7 +87,7 @@ def read(*names, **kwargs):
setup_requires=SETUP_REQUIRES,
install_requires=[
# TODO: Check cupy dependency based on cuda version
'click', 'numpy', # 'scipy', 'scikit-image'
'click', 'numpy', "lazy_loader>=0.1", # 'scipy', 'scikit-image'
# eg: 'aspectlib==1.1.1', 'six>=1.7',
],
extras_require={
Expand Down
8 changes: 2 additions & 6 deletions python/cucim/src/cucim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,9 @@
del _version


from .skimage._shared import lazy
import lazy_loader as lazy

__getattr__, __lazy_dir__, _ = lazy.attach(
__name__,
submodules,
submod_attrs,
)
__getattr__, __lazy_dir__, _ = lazy.attach_stub(__name__, __file__)


def __dir__():
Expand Down
35 changes: 35 additions & 0 deletions python/cucim/src/cucim/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

submodules = []

try:
import cupy
_is_cupy_available = True
submodules += ['core', 'skimage']
except ImportError:
pass

try:
from .clara import CuImage, __version__, cli
_is_clara_available = True
submodules += ['clara']
except ImportError:
from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
del _version

__all__ = submodules + ['__version__', 'is_available']
36 changes: 9 additions & 27 deletions python/cucim/src/cucim/skimage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,35 +60,17 @@
"""

from ._shared import lazy
import lazy_loader as lazy

submodules = [
'color',
'data',
'exposure',
'feature',
'filters',
'measure',
'metrics',
'morphology',
'registration',
'restoration',
'segmentation',
'transform',
'util',
]


__getattr__, __lazy_dir__, _ = lazy.attach(
__name__,
submodules,
{'util.dtype': ['dtype_limits', 'img_as_bool', 'img_as_float',
'img_as_float32', 'img_as_float64', 'img_as_int',
'img_as_ubyte', 'img_as_uint'],
'util.lookfor': ['lookfor'],
}
)
__getattr__, __lazy_dir__, _ = lazy.attach_stub(__name__, __file__)


def __dir__():
return __lazy_dir__()


# Legacy imports into the root namespace; not advertised in __all__
from .util.dtype import (dtype_limits, img_as_bool, img_as_float,
img_as_float32, img_as_float64, img_as_int,
img_as_ubyte, img_as_uint)
from .util.lookfor import lookfor
23 changes: 23 additions & 0 deletions python/cucim/src/cucim/skimage/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import lazy_loader as lazy

submodules = [
'color',
'data',
'exposure',
'feature',
'filters',
'measure',
'metrics',
'morphology',
'registration',
'restoration',
'segmentation',
'transform',
'util',
]

__all__ = submodules

from . import (color, data, exposure, feature, filters, measure, metrics,
morphology, registration, restoration, segmentation, transform,
util)
139 changes: 0 additions & 139 deletions python/cucim/src/cucim/skimage/_shared/lazy.py

This file was deleted.

10 changes: 2 additions & 8 deletions python/cucim/src/cucim/skimage/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
from .._shared import lazy
import lazy_loader as lazy

__getattr__, __dir__, __all__ = lazy.attach(
__name__,
submodules={},
submod_attrs={
'_binary_blobs': ['binary_blobs'],
}
)
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
5 changes: 5 additions & 0 deletions python/cucim/src/cucim/skimage/data/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__all__ = [
'binary_blobs',
]

from ._binary_blobs import binary_blobs
35 changes: 2 additions & 33 deletions python/cucim/src/cucim/skimage/filters/__init__.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,3 @@
from .._shared import lazy
import lazy_loader as lazy

__getattr__, __dir__, __all__ = lazy.attach(
__name__,
# submodules={'rank'},
submod_attrs={
'lpi_filter': [
'filter_forward', 'filter_inverse', 'wiener', 'LPIFilter2D'
],
'_gaussian': ['gaussian', 'difference_of_gaussians'],
'edges': ['sobel', 'sobel_h', 'sobel_v',
'scharr', 'scharr_h', 'scharr_v',
'prewitt', 'prewitt_h', 'prewitt_v',
'roberts', 'roberts_pos_diag', 'roberts_neg_diag',
'laplace',
'farid', 'farid_h', 'farid_v'],
'_rank_order': ['rank_order'],
'_gabor': ['gabor_kernel', 'gabor'],
'thresholding': [
'threshold_local', 'threshold_otsu', 'threshold_yen',
'threshold_isodata', 'threshold_li', 'threshold_minimum',
'threshold_mean', 'threshold_triangle',
'threshold_niblack', 'threshold_sauvola',
'threshold_multiotsu', 'try_all_threshold',
'apply_hysteresis_threshold'
],
'ridges': ['meijering', 'sato', 'frangi', 'hessian'],
'_median': ['median'],
'_sparse': ['correlate_sparse'],
'_unsharp_mask': ['unsharp_mask'],
'_window': ['window'],
'_fft_based': ['butterworth']
}
)
__getattr__, __dir__, __all__ = lazy.attach_stub(__name__, __file__)
Loading

0 comments on commit 1398579

Please sign in to comment.