-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve get_area_slices behavior when area to cover has an invalid boundary #524
Conversation
Codecov Report
@@ Coverage Diff @@
## main #524 +/- ##
==========================================
+ Coverage 94.32% 94.34% +0.01%
==========================================
Files 79 79
Lines 12976 12987 +11
==========================================
+ Hits 12240 12252 +12
+ Misses 736 735 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Hey @djhoese This looks like a good temporary fix. I thought that in the medium-term I think would be nice to do some reorg within pyresample related to the extraction of boundary sides coordinates and boundary object creation. For the boundary sides coordinates, we currently use I guess that we could refactor somewhat the code in
As a result, we could just call And as a second step, we could standardize the creation of Boundary objects. Currently, we use :
If we would use the |
@ghiggi That makes a lot of sense. I like it. I'm not sure why we didn't move the geos-specific stuff into the |
I think a more specific error would be nice, so that Satpy can catch it. Eg BooleanComputationError, so that satpy can handle this specific case without risk for catching something unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Merging this. @djhoese do you want to add issue to act on the points mentioned above? |
I'll make an issue for the overall conversation @ghiggi is talking about. For the more specific error, I'm not sure Satpy should care in this case. We can't determine the slices so (satpy) stop worrying about it. Internally pyresample might care, but I think maybe this comes after some of the suggestions @ghiggi is talking about get implemented. |
As described by @lobsiger on the mailing list, Satpy now fails resampling (specifically reducing data before resampling) because of changes in #465. The main problem is that areas that used to "work" would result in a
NotImplementedError
insideAreaDefinition.get_area_slices
because no intersection could be determined with the source area and nothing "smarter" is currently implemented. This no intersection determination was actually because the target area ("area to cover") hadinf
in its boundary coordinates and the math just worked out that no intersection was possible. ThenotImplementedError
is a signal to Satpy to not attempt data reduction as no area subset slices could be generated...but that its OK that this happened.After #465, the infinity values in the coordinates is now raising a
ValueError
. This PR catches this and produces aNotImplementedError
to mimic the previous behavior.An alternative solution would be to update Satpy to catch not only the
NotImplementedError
, butValueError
and maybeRuntimeError
as possible reasons to ignore/not attempt data reduction.@mraspaud @pnuu @ghiggi thoughts?
git diff origin/main **/*py | flake8 --diff