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 version upper bound restriction #324

Merged
merged 3 commits into from
Dec 14, 2023
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 environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies:
- numpy
- rasterio>=1.3.0
- shapely
- crick
- pip
- pip:
- crick
- -e .[recommended]
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@

numpy_version = ">=1.15,!=1.17.0"

# TODO: remove when crick is updated
numpy_version += ",<1.24"

setup(
# metadata
name="terracotta",
Expand Down
2 changes: 2 additions & 0 deletions terracotta/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ def to_uint8(data: Array, lower_bound: Number, upper_bound: Number) -> Array:
"""Re-scale an array to [1, 255] and cast to uint8 (0 is used for transparency)"""
rescaled = contrast_stretch(data, (lower_bound, upper_bound), (1, 255), clip=True)
rescaled = np.rint(rescaled)
# explicitly set NaNs to 0 to avoid warnings
rescaled[~np.isfinite(rescaled)] = 0
return rescaled.astype(np.uint8)


Expand Down
Loading