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

Update create_grid args to improve usability #507

Merged
merged 15 commits into from
Jul 7, 2023

Conversation

jasonb5
Copy link
Collaborator

@jasonb5 jasonb5 commented Jun 19, 2023

Description

This PR updates the create_grid API to make it easier to use. A create_axis utility function streamlines the creation of axes by generating a tuple of coordinates and coordinate bounds as xr.DataArray, This axis tuple can be passed into create_grid.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

If applicable:

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass with my changes (locally and CI/CD build)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have noted that this is a breaking change for a major release (fix or feature that would cause existing functionality to not work as expected)

@jasonb5 jasonb5 changed the title Update create_grid Updates grid generation feature Jun 19, 2023
@codecov-commenter
Copy link

codecov-commenter commented Jun 19, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (b46c331) 100.00% compared to head (3f6b646) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #507   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines         1517      1562   +45     
=========================================
+ Hits          1517      1562   +45     
Impacted Files Coverage Δ
xcdat/__init__.py 100.00% <ø> (ø)
xcdat/bounds.py 100.00% <100.00%> (ø)
xcdat/regridder/grid.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@tomvothecoder tomvothecoder self-requested a review June 20, 2023 17:42
@tomvothecoder tomvothecoder added the type: enhancement New enhancement request label Jun 20, 2023
@tomvothecoder tomvothecoder changed the title Updates grid generation feature Update create_grid and add create_axis utility Jun 21, 2023
@tomvothecoder tomvothecoder changed the title Update create_grid and add create_axis utility Update create_grid args to improve usability Jun 21, 2023
Copy link
Collaborator

@tomvothecoder tomvothecoder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jasonb5, here's my code review. Most of my suggestions are related to formatting, docstrings, and comments.

Once addressed, LGTM. Thanks!

xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
tests/test_regrid.py Outdated Show resolved Hide resolved
xcdat/regridder/grid.py Outdated Show resolved Hide resolved
This was referenced Jun 22, 2023
@jasonb5 jasonb5 merged commit c2fd8fd into xCDAT:main Jul 7, 2023
@jasonb5 jasonb5 deleted the update_create_grid branch July 7, 2023 00:03
@tomvothecoder
Copy link
Collaborator

Thanks for merging Jason. Others can test the updates from this PR in v0.6.0rc1. I'll release that today!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Improve create_grid function
3 participants