-
Notifications
You must be signed in to change notification settings - Fork 285
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
Lazy rectilinear interpolator #6084
Open
fnattino
wants to merge
25
commits into
SciTools:main
Choose a base branch
from
fnattino:lazy-rectilinearinterpolator-2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b77af1d
lazy interpolation using map_complete_blocks
fnattino 0021cb0
pre-commit fixes
fnattino 18908ae
replace test on interpolation with lazy data
fnattino 47a8599
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino 555f3c7
Update lib/iris/analysis/_interpolation.py
fnattino 7a08108
Update lib/iris/analysis/_interpolation.py
fnattino c453e01
Merge branch 'lazy-rectilinearinterpolator-2' of github.com:fnattino/…
fnattino 3814383
resume local import
fnattino 0c5dc9a
add entry to latest.rst
fnattino 3481e46
add author name to list
fnattino 63714f0
drop duplicated method
fnattino 7aaefd8
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino 98143f2
new signature of map_complete_blocks
fnattino 948c75e
update docstrings on lazy data
fnattino 09974f3
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino 18c6e7a
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino d190a8b
update userguide with lazy interpolator
fnattino 3b210e4
Merge branch 'main' into lazy-rectilinearinterpolator-2
trexfeathers 47bce0e
the unstructured NN regridder does not support lazy data
fnattino 609c75a
remove caching an interpolator
fnattino dd14caa
update what's new entry
fnattino 48f47eb
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino 2fb8fc3
remove links to docs section about caching interpolators
fnattino a4774b8
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino fb8cffd
Merge branch 'main' into lazy-rectilinearinterpolator-2
fnattino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,9 @@ The following are the regridding schemes that are currently available in Iris: | |
* point in cell regridding (:class:`iris.analysis.PointInCell`) and | ||
* area-weighted regridding (:class:`iris.analysis.AreaWeighted`, first-order conservative). | ||
|
||
The linear, nearest-neighbor, and area-weighted regridding schemes support | ||
lazy regridding, i.e. if the source cube has lazy data, the resulting cube | ||
will also have lazy data. | ||
The linear and nearest-neighbour interpolation schemes, and the linear, nearest-neighbour, | ||
and area-weighted regridding schemes support lazy regridding, i.e. if the source cube has lazy data, | ||
the resulting cube will also have lazy data. | ||
See :doc:`real_and_lazy_data` for an introduction to lazy data. | ||
See :doc:`../further_topics/which_regridder_to_use` for a more in depth overview of the different regridders. | ||
|
||
|
@@ -417,22 +417,22 @@ In each case ``result`` will be the input cube regridded to the grid defined by | |
the target grid cube (in this case ``rotated_psl``) that we used to define the | ||
cached regridder. | ||
|
||
Regridding Lazy Data | ||
^^^^^^^^^^^^^^^^^^^^ | ||
Interpolating and Regridding Lazy Data | ||
-------------------------------------- | ||
|
||
If you are working with large cubes, especially when you are regridding to a | ||
high resolution target grid, you may run out of memory when trying to | ||
regrid a cube. When this happens, make sure the input cube has lazy data | ||
If you are working with large cubes, you may run out of memory when trying to | ||
interpolate or regrid a cube. For instance, this might happen when regridding to a | ||
high resolution target grid. When this happens, make sure the input cube has lazy data | ||
|
||
>>> air_temp = iris.load_cube(iris.sample_data_path('A1B_north_america.nc')) | ||
>>> air_temp | ||
<iris 'Cube' of air_temperature / (K) (time: 240; latitude: 37; longitude: 49)> | ||
>>> air_temp.has_lazy_data() | ||
True | ||
|
||
and the regridding scheme supports lazy data. All regridding schemes described | ||
here support lazy data. If you still run out of memory even while using lazy | ||
data, inspect the | ||
and the interpolation or regridding scheme supports lazy data. All interpolation and | ||
regridding schemes described here with exception of the the point-in-cell regridder | ||
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also the |
||
support lazy data. If you still run out of memory even while using lazy data, inspect the | ||
`chunks <https://docs.dask.org/en/latest/array-chunks.html>`__ | ||
: | ||
|
||
|
@@ -455,6 +455,6 @@ dimension, to regrid it in 8 chunks of 30 timesteps at a time: | |
Assuming that Dask is configured such that it processes only a few chunks of | ||
the data array at a time, this will further reduce memory use. | ||
|
||
Note that chunking in the horizontal dimensions is not supported by the | ||
regridding schemes. Chunks in these dimensions will automatically be combined | ||
Note that chunking in the horizontal dimensions is not supported by the interpolation | ||
and regridding schemes. Chunks in these dimensions will automatically be combined | ||
before regridding. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trexfeathers marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Re-using regridders
Please do NOT remove the section about re-using a regridder. This receives much more attention from the team and we know that it provides important performance benefits - the preparation step is more expensive for regridding.
Re-using interpolators
Thanks for the heads-up: I was not aware that interpolator re-use was an advertised feature (we talk a lot more about regridder re-use).
Since it's an advertised feature, I raised this with @SciTools/peloton to make sure we are happy with losing this functionality:
So we're still 👍 on removing the re-use functionality. Outstanding work for you:
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.
Thanks a lot for checking the documentation updates and for sharing about the future plans for interpolation and regridding! I have added the two fixes, please let me know if there is anything left to do on this!