-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Looks like an awesome package that is going to be super helpful! I'm just getting started here. Thanks for building this!
Behavior
When I accidentally passed a <class 'numpy.ndarray'> instead of a <class 'rasterio.io.DatasetReader'> as the dataset argument to stmetrics.spatial.snitc() I get the following error:
Traceback (most recent call last):
File "/Users/lucasj/Code/lib/stseg/test.py", line 14, in <module>
segments = stmetrics.spatial.snitc(
File "/Users/lucasj/Code/lib/stseg/venv/lib/python3.9/site-packages/stmetrics/spatial.py", line 100, in snitc
for band in range(img.shape[0]):
UnboundLocalError: local variable 'img' referenced before assignment
Expected behavior
The program should break on this TypeError:
stmetrics/stmetrics/spatial.py
Line 96 in dd988d4
| TypeError("Sorry we can't read this type of file. \ |
Suggestion
Consider using Raise to stop the execution like:
else:
raise TypeError("Sorry we can't read this type of file. \
Please use Rasterio or xarray")
Metadata
Metadata
Assignees
Labels
No labels