While writing some docs for set_na_from_meta, a function which searches for keys like valid_range, invalid_range and missing_value in an ElmStore's attrs to set NaNs accordingly, I found it was failing when the values attaches to these keys needed to be converted to float from string. I also found that valid_range, when in the attrs at the ElmStore level, rather than band level (DataArray attrs), was incorrect.
This PR fixes the data type issues in searching the metadata and also changes the set_na_from_meta function to just look at band metadata (the DataArrays) rather than the attrrs at the ElmStore level. The PR also improves test coverage on set_na_from_meta.
While writing some docs for
set_na_from_meta
, a function which searches for keys likevalid_range
,invalid_range
andmissing_value
in anElmStore
'sattrs
to set NaNs accordingly, I found it was failing when the values attaches to these keys needed to be converted to float from string. I also found thatvalid_range
, when in the attrs at theElmStore
level, rather than band level (DataArray
attrs), was incorrect.This PR fixes the data type issues in searching the metadata and also changes the
set_na_from_meta
function to just look at band metadata (theDataArray
s) rather than the attrrs at theElmStore
level. The PR also improves test coverage onset_na_from_meta
.