Skip to content

Supplement unit tests with property-based tests using real esmpy - #17

Merged
bbakernoaa merged 3 commits into
mainfrom
property-based-testing-real-esmpy-3298015982066671159
Jul 13, 2026
Merged

Supplement unit tests with property-based tests using real esmpy#17
bbakernoaa merged 3 commits into
mainfrom
property-based-testing-real-esmpy-3298015982066671159

Conversation

@bbakernoaa

Copy link
Copy Markdown
Owner

This pull request supplements the existing test suite with comprehensive property-based tests in tests/test_property_based.py using Hypothesis. Crucially, these tests are configured to run with a real esmpy/esmf environment 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 that skipna correctly 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-env conda environment.


PR created automatically by Jules for task 3298015982066671159 started by @bbakernoaa

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.
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@bbakernoaa
bbakernoaa marked this pull request as ready for review July 13, 2026 02:39
@bbakernoaa
bbakernoaa merged commit bafb36c into main Jul 13, 2026
4 checks passed
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