Skip to content
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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

BENR0
Copy link
Collaborator

@BENR0 BENR0 commented Jun 14, 2024

Fixes the merge error Problem by allowing to pass the compat argument.

Copy link

codecov bot commented Jun 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.91%. Comparing base (3c7938c) to head (aff7b96).
Report is 25 commits behind head on main.

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     
Flag Coverage Δ
behaviourtests 4.04% <4.34%> (-0.01%) ⬇️
unittests 96.01% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@djhoese djhoese left a 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]):
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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.

@djhoese
Copy link
Member

djhoese commented Jul 21, 2024

The failing test output really doesn't help determine what is wrong/unequal for that test.

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.

MergeError in to_xarray_dataset for Scenes containing data from seviri_l1b_nc reader
2 participants