-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fixes xesmf flag #374
Fixes xesmf flag #374
Conversation
This should resolve issues with curvilinear grids not working (#339). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pytest.mark.parametrize( | ||
"name,value,attr_name", | ||
[ | ||
("periodic", True, "_periodic"), | ||
("extrap_method", "inverse_dist", "_extrap_method"), | ||
("extrap_method", "nearest_s2d", "_extrap_method"), | ||
("extrap_dist_exponent", 0.1, "_extrap_dist_exponent"), | ||
("extrap_num_src_pnts", 10, "_extrap_num_src_pnts"), | ||
("ignore_degenerate", False, "_ignore_degenerate"), | ||
], | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know this pytest decorator exists. This is neat for easily testing different function/method parameters!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This resolves most of the curvilinear gridding issues. I do not have an exact match with CDAT, but when I spot-checked the grid cell differences were order 10$^{-5}$. In looking at 58 models, 9 had issues, but they appeared to be known issues (I think compared to more than 30 exceptions before?):
Error | Instances |
---|---|
TypeError: buffer is too small for requested array |
1 |
KeyError: "Receive multiple variables for key 'longitude': {'lon', 'longitude'}. Expected only one. Please pass a list ['longitude'] instead to get all variables matching 'longitude'." |
2 |
KeyError: 'lon_b' |
3 |
ValueError: Bounds format not understood. Got ('nj', 'ni', 'vertices') with shape (384, 320, 2). |
1 |
KeyError: "No results found for 'longitude'." |
1 |
xarray.core.merge.MergeError: conflicting values for variable 'vertices_latitude' on objects to be combined. You can skip this check by specifying compat='override'. |
1 |
I think this PR is good to go. Thanks for sorting this out @jasonb5!
Description
Fixes
ignore_degenerate
not being passed through to xESMF regridder object.Checklist
If applicable: