Supplement unit tests with property-based tests using real esmpy - #17
Conversation
Implement comprehensive property-based tests targeting create_global_grid, create_regional_grid, _get_min_max_lazy_aware, spatial_slice, and real Regridder execution. The tests use real ESMF/ESMPy objects inside the configured conda environment and verify eager (NumPy) vs. lazy (Dask) equivalence, shape preservation, and skipna handling under various input combinations.
|
👋 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. |
…, and pyproject.toml
This pull request supplements the existing test suite with comprehensive property-based tests in
tests/test_property_based.pyusing Hypothesis. Crucially, these tests are configured to run with a realesmpy/esmfenvironment and use actual objects instead of mocks.Key tests implemented:
test_create_global_grid_properties: Generates diverse global grid parameters and tests eager/lazy parity.test_create_regional_grid_properties: Generates custom regional extents and resolutions and asserts coordinate range correctness, monotonicity, and eager/lazy equivalence.test_get_min_max_lazy_aware_properties: Verifies the coordinate range discovery helper across 1D/2D and eager/lazy arrays.test_regridder_real_esmf_properties: Runs real ESMF regridding (bilinear,nearest_s2d,conservative) and asserts that NumPy and Dask backends compute equivalent results, that non-spatial dimensions are correctly maintained, and thatskipnacorrectly handles NaNs.test_spatial_slice_properties: Tests regional slicing and buffer logic.All 70 unit and property-based tests pass successfully with real ESMF under the
xregrid-envconda environment.PR created automatically by Jules for task 3298015982066671159 started by @bbakernoaa