Skip to content

GEOPY-2714: Refactor mask_by_extent utilities for surfaces#865

Merged
domfournier merged 13 commits intodevelopfrom
GEOPY-2714
Apr 1, 2026
Merged

GEOPY-2714: Refactor mask_by_extent utilities for surfaces#865
domfournier merged 13 commits intodevelopfrom
GEOPY-2714

Conversation

@domfournier
Copy link
Copy Markdown
Contributor

@domfournier domfournier commented Mar 26, 2026

GEOPY-2714 - Refactor mask_by_extent utilities for surfaces

Copilot AI review requested due to automatic review settings March 26, 2026 20:42
@github-actions github-actions bot changed the title GEOPY-2714 GEOPY-2714: Refactor mask_by_extent utilities for surfaces Mar 26, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (9f14d21) to head (96127f6).
⚠️ Report is 14 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #865      +/-   ##
===========================================
+ Coverage    91.25%   91.28%   +0.02%     
===========================================
  Files          112      112              
  Lines        10343    10369      +26     
  Branches      1908     1908              
===========================================
+ Hits          9439     9465      +26     
  Misses         477      477              
  Partials       427      427              
Files with missing lines Coverage Δ
geoh5py/objects/block_model.py 98.41% <100.00%> (-0.10%) ⬇️
geoh5py/objects/grid2d.py 89.51% <100.00%> (-0.15%) ⬇️
geoh5py/objects/grid_object.py 96.70% <100.00%> (+0.70%) ⬆️
geoh5py/objects/octree.py 84.96% <100.00%> (+0.34%) ⬆️
geoh5py/objects/vp_model.py 98.35% <100.00%> (+0.12%) ⬆️
geoh5py/ui_json/validation.py 87.70% <ø> (ø)

... and 1 file with indirect coverage changes

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

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a consistent “outer bounds” (extent) computation for grid-like objects by introducing a span concept and a shared coordinate transform (uvw_to_xyz), with new tests validating extents across several mesh types (VPModel, Octree, Grid2D, BlockModel).

Changes:

  • Added GridObject.extent based on transformed span corner points, plus a shared uvw_to_xyz transform and an abstract span API.
  • Implemented span for Octree, Grid2D, BlockModel, and VPModel; updated centroid computations to reuse uvw_to_xyz.
  • Added new tests for extent on VPModel/Octree/Grid2D/BlockModel.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
geoh5py/objects/grid_object.py Adds shared extent computation, span abstract property, and uvw_to_xyz transform.
geoh5py/objects/vp_model.py Uses uvw_to_xyz for centroids, adds VPModel-specific extent and span, and applies clockwise rotation handling.
geoh5py/objects/octree.py Adds span implementation used by GridObject.extent.
geoh5py/objects/grid2d.py Uses shared uvw_to_xyz and adds span for extent support.
geoh5py/objects/block_model.py Uses shared uvw_to_xyz for centroids and adds span for extent support.
tests/vp_mesh_test.py Adds VPModel extent test.
tests/octree_test.py Adds Octree extent test.
tests/grid_2d_test.py Adds Grid2D extent test.
tests/block_model_test.py Adds BlockModel extent test.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

MatthieuCMira
MatthieuCMira previously approved these changes Mar 27, 2026
Copy link
Copy Markdown
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the change.

I have the feeling we should add test for negative cell size values.

# Conflicts:
#	geoh5py/objects/block_model.py
#	geoh5py/objects/grid_object.py
#	tests/block_model_test.py
#	tests/grid_2d_test.py
# Conflicts:
#	geoh5py/shared/utils.py
#	geoh5py/ui_json/annotations.py
#	geoh5py/ui_json/forms.py
#	geoh5py/ui_json/ui_json.py
#	geoh5py/ui_json/validation.py
Copy link
Copy Markdown
Contributor

@MatthieuCMira MatthieuCMira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems good to me.

@domfournier domfournier merged commit f5eca37 into develop Apr 1, 2026
20 checks passed
@domfournier domfournier deleted the GEOPY-2714 branch April 1, 2026 14:48
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.

3 participants