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

Add oblique mercator to create_bounds and other improvements to the regridding function #467

Merged
merged 30 commits into from
Sep 30, 2024

Conversation

RondeauG
Copy link
Collaborator

@RondeauG RondeauG commented Sep 24, 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.
  • CHANGELOG.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?

  • Renames create_bounds_rotated_pole to create_bounds_gridmapping and adds support for oblique_mercator.
  • Changes to regrid_dataset:
    • weights_location is now optional.
    • Reinforced the automatic naming of the weights file. When attributes are unknown, a random string is now generated instead of a static one. Moreover, it now relies on a cat:id and cat:domain for both the incoming dataset and the grid.
    • Now correctly skips the lon_bounds and lat_bounds variables if the grid was generated using xesmf.util.cf_grid_2d
  • create_mask has been completely refactored to use real arguments instead of a dictionary.

Does this PR introduce a breaking change?

  • The old function name is deprecated and will be dropped in a later version.
  • weights_location in regrid_dataset is now optional, and thus had to be moved to explicit arguments rather than positional.

Other information:

@RondeauG RondeauG requested a review from aulemahal September 24, 2024 18:59
@RondeauG RondeauG changed the title Add oblique mercator to create_bounds Add oblique mercator to create_bounds and other improvements to the regridding function Sep 26, 2024
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

environment-dev.yml Outdated Show resolved Hide resolved
environment.yml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@aulemahal aulemahal 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!

src/xscen/regrid.py Outdated Show resolved Hide resolved
src/xscen/regrid.py Show resolved Hide resolved
src/xscen/regrid.py Show resolved Hide resolved
src/xscen/regrid.py Outdated Show resolved Hide resolved
@RondeauG RondeauG merged commit 58f0b93 into main Sep 30, 2024
16 of 17 checks passed
@RondeauG RondeauG deleted the oblique_mercator_bounds branch September 30, 2024 15:52
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.

4 participants