Skip to content

Conversation

@rafaqz
Copy link
Owner

@rafaqz rafaqz commented Oct 5, 2025

This PR adds an emptyval keyword which specifies what to return if the reduced area is empty.

@kadyb this should mostly solve your problem, although not sure this is the best way to do it.

TODO: allow a NamedTuple of emptyval for RasterStack

Copy link
Collaborator

@asinghvi17 asinghvi17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming isempty is fast on a SkipMissingVal

@tiemvanderdeure
Copy link
Collaborator

Why can't we do this by passing init to the reducer?

@rafaqz
Copy link
Owner Author

rafaqz commented Oct 6, 2025

No, missing or NaN init will always return missing or NaN.

@asinghvi17 isempty isn't fast if the area is mostly empty. Otherwise we could check and throw a nicer error where no emptyval is given. Maybe it's inconsequential enough to do that anyway, I haven't checked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants