SciTools / iris-esmf-regrid

A collection of structured and unstructured ESMF regridding schemes for Iris.
https://iris-esmf-regrid.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
19 stars 17 forks source link

Check mesh equality on MeshToGridESMFRegridder call #138

Closed stephenworsley closed 2 years ago

stephenworsley commented 2 years ago

Now that iris provides proper mesh equality comparison, this can be done during the MeshToGridESMFRegridder call.

stephenworsley commented 2 years ago

Current errors are due to saved and reloaded regridders having a mesh which does not equate to the original mesh which initialised the regridder. I have tried to fix this by equalising the var_names attached to the mesh, but there still appears to be an error due to masked arrays in connectivities being filled inconsistently on equality checks. When this line: https://github.com/SciTools/iris/blob/68b5e65e4cca34505f4731d2e9f3794cbd1d4f16/lib/iris/util.py#L366 is changed to array = ma.asarray(array) thsi appears to fix the problem.

codecov[bot] commented 2 years ago

Codecov Report

Merging #138 (20283e7) into unstructured_scheme (4222dca) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@                 Coverage Diff                  @@
##           unstructured_scheme     #138   +/-   ##
====================================================
  Coverage                99.54%   99.54%           
====================================================
  Files                       27       27           
  Lines                     1741     1767   +26     
====================================================
+ Hits                      1733     1759   +26     
  Misses                       8        8           
Impacted Files Coverage Δ
esmf_regrid/experimental/unstructured_scheme.py 100.00% <100.00%> (ø)
.../tests/unit/experimental/io/test_round_tripping.py 100.00% <100.00%> (ø)
...nstructured_scheme/test_MeshToGridESMFRegridder.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4222dca...20283e7. Read the comment docs.