Skip to content
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

Cache remapping weights #44

Merged
merged 5 commits into from
Jun 10, 2021
Merged

Conversation

ThibHlln
Copy link
Member

@ThibHlln ThibHlln commented Jun 9, 2021

resolve #43

Following a PR in cf-python NCAS-CMS/cf-python#223, the regrids/regridc methods of a cf.Field can now return a RegridOperator so that the remapping weights are calculated then, and stored in the RegridOperator which can be re-used on demand later on.

This PR makes use of this new feature is the set_up of the Exchanger, where the RegridOperator is computed once if remapping is required, and then used in get_transfer.

This PR requires cf-python>=3.10.0 to work, so I expect our tests to fail because this version has not been released on PyPI yet. While their PR is merged in their master branch already, I would rather not modify our GitHub Actions workflow to install from their repo rather than from PyPI.

Thibault Hallouin added 3 commits June 4, 2021 10:17
This way, the expensive computation of the weights is done once in set up, and then the weights are hold on to through the `RegridOperator` to be used when transfers are retrieved and remapping is required.
Following the evolving API of `cf-python` on this newly created functionality, we agreed that the method was unnecessary where using a `RegridOperator`.
@ThibHlln ThibHlln self-assigned this Jun 9, 2021
@ThibHlln ThibHlln linked an issue Jun 9, 2021 that may be closed by this pull request
@ThibHlln ThibHlln requested a review from rich-HJ June 10, 2021 09:57
@ThibHlln ThibHlln marked this pull request as ready for review June 10, 2021 09:57
Copy link
Collaborator

@rich-HJ rich-HJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the tests will pass once cf-python is updated on pypi?

@ThibHlln
Copy link
Member Author

ThibHlln commented Jun 10, 2021

So the tests will pass once cf-python is updated on pypi?

That's the hope. 😁 They pass locally. I don't see a reason why they would fail, but we shall see that when v3.10.0 is released.

Thank for the review Rich.

@rich-HJ rich-HJ merged commit 5e25cd6 into unifhy-org:dev Jun 10, 2021
@ThibHlln ThibHlln deleted the cache-remap-weights branch June 21, 2021 12:27
@ThibHlln ThibHlln mentioned this pull request Dec 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review remapping approach
2 participants