Skip to content

Update ConservativeRegridding compat to v0.2#166

Open
ctessum-claude wants to merge 2 commits intoEarthSciML:mainfrom
ctessum-claude:fix-conservative-regridding-v0.2
Open

Update ConservativeRegridding compat to v0.2#166
ctessum-claude wants to merge 2 commits intoEarthSciML:mainfrom
ctessum-claude:fix-conservative-regridding-v0.2

Conversation

@ctessum-claude
Copy link
Copy Markdown
Contributor

@ctessum-claude ctessum-claude commented Mar 1, 2026

Summary

  • Updates ConservativeRegridding compat from 0.1 to 0.2 (supersedes PR CompatHelper: bump compat for ConservativeRegridding to 0.2, (keep existing compat) #161)
  • Works around three bugs in ConservativeRegridding v0.2.0 for Planar grids:
    1. cell_range_extent has swapped mapreduce arguments for ExplicitPolygonGrid{Planar} — fixed via runtime method override in __init__
    2. _area_criterion not implemented for 2D planar extents — bypassed via threaded=false
    3. regrid! only accepts vectors, not reshaped matrices — fixed by handling 2D/3D cases separately
  • Adds GeoInterface and GeometryOpsCore as dependencies
  • Converts polygon vertex vectors to GI.Polygon objects and reshapes to matrices for CR v0.2's treeify/ExplicitPolygonGrid

Context

PR #161 (from CompatHelper) bumped ConservativeRegridding compat to include v0.2, but tests failed because v0.2 changed the Regridder constructor API and introduced several bugs for Planar grids.

Test plan

  • Conservative regridding tests pass (5/5)
  • Full test suite passes (194/194)

🤖 Generated with Claude Code

ctessum-claude and others added 2 commits March 1, 2026 02:13
ConservativeRegridding v0.2 changed the Regridder constructor to require
GeoInterface-compatible polygon objects and an explicit manifold argument,
instead of accepting raw tuple-based polygon vectors directly.

- Add GeoInterface and GeometryOpsCore as dependencies
- Convert polygon vertex vectors to GI.Polygon objects before passing
  to ConservativeRegridding.Regridder
- Pass GeometryOpsCore.Planar() manifold explicitly to Regridder
- Update ConservativeRegridding compat from 0.1 to 0.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Work around three bugs in ConservativeRegridding v0.2.0 for Planar grids:

1. cell_range_extent has swapped mapreduce arguments for ExplicitPolygonGrid{Planar}
   (fixed via runtime method override in __init__)
2. _area_criterion not implemented for 2D planar extents
   (bypassed via threaded=false)
3. regrid! only accepts vectors, not reshaped matrices
   (fixed by handling 2D and 3D cases separately in regrid_horizontal!)

Also converts polygon vertex vectors to GeoInterface.Polygon objects and
reshapes them into matrices as required by CR v0.2's treeify/ExplicitPolygonGrid.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 1, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.55%. Comparing base (a5b6072) to head (300e8ff).

Files with missing lines Patch % Lines
src/regridding.jl 80.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #166      +/-   ##
==========================================
- Coverage   89.73%   89.55%   -0.18%     
==========================================
  Files          12       12              
  Lines        1188     1206      +18     
==========================================
+ Hits         1066     1080      +14     
- Misses        122      126       +4     
Flag Coverage Δ
docs 33.89% <63.63%> (+0.58%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant