Closed RSchueder closed 10 months ago
@gjoseph92 I would like to assign you as a reviewer. I am hoping this mention enables this as per the solution here (I am more of a GitLab person myself).
@gjoseph92 I am not sure we can ever have a (scale, offset)
of dtype other than float because of:
If this is true, isn't actually checking the value a bit redundant since we know it will be a float?
Okay, so even if the (scale, offset)
is always technically (float, float)
, we only apply the value if it != (1,0)
. Therefore, I now only do the check on scale != 1
and offset != 0
. Hopefully this makes sense.
Sorry for the delay @RSchueder. I'd still like to move the check around here https://github.com/gjoseph92/stackstac/blob/7836a363b2609216890b0e20e289f8ff71cf320d/stackstac/prepare.py#L158
That way, you get the error immediately, instead of having to wait until compute
.
Now worries @gjoseph92!
Gotcha, I didn't want to modify the signature of prepare_items
but I have now implemented the change in prepare_items
.
This MR adds validation of the inputs to
stackstac.stack
to ensure that the outputdtype
is compatible whenrescale=True
. Rescaling requires that the output dtype is floating-point.