-
Notifications
You must be signed in to change notification settings - Fork 17
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
Unstructured scheme skeleton #31
Unstructured scheme skeleton #31
Conversation
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.
Starter comments :)
Summary of out "comment styling":
- Code that is future assumptions/ideas are commented out
- Copied code could have references to Iris code, to remind us where we were looking at
- Lines of code are the "simplest" functionality, that we are reviewing and concentrating on here
# Before regridding, data is transposed to a standard form. | ||
# This will be done either with something like the following code | ||
# or else done within the regridder by specifying args. | ||
new_axes = list(range(len(data.shape))) |
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 think these are an assumption that this will be needed and what it will be like. Maybe we can comment it out for now, and then we know it isn't part of the "definite" review here, but a reminder as to our thoughts
) | ||
|
||
# Store regrid info. | ||
self.grid_x, self.grid_y, self.regridder = partial_regrid_info |
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.
From our helpful discussion I think we will return more variables (to avoid loading the cube twice in the function interface. So this will end up something like,
_, _, self.grid_x, self.grid_y, self.regridder = regrid_info
Codecov Report
@@ Coverage Diff @@
## unstructured_scheme #31 +/- ##
=======================================================
- Coverage 96.06% 88.43% -7.63%
=======================================================
Files 9 10 +1
Lines 305 346 +41
=======================================================
+ Hits 293 306 +13
- Misses 12 40 +28
Continue to review full report at Codecov.
|
|
||
def _create_cube(data, src_cube, mesh_dim, mesh, grid_x, grid_y): | ||
# Here we expect the args to be as follows: | ||
# data: a masked array containing the redult of the regridding operation |
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.
redult should be result
# src_cube: the source cube which data is regrid from | ||
# mesh_dim: the dimension on src_cube which the mesh belongs to | ||
# mesh: the Mesh (or MeshCoord) object belonging to src_cube | ||
# grid_x: the coordinateon the target cube representing the x axis |
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.
coordinateon => coordinate on
also on line below
|
||
mesh, mesh_dim = _get_mesh_and_dim(src_mesh_cube) | ||
|
||
regrid_info = (mesh, mesh_dim, grid_x, grid_y, regridder) |
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.
For my own understanding, there is a possibility that the exact variables in this list are altered once we continue the implementation. However, they are good for now.
This looks good as a first "skeleton outline" for the scheme. |
* Unstructured scheme skeleton (#31) * create skeleton of unstructured regridding code This code is primarily based on Iris's current Area weighted regridding scheme, with the required adaptions for accepting unstructred UGRID data. * Unstructured Scheme - Basic GridInfo Handling (#32) Add basic `GridInfo` function and associated tests. It returns an ESMF regridding object for gridded data. * Unstructured scheme iris source (#33) * refresh cirrus-ci and nox * add iris artifact support * deal with special-case cirrus-ci quoting * review actions * Unstructured Scheme - Basic MeshInfo Handling (#36) * provide iris Mesh to MeshInfo conversion * test against iris feature branch * lint fixes and documentation * fix typo * address review comments. * change tests to better reflect UGRID orientation * address review comments. * address review comments * ASCII art fix * Unstructured Scheme - Cube Creation 2D (#39) * support creation of 2D cubes * lint fixes * rewrite test * remove mesh from _create_cube arguments * add TODO * add TODO * Unstructured Scheme - Mesh Fetching (#46) * support mesh fetching * fix docstring * lint fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add docstrings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add and restructure tests * fix test * fix test * address review comments * address review comments Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bill Little <bill.little@metoffice.gov.uk> Co-authored-by: Anna Booton <anna.booton@metoffice.gov.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Unstructured scheme skeleton (SciTools#31) * create skeleton of unstructured regridding code This code is primarily based on Iris's current Area weighted regridding scheme, with the required adaptions for accepting unstructred UGRID data. * Unstructured Scheme - Basic GridInfo Handling (SciTools#32) Add basic `GridInfo` function and associated tests. It returns an ESMF regridding object for gridded data. * Unstructured scheme iris source (SciTools#33) * refresh cirrus-ci and nox * add iris artifact support * deal with special-case cirrus-ci quoting * review actions * Unstructured Scheme - Basic MeshInfo Handling (SciTools#36) * provide iris Mesh to MeshInfo conversion * test against iris feature branch * lint fixes and documentation * fix typo * address review comments. * change tests to better reflect UGRID orientation * address review comments. * address review comments * ASCII art fix * Unstructured Scheme - Cube Creation 2D (SciTools#39) * support creation of 2D cubes * lint fixes * rewrite test * remove mesh from _create_cube arguments * add TODO * add TODO * Unstructured Scheme - Mesh Fetching (SciTools#46) * support mesh fetching * fix docstring * lint fix * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add docstrings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * add and restructure tests * fix test * fix test * address review comments * address review comments Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Bill Little <bill.little@metoffice.gov.uk> Co-authored-by: Anna Booton <anna.booton@metoffice.gov.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Introduces the structure of the unstructured regridding scheme with some minimal code. Further tasks are separable and are described by TODO comments.