Skip to content

GEOPY-2775: DCIP 2D crash on line ID selection#366

Open
domfournier wants to merge 2 commits intodevelopfrom
GEOPY-2775
Open

GEOPY-2775: DCIP 2D crash on line ID selection#366
domfournier wants to merge 2 commits intodevelopfrom
GEOPY-2775

Conversation

@domfournier
Copy link
Collaborator

@domfournier domfournier commented Mar 24, 2026

GEOPY-2775 - DCIP 2D crash on line ID selection

Copilot AI review requested due to automatic review settings March 24, 2026 22:44
@github-actions github-actions bot changed the title GEOPY-2775 GEOPY-2775: DCIP 2D crash on line ID selection Mar 24, 2026
Copy link

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

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_xyz during 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)
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
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