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

Update sview.py np.can_cast TypeError text #257

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion pysheds/sview.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ def __new__(cls, input_array, viewfinder=None, metadata={}):
try:
assert np.can_cast(viewfinder.nodata, obj.dtype, casting='safe')
except:
raise TypeError('`nodata` value not representable in dtype of array.')
raise TypeError(f"Cannot cast nodata value {viewfinder.nodata} (type: {type(viewfinder.nodata)}) to array dtype {obj.dtype}.")

# Don't allow original viewfinder and metadata to be modified
viewfinder = viewfinder.copy()
metadata = metadata.copy()
Expand Down