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

reimplementation of pole_kind option #415

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

raphaeldussin
Copy link
Contributor

this PR replaces #236 and #223

testing uses sample data from figshare.

This was referenced Feb 9, 2025
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.

A few suggestions.

An example in one of the notebooks could be interesting ?

file_to_rem.unlink()
file_to_rem = pathlib.Path('xesmf_testing_OM4.tar.gz')
file_to_rem.unlink()
return None
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return None

@@ -1007,3 +1007,66 @@ def test_densify_polys():
poly = Polygon([(-80, -40), (80, -40), (80, 40), (-80, 40)]) # Large poly
with pytest.warns(UserWarning):
xe.SpatialAverager(ds_in, [poly])


def test_regrid_polekind():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def test_regrid_polekind():
def test_regrid_polekind(tmp_path):

I suggest writing the test files in a temporary path (see https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html).

As a bonus, you don't even need to clean them up at the end.

Comment on lines +160 to +161
if 'pole_kind' in ds:
pole_kind = np.asarray(ds['pole_kind'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

The possibility of passing pole_kind in the dataset should maybe be added somewhere in the documentation ? The docstring of Regridder maybe ?

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.

3 participants