-
Notifications
You must be signed in to change notification settings - Fork 295
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
Fix to xr dataset merge error with conflicting values in coordinate #2827
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2827 +/- ##
==========================================
- Coverage 95.94% 95.91% -0.03%
==========================================
Files 366 366
Lines 53504 53519 +15
==========================================
+ Hits 51332 51335 +3
- Misses 2172 2184 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
This looks good to me except the type annotation on compat
which I've commented on inline. If that is resolved then this is good to merge.
satpy/scene.py
Outdated
"""Merge all xr.DataArrays of a scene to a xr.DataSet. | ||
|
||
Parameters: | ||
datasets (list): | ||
List of products to include in the :class:`xarray.Dataset` | ||
compat (Optional[str]): |
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.
The Optional
type suggests this can be None
, but that's not true is it?
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.
Hah I think you are right I always thought optional
does not mean it can be None
rather if you do not provide it the default arg is used. Then I need to change it. I guess if one uses optional
you have to check for none inside the function and then set the default. I think that's a little overhead and not very nice but is in accordance with the documentation of Optional
.
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.
Just make it "str" only and have the default be a string. No need for Optional or None checking.
The failing test output really doesn't help determine what is wrong/unequal for that test. |
Fixes the merge error Problem by allowing to pass the
compat
argument.to_xarray_dataset
for Scenes containing data from seviri_l1b_nc reader #2179