GEOPY-2622: Clip limits of topography extent based on mesh extent#344
Open
GEOPY-2622: Clip limits of topography extent based on mesh extent#344
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
domfournier
reviewed
Feb 13, 2026
Collaborator
domfournier
left a comment
There was a problem hiding this comment.
Need to add unit tests for the two new util functions.
| return np.array([xmin, xmax, ymin, ymax]) | ||
|
|
||
|
|
||
| def mask_vertices_and_cells( |
Collaborator
There was a problem hiding this comment.
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
Contributor
Author
There was a problem hiding this comment.
Sure, I've left some notes regarding the implementation to make sure it can be used for this case
simpeg_drivers/utils/utils.py
Outdated
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() |
Collaborator
There was a problem hiding this comment.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GEOPY-2622 - Clip limits of topography extent based on mesh extent