-
Notifications
You must be signed in to change notification settings - Fork 35
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
"input_dims" #362
Comments
Hi @agmeyer4, If I recall correctly, I wrote this but didn't expect users to pass Your solution is good, and should be done for |
@aulemahal regridder = xe.Regridder(grid_in,grid_out,method='conservative')
regridded_ds = regridder(ds,input_dims=('south_north','west_east')) When I run the code above, I receive another error: TypeError: BaseRegridder.__call__() got an unexpected keyword argument 'input_dims' The docs for the regridder() call inputs say
This leads me to believe I should include input_dims in my xe.Regridder() instantiation, hence the need for my bug fix. Am I missing something here? |
Sorry, that was unclear. By "unexpected", I was talking about having a grid definition that doesn't match the regridding dataset. An "expected" use case would have But that is when we assume the spatial coordinates will have the common The doc for |
Got it, that does make sense. The patch I've used seems to work in my case. I'm new to pull requests, so guidance on how to do that or your inclusion of the fix in your next version would be great. |
When attempting to run
Where grid_in and grid_out are dictionaries with keys = ['lat','lon','lat_b','lon_b'], I get an error:
Without declaring the input_dims, I always get the warning about xesmf automatically choosing the dimensions to use.
It seems that in frontend.py at line 928, the BaseRegridder is instantiated with both input_dims=input_dims as well as **kwargs, of which input_dims is a key. If I add the following above the super().init() call in Regridder.init(), it works as expected:
However, I do not know how this would affect the parameters set in lines 916-920. Is there an easier/safer/better fix?
The text was updated successfully, but these errors were encountered: