Skip to content

Conversation

@dopplershift
Copy link
Member

@dopplershift dopplershift commented Oct 25, 2024

Description Of Changes

This support was added in pydata/xarray#2844 and handles converting the grid_mapping variable to a coordinate in xarray itself, which was incompatible with some assumptions in parse_cf(). Add some handling for the case where the grid_mapping. Also add decode_coords='all' to our full test suite (parametrized) and adjust a few tests as necessary; this includes removing a test for not removing grid_mapping attribute since that's not a universal truth any more (beyond our control).

This is motivated by being compatible with rioxarray, which relies on decode_coords='all' for its own projection handling, and can be used to load GOES data and do direct image remapping.

Checklist

  • Tests added

@dopplershift dopplershift added Type: Bug Something is not working like it should Area: Xarray Pertains to xarray integration labels Oct 25, 2024
@dopplershift dopplershift added this to the 1.7.0 milestone Oct 25, 2024
@dopplershift dopplershift requested review from a team and jthielen as code owners October 25, 2024 21:58
@dopplershift dopplershift requested review from dcamron and removed request for a team October 25, 2024 21:58
def test_ds(request):
"""Provide an xarray dataset for testing."""
return xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False))
return xr.open_dataset(get_test_data('narr_example.nc', as_file_obj=False),

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
This support was added in pydata/xarray#2844 and handles converting the
grid_mapping variable to a coordinate in xarray itself, which was
incompatible with some assumptions in parse_cf(). Add some handling for
the case where the grid_mapping. Also add decode_coords='all' to our
full test suite and adjust a few tests as necessary.
@dcamron dcamron merged commit 2bb4d56 into Unidata:main Oct 28, 2024
@dopplershift dopplershift deleted the xarray-decode branch October 28, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Xarray Pertains to xarray integration Type: Bug Something is not working like it should

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants