Supplement Unit Tests with Property-Based Tests for Grid Utilities and Regridding - #18
Conversation
… regridding properties - Create property-based tests using Hypothesis for create_grid_from_crs and create_grid_like to check coordinates, monotonicity, boundaries, and eager/lazy parity. - Add property-based tests to check regridding self-identity (constant value preservation) for all ESMF methods (bilinear, nearest, conservative, patch). - Add property-based tests to check global integral conservation for conservative regridding, using spherical cell areas under a real ESMF environment. - Avoid mocking esmpy for any new tests.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This pull request supplements the unit test suite with high-quality property-based tests under
tests/test_property_based.pyusing Hypothesis.We test:
create_grid_from_crsproperties (shapes, coordinate limits, eager/lazy parity).create_grid_likeproperties (eager/lazy template mirroring, coordinate boundaries, bounds).Regridderself-identity properties across bilinear, nearest_s2d, conservative, and patch methods (by regridding a constant field and ensuring it is perfectly preserved).Regridderconservative global integral conservation properties (by regridding a random positive field using the conservative method and verifying that the spherical area-weighted global integral is conserved).All tests utilize actual objects and are verified without mocking
esmpyin a real micromamba environment.PR created automatically by Jules for task 8021962879963081823 started by @bbakernoaa