Skip to content

GEOPY-2622: Clip limits of topography extent based on mesh extent#344

Open
benk-mira wants to merge 8 commits intodevelopfrom
GEOPY-2622
Open

GEOPY-2622: Clip limits of topography extent based on mesh extent#344
benk-mira wants to merge 8 commits intodevelopfrom
GEOPY-2622

Conversation

@benk-mira
Copy link
Contributor

@benk-mira benk-mira commented Feb 11, 2026

GEOPY-2622 - Clip limits of topography extent based on mesh extent

@github-actions github-actions bot changed the title Geopy 2622 GEOPY-2622: Clip limits of topography extent based on mesh extent Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.29%. Comparing base (210eb33) to head (78700bc).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #344      +/-   ##
===========================================
+ Coverage    91.26%   91.29%   +0.02%     
===========================================
  Files          120      120              
  Lines         6505     6526      +21     
  Branches       785      787       +2     
===========================================
+ Hits          5937     5958      +21     
  Misses         379      379              
  Partials       189      189              
Files with missing lines Coverage Δ
simpeg_drivers/components/topography.py 93.65% <100.00%> (+0.54%) ⬆️
simpeg_drivers/utils/utils.py 78.08% <100.00%> (+1.49%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@domfournier domfournier left a comment

Choose a reason for hiding this comment

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

Need to add unit tests for the two new util functions.

return np.array([xmin, xmax, ymin, ymax])


def mask_vertices_and_cells(
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's too bad, we are duplicating a lot of mechanics of geoh5py surface.copy_by_extent() method.
We can migrate this to geoh5py on GEOPY-2714

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I've left some notes regarding the implementation to make sure it can be used for this case

Comment on lines 58 to 66
def half_cell(axis):
return (
getattr(octree, f"{axis}_cell_size") * octree.octree_cells["NCells"]
) / 2

xmin = (octree.centroids[:, 0] - half_cell("u")).min()
xmax = (octree.centroids[:, 0] + half_cell("u")).max()
ymin = (octree.centroids[:, 1] - half_cell("v")).min()
ymax = (octree.centroids[:, 1] + half_cell("v")).max()
Copy link
Collaborator

@domfournier domfournier Feb 13, 2026

Choose a reason for hiding this comment

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

I think we can make this leaner,

sides = np.r_[getattr(octree, f"{axis}_cell_size") * getattr(octree, f"{axis}_count") for axis in "uvw"]
return np.c_[octree.origin, octree.origin + sides]

and should also migrate this to geoh5py and be generalized for rotation angles (GEOPY-2714).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

cleaned up.

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.

2 participants