GEOPY-2803: simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type#382
Conversation
…pe" or "run_command"
# Conflicts: # simpeg_drivers/plate_simulation/options.py
benk-mira
left a comment
There was a problem hiding this comment.
Just a missing docstring.
# Conflicts: # environments/py-3.12-linux-64-dev.conda.lock.yml # environments/py-3.12-linux-64.conda.lock.yml # environments/py-3.12-win-64-dev.conda.lock.yml # environments/py-3.12-win-64.conda.lock.yml # environments/py-3.13-linux-64-dev.conda.lock.yml # environments/py-3.13-linux-64.conda.lock.yml # environments/py-3.13-win-64-dev.conda.lock.yml # environments/py-3.13-win-64.conda.lock.yml # environments/py-3.14-linux-64-dev.conda.lock.yml # environments/py-3.14-linux-64.conda.lock.yml # environments/py-3.14-win-64-dev.conda.lock.yml # environments/py-3.14-win-64.conda.lock.yml # py-3.12.conda-lock.yml # py-3.13.conda-lock.yml # py-3.14.conda-lock.yml
There was a problem hiding this comment.
Pull request overview
This PR updates driver-class resolution to support newer UI JSONs that specify the driver via run_command (rather than inversion_type), addressing failures when reconstructing drivers from stored SimPEG group options.
Changes:
- Introduces
driver_class_from_dict(and relocatesdriver_class_from_name) intosimpeg_drivers.utils.utilsand switches call sites to use it. - Updates
simpeg_group_to_driverto use the new dict-based driver resolution. - Adjusts tests to stop using the removed
from_input_filepath and to reflect the current on-disk options format.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
simpeg_drivers/utils/utils.py |
Adds driver_class_from_dict/driver_class_from_name and routes simpeg_group_to_driver through the new resolution logic. |
simpeg_drivers/driver.py |
Removes deprecated driver-resolution helpers and uses driver_class_from_dict for the CLI entrypoint. |
simpeg_drivers/plate_simulation/options.py |
Switches simulation parameter driver resolution to driver_class_from_dict. |
simpeg_drivers/plate_simulation/driver.py |
Updates import to the new location of driver_class_from_name. |
tests/uijson_test.py |
Updates UI JSON tests to use driver_class_from_dict instead of from_input_file. |
tests/run_tests/driver_joint_pgi_homogeneous_test.py |
Modifies test setup to remove inversion_type from stored out_group options. |
pyproject.toml |
Removes setuptools/setuptools-scm from build-system requirements. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| # Remove inversion type as per current json on file | ||
| options = driver.out_group.options | ||
| del options["inversion_type"] |
There was a problem hiding this comment.
Using del options["inversion_type"] will raise KeyError if the stored options already match the newer JSON format (no inversion_type). Using options.pop("inversion_type", None) keeps the test robust across both option formats.
| del options["inversion_type"] | |
| options.pop("inversion_type", None) |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release/GA_4.8 #382 +/- ##
==================================================
+ Coverage 90.22% 90.27% +0.04%
==================================================
Files 132 132
Lines 6484 6475 -9
Branches 817 815 -2
==================================================
- Hits 5850 5845 -5
+ Misses 421 420 -1
+ Partials 213 210 -3
🚀 New features to boost your workflow:
|
GEOPY-2803 - simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type