GEOPY-2775: DCIP 2D crash on line ID selection#366
Open
domfournier wants to merge 2 commits intodevelopfrom
Open
GEOPY-2775: DCIP 2D crash on line ID selection#366domfournier wants to merge 2 commits intodevelopfrom
domfournier wants to merge 2 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adjusts 2D mesh construction and nested-simulation active-cell selection to be more robust in edge cases encountered in GEOPY-2775.
Changes:
- Round min/max extents passed into
mesh_builder_xyzduring drape-model mesh creation to avoid floor/int rounding edge cases. - Update DCIP-2D nested simulation mapping to derive active mesh parts from source/electrode locations rather than assuming line IDs match mesh part numbering.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
simpeg_drivers/utils/utils.py |
Computes floored/ceiled distance/elevation limits before building the tensor mesh for drape-model generation. |
simpeg_drivers/utils/nested.py |
Determines active mesh parts for DCIP-2D via cell lookup on cell_centers_x and mesh.parts, removing the sequential-ID assumption. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+310
to
+315
| # Map the line_ids to the mesh parts | ||
| in_cell = np.searchsorted( | ||
| simulation.mesh.cell_centers_x, local_survey.locations_a[:, 0] | ||
| ) | ||
| unique_parts = np.unique(simulation.mesh.parts[in_cell]) | ||
| active_mesh_part = np.isin(simulation.mesh.parts, unique_parts) |
There was a problem hiding this comment.
The comment says this maps line_ids to mesh parts, but the new logic maps mesh parts based on local_survey.locations_a (cell lookup) and doesn’t use line_ids. Please update the comment to match the implemented approach to avoid confusion for future maintenance.
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-2775 - DCIP 2D crash on line ID selection