GEOPY-2758: Implement direct run_commands to specific modules for forwards and inversions#363
Open
domfournier wants to merge 21 commits intodevelopfrom
Open
GEOPY-2758: Implement direct run_commands to specific modules for forwards and inversions#363domfournier wants to merge 21 commits intodevelopfrom
domfournier wants to merge 21 commits intodevelopfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors driver/module entrypoints and option metadata across simpeg_drivers, aligning each method’s UI JSON run_command with new dedicated forward/inversion modules, while introducing a unified 2D DC/IP drape-mesh workflow (and deprecating/removing pseudo-3D batch drivers). Tests are updated accordingly to use the new imports, drivers, and 2D meshing behavior.
Changes:
- Split multiple methods into explicit
forward.py/inversion.pyentrypoints and update package__init__exports and UI JSONrun_commandfields. - Introduce/standardize 2D DC/IP behavior via a new
Base2DDriver/Base2DOptionsand utilities for line-part inference + drape mesh creation/merging. - Update and prune tests/run-tests to use the new driver imports and revised 2D/legacy behaviors (including removal of batch-2D test modules).
Reviewed changes
Copilot reviewed 176 out of 176 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils_surveys_test.py | Adds tests for electrode part extraction and drape mesh creation by line id. |
| tests/utils_regularization_test.py | Updates orientation conversion test to use direction_and_dip with geoh5 property groups. |
| tests/uijson_test.py | Adjusts legacy uijson driver loading and asserts new warnings/mesh option handling. |
| tests/topography_test.py | Updates MVI option class import/name to MagneticVectorInversionOptions. |
| tests/run_tests/sensitivity_cutoff_test.py | Updates gravity imports to new package exports. |
| tests/run_tests/oriented_fem_receiver_test.py | Updates FDEM driver/options imports to new package exports. |
| tests/run_tests/oriented_airborne_tem_receiver_test.py | Updates TDEM driver/options imports to new package exports. |
| tests/run_tests/driver_tipper_test.py | Updates tipper imports to new package exports. |
| tests/run_tests/driver_tile_estimator_test.py | Updates magnetic scalar imports to new package exports. |
| tests/run_tests/driver_rotated_gradients_test.py | Updates gravity imports to new package exports. |
| tests/run_tests/driver_mvi_test.py | Renames MVI drivers/options to MagneticVector equivalents and updates imports. |
| tests/run_tests/driver_mt_test.py | Updates MT imports to new package exports. |
| tests/run_tests/driver_mag_test.py | Updates magnetic scalar imports to new package exports. |
| tests/run_tests/driver_mag_automesh_test.py | Updates magnetic scalar forward driver import path. |
| tests/run_tests/driver_joint_surveys_test.py | Updates driver imports and gravity forward driver usage in joint survey tests. |
| tests/run_tests/driver_joint_pgi_homogeneous_test.py | Refactors homogeneous PGI test to reuse forward-run artifacts and updated driver imports. |
| tests/run_tests/driver_joint_cross_gradient_test.py | Refactors joint cross-gradient test to reuse forward-run artifacts and updated driver imports; updates target values. |
| tests/run_tests/driver_ip_test.py | Updates IP3D driver/options imports to new package exports. |
| tests/run_tests/driver_ip_b2d_test.py | Removes pseudo-3D batch IP test module. |
| tests/run_tests/driver_ip_2d_test.py | Switches IP2D tests to drape-mesh workflow and uncertainty data objects. |
| tests/run_tests/driver_ground_tem_test.py | Updates TEM imports and adjusts expected transmitter id property name. |
| tests/run_tests/driver_grav_test.py | Updates gravity imports to new package exports. |
| tests/run_tests/driver_dc_test.py | Updates DC3D imports and changes mesh assertion to fixed cell count. |
| tests/run_tests/driver_dc_b2d_test.py | Removes pseudo-3D batch DC test module. |
| tests/run_tests/driver_app_con_test.py | Updates apparent conductivity imports to new package exports. |
| tests/run_tests/driver_airborne_tem_test.py | Updates TEM imports to new package exports. |
| tests/run_tests/driver_airborne_tem_1d_test.py | Updates TEM-1D imports to new package exports. |
| tests/run_tests/driver_airborne_fem_test.py | Updates FEM imports to new package exports. |
| tests/run_tests/driver_airborne_fem_1d_test.py | Updates FEM-1D imports to new package exports. |
| tests/run_tests/driver_2d_rotated_gradients_test.py | Removes a rotated-gradients 2D run-test module. |
| tests/plate_simulation/runtest/match_test.py | Updates TDEM forward imports to new package exports. |
| tests/plate_simulation/runtest/driver_test.py | Removes unused Workspace import. |
| tests/models_test.py | Updates magnetic vector driver/options imports and type annotations. |
| tests/meshes_test.py | Updates magnetic vector driver/options imports and type annotations. |
| tests/locations_test.py | Updates magnetic vector options import and type annotations. |
| tests/driver_test.py | Updates gravity imports to new package exports. |
| tests/data_test.py | Updates magnetic vector imports and option type annotations. |
| simpeg_drivers/utils/synthetics/topography.py | Extends mesh extent calculation to accept drape model options. |
| simpeg_drivers/utils/synthetics/options.py | Allows synthetics mesh option to be either MeshOptions or DrapeModelOptions. |
| simpeg_drivers/utils/synthetics/meshes/tensors.py | Removes old tensor-mesh drape model helper. |
| simpeg_drivers/utils/synthetics/meshes/factory.py | Removes old mesh factory in favor of consolidated meshes.py. |
| simpeg_drivers/utils/synthetics/meshes/init.py | Removes now-empty package init. |
| simpeg_drivers/utils/synthetics/meshes.py | Adds 2D mesh creation path using create_mesh_by_line_id. |
| simpeg_drivers/utils/synthetics/driver.py | Refactors synthetics component getters and switches mesh lookup to "mesh". |
| simpeg_drivers/utils/surveys.py | Adds electrode-part inference and drape mesh creation/merge utilities. |
| simpeg_drivers/utils/regularization.py | Replaces ensure_dip_direction_convention with direction_and_dip returning geoh5 Data objects. |
| simpeg_drivers/utils/nested.py | Refactors nested mesh creation (incl. 2D tensor nesting) and propagates line_ids into tiled surveys. |
| simpeg_drivers/potential_fields/magnetic_vector/options.py | Renames MVI option classes and adds explicit run_command. |
| simpeg_drivers/potential_fields/magnetic_vector/inversion.py | Defines magnetic vector inversion driver entrypoint module. |
| simpeg_drivers/potential_fields/magnetic_vector/forward.py | Adds magnetic vector forward driver entrypoint module. |
| simpeg_drivers/potential_fields/magnetic_vector/init.py | Exports forward/inversion drivers and renamed options. |
| simpeg_drivers/potential_fields/magnetic_scalar/options.py | Adds explicit run_command for magnetic scalar forward/inversion options. |
| simpeg_drivers/potential_fields/magnetic_scalar/inversion.py | Defines magnetic scalar inversion driver entrypoint module. |
| simpeg_drivers/potential_fields/magnetic_scalar/forward.py | Adds magnetic scalar forward driver entrypoint module. |
| simpeg_drivers/potential_fields/magnetic_scalar/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/potential_fields/gravity/uijson.py | Removes legacy gravity UIJson model classes. |
| simpeg_drivers/potential_fields/gravity/options.py | Adds explicit run_command for gravity forward/inversion options. |
| simpeg_drivers/potential_fields/gravity/inversion.py | Defines gravity inversion driver entrypoint module. |
| simpeg_drivers/potential_fields/gravity/forward.py | Adds gravity forward driver entrypoint module. |
| simpeg_drivers/potential_fields/gravity/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/potential_fields/init.py | Removes re-exports of PF options to favor per-method modules. |
| simpeg_drivers/plate_simulation/sweep/options.py | Converts title/run_command from ClassVar to instance fields. |
| simpeg_drivers/plate_simulation/sweep/driver.py | Refactors sweep driver to use geoapps Driver and new client/worker validation. |
| simpeg_drivers/plate_simulation/options.py | Updates magnetic vector forward option mapping and converts title/run_command to instance fields. |
| simpeg_drivers/plate_simulation/match/driver.py | Refactors match driver to use geoapps Driver and shared parallelization defaults. |
| simpeg_drivers/plate_simulation/driver.py | Refactors plate simulation driver to use geoapps Driver and shared client/worker validation. |
| simpeg_drivers/options.py | Refactors gradient-rotation orientation handling and expands line selection structure; moves IPModelOptions here. |
| simpeg_drivers/natural_sources/tipper/options.py | Adds explicit run_command for tipper forward/inversion options. |
| simpeg_drivers/natural_sources/tipper/inversion.py | Defines tipper inversion driver entrypoint module. |
| simpeg_drivers/natural_sources/tipper/forward.py | Adds tipper forward driver entrypoint module. |
| simpeg_drivers/natural_sources/tipper/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/natural_sources/magnetotellurics/options.py | Adds explicit run_command for MT forward/inversion options. |
| simpeg_drivers/natural_sources/magnetotellurics/inversion.py | Defines MT inversion driver entrypoint module. |
| simpeg_drivers/natural_sources/magnetotellurics/forward.py | Adds MT forward driver entrypoint module. |
| simpeg_drivers/natural_sources/magnetotellurics/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/natural_sources/apparent_conductivity/options.py | Adds explicit run_command for AppCon forward/inversion options. |
| simpeg_drivers/natural_sources/apparent_conductivity/inversion.py | Defines AppCon inversion driver entrypoint module. |
| simpeg_drivers/natural_sources/apparent_conductivity/forward.py | Adds AppCon forward driver entrypoint module. |
| simpeg_drivers/natural_sources/apparent_conductivity/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/line_sweep/init.py | Removes empty init file. |
| simpeg_drivers/joint/joint_surveys/options.py | Adds explicit run_command for joint surveys. |
| simpeg_drivers/joint/joint_petrophysics/options.py | Adds explicit run_command for joint petrophysics. |
| simpeg_drivers/joint/joint_cross_gradient/options.py | Adds explicit run_command for joint cross-gradient. |
| simpeg_drivers/joint/driver.py | Removes a duplicate/overridden run() implementation (delegating to base). |
| simpeg_drivers/electromagnetics/time_domain/options.py | Adds explicit run_command for TDEM forward/inversion options. |
| simpeg_drivers/electromagnetics/time_domain/inversion.py | Defines TDEM inversion driver entrypoint module. |
| simpeg_drivers/electromagnetics/time_domain/forward.py | Adds TDEM forward driver entrypoint module. |
| simpeg_drivers/electromagnetics/time_domain/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electromagnetics/time_domain_1d/options.py | Adds explicit run_command for TDEM-1D forward/inversion options. |
| simpeg_drivers/electromagnetics/time_domain_1d/inversion.py | Adds TDEM-1D inversion driver entrypoint module. |
| simpeg_drivers/electromagnetics/time_domain_1d/forward.py | Refactors TDEM-1D forward driver to ForwardDriver + adds CLI entrypoint. |
| simpeg_drivers/electromagnetics/time_domain_1d/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electromagnetics/frequency_domain/options.py | Adds explicit run_command for FDEM forward/inversion options. |
| simpeg_drivers/electromagnetics/frequency_domain/inversion.py | Defines FDEM inversion driver entrypoint module. |
| simpeg_drivers/electromagnetics/frequency_domain/forward.py | Adds FDEM forward driver entrypoint module. |
| simpeg_drivers/electromagnetics/frequency_domain/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electromagnetics/frequency_domain_1d/options.py | Adds explicit run_command for FDEM-1D forward/inversion options and fixes docstring. |
| simpeg_drivers/electromagnetics/frequency_domain_1d/inversion.py | Adds FDEM-1D inversion driver entrypoint module. |
| simpeg_drivers/electromagnetics/frequency_domain_1d/forward.py | Refactors FDEM-1D forward driver to ForwardDriver + adds CLI entrypoint. |
| simpeg_drivers/electromagnetics/frequency_domain_1d/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electromagnetics/base_1d_driver.py | Refactors 1D base driver to use BaseDriver and shared tiling/parallel defaults. |
| simpeg_drivers/electricals/options.py | Removes duplicate IPModelOptions/file control definitions (moved elsewhere). |
| simpeg_drivers/electricals/induced_polarization/two_dimensions/options.py | Switches IP2D options to use new Base2DOptions and IPModelOptions from core options. |
| simpeg_drivers/electricals/induced_polarization/two_dimensions/inversion.py | Adds IP2D inversion driver entrypoint module. |
| simpeg_drivers/electricals/induced_polarization/two_dimensions/forward.py | Refactors IP2D forward driver to ForwardDriver + adds CLI entrypoint. |
| simpeg_drivers/electricals/induced_polarization/two_dimensions/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electricals/induced_polarization/three_dimensions/options.py | Updates import source for IPModelOptions. |
| simpeg_drivers/electricals/induced_polarization/three_dimensions/inversion.py | Defines IP3D inversion driver entrypoint module. |
| simpeg_drivers/electricals/induced_polarization/three_dimensions/forward.py | Refactors IP3D forward driver to ForwardDriver + adds CLI entrypoint. |
| simpeg_drivers/electricals/induced_polarization/three_dimensions/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electricals/induced_polarization/pseudo_three_dimensions/options.py | Removes pseudo-3D IP batch options. |
| simpeg_drivers/electricals/induced_polarization/pseudo_three_dimensions/driver.py | Removes pseudo-3D IP batch drivers. |
| simpeg_drivers/electricals/direct_current/two_dimensions/options.py | Switches DC2D options to use new Base2DOptions. |
| simpeg_drivers/electricals/direct_current/two_dimensions/inversion.py | Adds DC2D inversion driver entrypoint module. |
| simpeg_drivers/electricals/direct_current/two_dimensions/forward.py | Adds DC2D forward driver entrypoint module. |
| simpeg_drivers/electricals/direct_current/two_dimensions/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electricals/direct_current/three_dimensions/options.py | Adds explicit run_command for DC3D forward/inversion options. |
| simpeg_drivers/electricals/direct_current/three_dimensions/inversion.py | Defines DC3D inversion driver entrypoint module. |
| simpeg_drivers/electricals/direct_current/three_dimensions/forward.py | Adds DC3D forward driver entrypoint module. |
| simpeg_drivers/electricals/direct_current/three_dimensions/init.py | Exports forward/inversion drivers and options. |
| simpeg_drivers/electricals/direct_current/pseudo_three_dimensions/options.py | Removes pseudo-3D DC batch options. |
| simpeg_drivers/electricals/direct_current/pseudo_three_dimensions/driver.py | Removes pseudo-3D DC batch drivers. |
| simpeg_drivers/electricals/base_2d.py | Introduces base 2D driver/options with drape mesh creation and line selection/tiling. |
| simpeg_drivers/components/windows.py | Removes InversionWindow implementation. |
| simpeg_drivers/components/topography.py | Extends active cell logic to include pseudo-3D naming and adjusts 2D/pseudo handling. |
| simpeg_drivers/components/models.py | Converts gradient direction/dip models to radians on access. |
| simpeg_drivers/components/factories/simulation_factory.py | Removes pseudo-3D simulation type routing in the factory. |
| simpeg_drivers/components/factories/receiver_factory.py | Adapts to direction_and_dip returning geoh5 Data objects. |
| simpeg_drivers/components/factories/directives_factory.py | Handles missing inversion objects, expands ghost handling to 2D, and reshapes data with NaNs. |
| simpeg_drivers/components/data.py | Moves electrode-part logic to shared utility and adds 2D line_ids propagation for tiling. |
| simpeg_drivers/components/init.py | Removes InversionWindow export. |
| simpeg_drivers/init.py | Updates DRIVER_MAP module paths to new package exports and maps pseudo-3D names to 2D drivers. |
| simpeg_drivers-assets/uijson/tipper_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/tipper_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/tdem1d_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/tdem_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/tdem_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/plate_sweep.ui.json | Updates run_command field and removes redundant metadata fields. |
| simpeg_drivers-assets/uijson/plate_simulation.ui.json | Updates run_command field and removes redundant metadata fields. |
| simpeg_drivers-assets/uijson/plate_match.ui.json | Removes redundant top-level metadata fields from the UI JSON. |
| simpeg_drivers-assets/uijson/magnetotellurics_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/magnetotellurics_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/magnetic_vector_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/magnetic_vector_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/magnetic_scalar_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/magnetic_scalar_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/joint_surveys_inversion.ui.json | Updates run_command to joint driver module. |
| simpeg_drivers-assets/uijson/joint_petrophysics_inversion.ui.json | Updates run_command to joint driver module. |
| simpeg_drivers-assets/uijson/joint_cross_gradient_inversion.ui.json | Updates run_command to joint driver module. |
| simpeg_drivers-assets/uijson/induced_polarization_batch2d_forward.ui.json | Removes legacy batch-2D IP UI JSON. |
| simpeg_drivers-assets/uijson/induced_polarization_3d_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/induced_polarization_3d_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/induced_polarization_2d_inversion.ui.json | Updates run_command and migrates line selection schema. |
| simpeg_drivers-assets/uijson/induced_polarization_2d_forward.ui.json | Updates run_command and migrates line selection schema. |
| simpeg_drivers-assets/uijson/gravity_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/gravity_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/fdem1d_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/fdem1d_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/fdem_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/fdem_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/direct_current_batch2d_forward.ui.json | Removes legacy batch-2D DC UI JSON. |
| simpeg_drivers-assets/uijson/direct_current_3d_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/direct_current_3d_forward.ui.json | Updates run_command to method-specific forward module. |
| simpeg_drivers-assets/uijson/direct_current_2d_inversion.ui.json | Updates run_command and migrates line selection schema. |
| simpeg_drivers-assets/uijson/direct_current_2d_forward.ui.json | Updates run_command and migrates line selection schema. |
| simpeg_drivers-assets/uijson/apparent_conductivity_inversion.ui.json | Updates run_command to method-specific inversion module. |
| simpeg_drivers-assets/uijson/apparent_conductivity_forward.ui.json | Updates run_command to method-specific forward module. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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-2758 - Implement direct run_commands to specific modules for forwards and inversions