Skip to content

GEOPY-2803: simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type#382

Merged
domfournier merged 9 commits intorelease/GA_4.8from
GEOPY-2803
Apr 22, 2026
Merged

GEOPY-2803: simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type#382
domfournier merged 9 commits intorelease/GA_4.8from
GEOPY-2803

Conversation

@domfournier
Copy link
Copy Markdown
Collaborator

@domfournier domfournier commented Apr 21, 2026

GEOPY-2803 - simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type

# Conflicts:
#	simpeg_drivers/plate_simulation/options.py
@github-actions github-actions Bot changed the title GEOPY-2803 GEOPY-2803: simpeg_group_to_driver cannot retrieve driver class from deprecated inversion type Apr 21, 2026
Copy link
Copy Markdown
Contributor

@benk-mira benk-mira left a comment

Choose a reason for hiding this comment

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

Just a missing docstring.

Comment thread simpeg_drivers/utils/utils.py
domfournier and others added 4 commits April 22, 2026 12:41
# 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
benk-mira
benk-mira previously approved these changes Apr 22, 2026
Base automatically changed from GEOPY-2609 to release/GA_4.8 April 22, 2026 22:53
@domfournier domfournier dismissed benk-mira’s stale review April 22, 2026 22:53

The base branch was changed.

Copilot AI review requested due to automatic review settings April 22, 2026 22:54
Copy link
Copy Markdown
Contributor

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 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 relocates driver_class_from_name) into simpeg_drivers.utils.utils and switches call sites to use it.
  • Updates simpeg_group_to_driver to use the new dict-based driver resolution.
  • Adjusts tests to stop using the removed from_input_file path 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.

Comment thread simpeg_drivers/utils/utils.py
Comment thread simpeg_drivers/utils/utils.py Outdated

# Remove inversion type as per current json on file
options = driver.out_group.options
del options["inversion_type"]
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
del options["inversion_type"]
options.pop("inversion_type", None)

Copilot uses AI. Check for mistakes.
Comment thread simpeg_drivers/utils/utils.py
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 22, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.27%. Comparing base (4cfa196) to head (0d38280).
⚠️ Report is 10 commits behind head on release/GA_4.8.

Files with missing lines Patch % Lines
simpeg_drivers/utils/utils.py 78.26% 3 Missing and 2 partials ⚠️
simpeg_drivers/driver.py 66.66% 1 Missing ⚠️
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     
Files with missing lines Coverage Δ
simpeg_drivers/plate_simulation/driver.py 92.96% <100.00%> (ø)
simpeg_drivers/plate_simulation/options.py 87.87% <100.00%> (+3.26%) ⬆️
simpeg_drivers/driver.py 87.53% <66.66%> (+0.70%) ⬆️
simpeg_drivers/utils/utils.py 66.77% <78.26%> (+0.42%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@domfournier domfournier merged commit a4d2a28 into release/GA_4.8 Apr 22, 2026
16 of 17 checks passed
@domfournier domfournier deleted the GEOPY-2803 branch April 22, 2026 23:15
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.

4 participants