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

Add nearest neighbour regridding #266

Merged
merged 20 commits into from
May 16, 2023
Merged

Conversation

stephenworsley
Copy link
Contributor

@stephenworsley stephenworsley commented May 12, 2023

Creates the minimal version of nearest neighbour regridding described in #213.

This also incidentally fixes a slight error in the refactoring where ESMFBilinear didn't have a use_src_mask and use_tgt_mask keyword.

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

Merging #266 (5abe277) into main (1690171) will increase coverage by 0.05%.
The diff coverage is 99.76%.

@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
+ Coverage   98.73%   98.79%   +0.05%     
==========================================
  Files          30       33       +3     
  Lines        3323     3563     +240     
==========================================
+ Hits         3281     3520     +239     
- Misses         42       43       +1     
Impacted Files Coverage Δ
esmf_regrid/experimental/unstructured_scheme.py 93.93% <ø> (ø)
...sts/unit/schemes/test_ESMFAreaWeightedRegridder.py 100.00% <ø> (ø)
...d/tests/unit/schemes/test_ESMFBilinearRegridder.py 100.00% <ø> (ø)
...f_regrid/tests/unit/schemes/test__ESMFRegridder.py 100.00% <ø> (ø)
esmf_regrid/schemes.py 96.04% <96.42%> (-0.05%) ⬇️
esmf_regrid/esmf_regridder.py 95.58% <100.00%> (+0.13%) ⬆️
.../tests/unit/experimental/io/test_round_tripping.py 100.00% <100.00%> (ø)
...nstructured_scheme/test_GridToMeshESMFRegridder.py 100.00% <100.00%> (ø)
...nstructured_scheme/test_MeshToGridESMFRegridder.py 97.11% <100.00%> (+0.05%) ⬆️
..._scheme/test_regrid_rectilinear_to_unstructured.py 100.00% <100.00%> (ø)
... and 6 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

Nice work @stephenworsley. My comments are below 🙂

Is nearest neighbour deliberately not an option in unstructured_scheme? E.g.:

https://github.com/SciTools-incubator/iris-esmf-regrid/blob/71c14e0e0bbbdfb54a828d7b37f9f423fae28ecc/esmf_regrid/experimental/unstructured_scheme.py#L58-L61

CHANGELOG.md Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Outdated Show resolved Hide resolved
esmf_regrid/tests/unit/schemes/test_ESMFBilinear.py Outdated Show resolved Hide resolved
esmf_regrid/tests/unit/schemes/test_ESMFNearest.py Outdated Show resolved Hide resolved
esmf_regrid/schemes.py Outdated Show resolved Hide resolved
Copy link
Contributor

@trexfeathers trexfeathers left a comment

Choose a reason for hiding this comment

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

@trexfeathers trexfeathers merged commit bad51a3 into SciTools:main May 16, 2023
HGWright pushed a commit to HGWright/iris-esmf-regrid that referenced this pull request May 19, 2023
* add nearest neighbour regridding

* fix tests

* further improvements, reintroduce mask keywords

* fix tests

* change test name

* add tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake fix

* update changelog

* address review comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake fix

* address review comments

* parameterise test

* add Raises section to docstrings

* fix docstrings

* fill out __all__

* address review comments

* further test parameterisation.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
trexfeathers added a commit that referenced this pull request May 23, 2023
* adding gha for tests and wheels

* get wheels to run

* 1st wheels fix

* 2nd fix

* 3rd fix

* 4th fix

* 5th fix

* 6th fix

* 7th fix

* 8th fix

* 9th fix

* 10th fix

* 11th fix

* 12th fix

* 13th fix

* 14th fix

* 15th fix

* 15th fix

* 16th fix

* 18th fix

* 19th fix

* 20th fix

* 21st fix

* 22nd fix

* 23rd fix

* 24th fix

* 25th fix

* 26th fix

* 27th fix

* 28th fix

* 29th fix

* 29th fix

* 30th fix

* 31st fix

* 32nd fix

* 33rd fix

* 34th fix

* 35th fix

* 36th fix

* 37th fix

* 38th fix

* 39th fix

* 40th fix

* 41ST fix

* 42nd fix

* 43rd fix

* 44th fix

* 45th fix

* 45th fix

* 46th fix

* 47th fix

* 48th fix

* 49th fix

* 50th fix

* 51st fix

* 52nd fix

* 53rd fix

* 54th fix

* 55th fix

* 56th fix

* 57th fix

* 58th fix

* 59th fix

* Adding GHA to replace cirrus.yml

* Adding comments for IRIS_SOURCE

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixing the name of the benchmark check

* Fixing the name of the benchmark check again

* Add nearest neighbour regridding (#266)

* add nearest neighbour regridding

* fix tests

* further improvements, reintroduce mask keywords

* fix tests

* change test name

* add tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake fix

* update changelog

* address review comments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* flake fix

* address review comments

* parameterise test

* add Raises section to docstrings

* fix docstrings

* fill out __all__

* address review comments

* further test parameterisation.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Fixing the name of the benchmark check

* Making requested changes

* Update .github/workflows/benchmark.yml

Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>

* add comment to benchmark.yml

* Update .github/workflows/benchmark.yml

Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: stephenworsley <49274989+stephenworsley@users.noreply.github.com>
Co-authored-by: Martin Yeo <40734014+trexfeathers@users.noreply.github.com>
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.

3 participants