You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would probably be good practice to this consistently for other data as well (CRS, transform):
Either have it in the .setter() and not every function that relies on the attribute as input,
Or have a consistent input check function written outside of the Raster class that is called at every occurence.
The text was updated successfully, but these errors were encountered:
rhugonnet
changed the title
User-input checks of nodata bypassed in from_array() and other dependent functions
User-input type checks of nodata bypassed in from_array() and other dependent functions
Mar 14, 2024
The
from_array()
function expects thenodata
to be checked when calling the class with the dictionary of input values: https://github.com/GlacioHack/geoutils/blob/main/geoutils/raster/raster.py#L788And rightfully so, as we have a
nodata.setter()
with a good list of checks: https://github.com/GlacioHack/geoutils/blob/main/geoutils/raster/raster.py#L1463However the attribute is set during class instantiation by-passing the setter: https://github.com/GlacioHack/geoutils/blob/main/geoutils/raster/raster.py#L464
We need to use
set_nodata(nodata, update_array=False, update_mask=False)
during instantiation, or we could have any nodata from user input!It would probably be good practice to this consistently for other data as well (CRS, transform):
.setter()
and not every function that relies on the attribute as input,Raster
class that is called at every occurence.The text was updated successfully, but these errors were encountered: