-
Notifications
You must be signed in to change notification settings - Fork 6
Add regridding functionality #10
Add regridding functionality #10
Conversation
I couldn't find a |
I guess this wants at least some testing before we merge. |
I couldn't find a |
1 similar comment
I couldn't find a |
@stephenworsley are you able to add |
43447a6
to
63527fe
Compare
@stephenworsley if you were to sort out black in this PR (similar to SciTools/iris#3518) then that should sort out those Stickler complaints |
@trexfeathers Is it appropriate to handle black in this pull request or should that be handled in a seperate PR? |
Agreed. See #14 |
3173d6b
to
bbf2f46
Compare
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.
Mostly comments about docstrings clarity (at least so far), and some rather finicky points so you should interpret quite broadly !
Basically, though, this is all much, much clearer now 🥇 💐 !
I guess the "regrid demo users" will be exposed to this, so it is worth trying to get the explanations fairly complete + clear.
But, don't let any of this delay us too much : good enough is good enough, and we can make further improvements later if needed.
Just as a final note on that : the docstring style you're using reads just fine, but it is not numpy conventions
( see : https://numpydoc.readthedocs.io/en/latest/format.html
as mentioned here in cube-arithmetic PR
I think we're planning to adopt numpy conventions throughout scitools in the future, even though Iris doesn't conform at the present )
I frankly wouldn't worry about that for now, it can absolutely be fixed later.
I think the structure of the tests is a bit haphazard. But I don't know quite how to represent the The only thing I think is practically missing is more specific + explicit testing of the GridInfo MeshInfo constructors. I would be generally interested to see how we could have a more obvious + regular arrangement using pytest tests, but I guess we don't have to do that now. @trexfeathers any ideas ?? |
Otherwise, I can find nothing wrong with the actual code, so I guess this is pretty near done 👍 |
@pp-mo for me this is a perfect example of something that would be better to evolve organically as we get more tests that need organising/structuring - it would probably take extra effort to plan out before we have the anticipated spread of tests. |
Provides an API to ESMF regridding which is closer aligned to UGRID format, with a view to simplifying the process of regridding. Support is given to both lat-lon grids and UGRID style meshes, each of which can be used interchangably with respect to the regridder class.
Also, the regridder extracts weights from ESMF and implements its own regridding calculations. This is done so that ESMF objects are only needed while setting up the regridder and regridding can be done with scipy.sparse matrices, similar to current Iris regridding. This should make ESMF based regridding easier to align with other iris regridding schemes (this could, for example, allow easier weight caching, so that regridding can be done with precomputed weights without having to install ESMF).