-
Notifications
You must be signed in to change notification settings - Fork 19
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
Restrict size 1 limitation to source field in regridding #249
Restrict size 1 limitation to source field in regridding #249
Conversation
Hi Thibault, Would you mind copying the above into an issue and referencing that issue from this PR? (https://ncas-cms.github.io/cf-python/contributing.html#preparing-pull-requests) - I'll reply over there ... Thanks, David |
…cf-python into support-one-element-grid
Hi David, As discussed in #250, it seems that the source grid can be with size 1 dimensions for some of the methods. My latest commit reflects that and also un-indent the check in The testing script below should work now (same fields as above): for m in ['conservative_1st', 'conservative_2nd', 'nearest_stod', 'nearest_dtos']:
fld3 = fld2.regrids(fld1, method=m)
print(fld3.array) |
…cf-python into support-one-element-grid
Hi @ThibHlln, I wasn't sure that anything would happen here, but I've managed to push to this PR of yours. This commit (7dfb455) tidies up the removal of the "squeeze", which needs to go back in sometimes to get rid of size 1 dimensions that are not being regridded. Hope that's OK! (this commit can always be nuked, of course). |
Hi @ThibHlln - I think we can merge this, now. I'll await your OK, though ... |
Hi @davidhassell, I was not sure what the squeezing was for, but I was guessing it would require more than just removing it. Yes, I think it can be merged now, I ran the tests above successfully after your commits. |
Hi @ThibHlln - I think the squeezing is all about making sure we pass the correctly shaped numpy array down to the ESMF layer. Thanks for your help with this. We expect a release of 3.11.0 in a couple of weeks (ish). Merging now ... |
This version includes: - fix for memory leak due to ESMF objects NCAS-CMS/cf-python#225 - lift for size 1 restriction on grid NCAS-CMS/cf-python#249 - fix bug preventing cyclic domain (e.g. global runs) NCAS-CMS/cf-python#237
resolves #250
Hi David, Hi Sadie,
With the simple change contained in this PR, the code below would work, which is not currently the case (i.e. a regridding towards a single grid cell domain).