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

Guess cf coords before subsetting #384

Merged
merged 3 commits into from
Apr 16, 2024
Merged

Guess cf coords before subsetting #384

merged 3 commits into from
Apr 16, 2024

Conversation

aulemahal
Copy link
Collaborator

@aulemahal aulemahal commented Apr 15, 2024

Pull Request Checklist:

  • This PR addresses an already opened issue (for bug fixes / features)
    • This PR fixes #xyz
  • (If applicable) Documentation has been added / updated (for bug fixes / features).
  • (If applicable) Tests have been added.
  • This PR does not seem to break the templates.
  • CHANGES.rst has been updated (with summary of main changes).
    • Link to issue (:issue:number) and pull request (:pull:number) has been added.

What kind of change does this PR introduce?

  • If one of "longitude" or "latitude" can't be found in the CF-compliant coordinates of the input dataset, spatial.subset will try to guess them ( cf-xarray does it really).

Does this PR introduce a breaking change?

No. Nothing is touched if coordinates are present. If they can't be found, it will fail silently and we can expect the subset to fail further down the line with some (hopefully) explicit message.

Other information

This allows the seamless usage of extract_dataset with datasets which lack proper attributes on their coordinates (our copy of ERA5, for example).

@aulemahal aulemahal requested a review from RondeauG April 15, 2024 21:28
@aulemahal aulemahal merged commit 520fb45 into main Apr 16, 2024
23 checks passed
@aulemahal aulemahal deleted the guess-cf-coords branch April 16, 2024 15:01
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.

2 participants