Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove NumPy <2 pin #762

Merged
merged 6 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
- matplotlib-base
- nbsphinx
- ninja
- numpy>=1.23.4,<2.0a0
- numpy>=1.23.4,<3.0a0
- numpydoc>=1.5
- nvcc_linux-64=11.8
- openslide-python>=1.3.0
Expand Down
2 changes: 1 addition & 1 deletion conda/environments/all_cuda-125_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
- matplotlib-base
- nbsphinx
- ninja
- numpy>=1.23.4,<2.0a0
- numpy>=1.23.4,<3.0a0
- numpydoc>=1.5
- openslide-python>=1.3.0
- pip
Expand Down
2 changes: 1 addition & 1 deletion conda/recipes/cucim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ requirements:
{% if cuda_major != "11" %}
- cuda-cudart
{% endif %}
- numpy >=1.23,<2.0a0
- numpy >=1.23,<3.0a0
- click
- cupy >=12.0.0
- lazy_loader >=0.1
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ dependencies:
packages:
- click
- lazy_loader>=0.1
- numpy>=1.23.4,<2.0a0
- numpy>=1.23.4,<3.0a0
- scikit-image>=0.19.0,<0.25.0a0
- scipy>=1.6.0
- output_types: conda
Expand Down
2 changes: 1 addition & 1 deletion python/cucim/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"click",
"cupy-cuda11x>=12.0.0",
"lazy_loader>=0.1",
"numpy>=1.23.4,<2.0a0",
"numpy>=1.23.4,<3.0a0",
"scikit-image>=0.19.0,<0.25.0a0",
"scipy>=1.6.0",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
Expand Down
5 changes: 4 additions & 1 deletion python/cucim/src/cucim/skimage/color/colorconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,10 +1121,13 @@ def gray2rgba(image, alpha=None, *, channel_axis=-1, check_alpha=True):
_, alpha = dtype_limits(image, clip_negative=False)

if np.isscalar(alpha):
# Convert to NumPy. As of NumPy 2.1 (and cupy 13.3) `cp.full`
# will raise for out-of-bound Python integers otherwise.
alpha = np.asarray(alpha)
if check_alpha:
# do not use np.can_cast here for NumPy 2.0 compatibility
with np.errstate(over="ignore", under="ignore"):
alpha_cast = np.asarray(alpha).astype(image.dtype)
alpha_cast = alpha.astype(image.dtype)
if alpha_cast != alpha:
warn(
'alpha cannot be safely cast to image dtype '
Expand Down