Skip to content

GEOPY-3040: Accept integer data type for weights and norm, and coerce to floats - #472

Merged
domfournier merged 12 commits into
developfrom
GEOPY-3040
Sep 3, 2026
Merged

domfournier merged 12 commits into
developfrom
GEOPY-3040

Conversation

@domfournier

@domfournier domfournier commented Aug 26, 2026 •

Copy link
Copy Markdown
Collaborator

GEOPY-3040 - Accept integer data type for weights and norm, and coerce to floats

# 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
#	py-3.12.conda-lock.yml
#	py-3.13.conda-lock.yml
#	pyproject.toml
Copilot AI lite review requested due to automatic review settings August 26, 2026 19:29
@github-actions github-actions Bot changed the title GEOPY-3040 GEOPY-3040: Accept integer data type for weights and norm, and coerce to floats Aug 26, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 broadens SimPEG Drivers’ parameter handling so inversion/forward options and UI JSON schemas can accept IntegerData (in addition to FloatData) for weights/norms and other numeric model inputs, with test updates to exercise integer inputs.

Changes:

  • Widened multiple Pydantic option types from FloatData to FloatData | IntegerData across drivers/options (e.g., norms, bounds, length scales, reference/starting models).
  • Updated many .ui.json definitions to allow "dataType": ["Float", "Integer"] where numeric channels are selectable.
  • Updated tests and environment/dependency pins (pyproject + conda lockfiles) to align with the new typing/schema expectations.

Reviewed changes

Copilot reviewed 58 out of 58 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/run_tests/driver_rotated_gradients_test.py Use integer dip/azimuth arrays to validate rotated-gradient inputs accept ints.
tests/run_tests/driver_grav_test.py Add integer norms/length scales/reference model inputs in gravity run test.
simpeg_drivers/potential_fields/magnetic_vector/options.py Allow IntegerData for vector model option fields; constrain inducing field params to scalar floats.
simpeg_drivers/potential_fields/magnetic_vector_pde/options.py Allow IntegerData for PDE vector model option fields; constrain inducing field params to scalar floats.
simpeg_drivers/potential_fields/magnetic_scalar/options.py Allow IntegerData for scalar magnetic model fields; constrain inducing field params to scalar floats.
simpeg_drivers/potential_fields/gravity/options.py Allow IntegerData for gravity reference model option.
simpeg_drivers/plate_simulation/driver.py Permit integer-valued model data for plate simulation driver _model.
simpeg_drivers/options.py Expand core option type unions to include IntegerData for multiple numeric model parameters.
simpeg_drivers/joint/options.py Expand joint model option unions to include IntegerData for bounds/norms/regularization inputs.
simpeg_drivers/joint/joint_surveys/options.py Allow integer data for starting/reference models in joint surveys options.
simpeg_drivers/joint/joint_petrophysics/options.py Allow integer data for alpha_s in joint petrophysics options; cleanup imports.
simpeg_drivers/electricals/base_2d.py Allow integer data for 2D conductivity model option.
simpeg_drivers/depth_of_investigation/sensitivity_cutoff/options.py Cleanup unused import (SimPEGGroup).
simpeg_drivers/components/topography.py Coerce topography channel values to float when building locations.
simpeg_drivers-assets/uijson/tipper_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/tipper_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/tdem1d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/tdem1d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/tdem_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/tdem_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetotellurics_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetotellurics_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_vector_pde_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_vector_pde_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_vector_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_vector_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_scalar_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/magnetic_scalar_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/joint_surveys_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/joint_petrophysics_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/joint_cross_gradient_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/induced_polarization_3d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/induced_polarization_3d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/induced_polarization_2d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/induced_polarization_2d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/gravity_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/gravity_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/fdem1d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/fdem1d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/fdem_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/fdem_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/direct_current_3d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/direct_current_3d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/direct_current_2d_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/direct_current_2d_forward.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/apparent_conductivity_inversion.ui.json Permit Integer channels where Float channels were previously required.
simpeg_drivers-assets/uijson/apparent_conductivity_forward.ui.json Permit Integer channels where Float channels were previously required.
pyproject.toml Switch several git dependencies to track develop.
py-3.13.conda-lock.yml Update lockfile to reflect dependency rev changes and package resolution changes.
environments/py-3.13-win-64.conda.lock.yml Update resolved environment for win-64 (py3.13).
environments/py-3.13-win-64-dev.conda.lock.yml Update resolved dev environment for win-64 (py3.13).
environments/py-3.13-linux-64.conda.lock.yml Update resolved environment for linux-64 (py3.13).
environments/py-3.13-linux-64-dev.conda.lock.yml Update resolved dev environment for linux-64 (py3.13).
environments/py-3.12-win-64.conda.lock.yml Update resolved environment for win-64 (py3.12).
environments/py-3.12-win-64-dev.conda.lock.yml Update resolved dev environment for win-64 (py3.12).
environments/py-3.12-linux-64.conda.lock.yml Update resolved environment for linux-64 (py3.12).
environments/py-3.12-linux-64-dev.conda.lock.yml Update resolved dev environment for linux-64 (py3.12).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread simpeg_drivers/joint/options.py
Comment thread pyproject.toml
Comment thread simpeg_drivers/options.py Outdated
@codecov

codecov Bot commented Aug 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.55072% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.45%. Comparing base (2107b88) to head (ad026cd).

Files with missing lines Patch % Lines
simpeg_drivers/components/topography.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #472      +/-   ##
===========================================
+ Coverage    90.42%   90.45%   +0.02%     
===========================================
  Files          113      113              
  Lines         6988     6987       -1     
  Branches       862      862              
===========================================
+ Hits          6319     6320       +1     
+ Misses         452      451       -1     
+ Partials       217      216       -1     
Files with missing lines Coverage Δ
...pth_of_investigation/sensitivity_cutoff/options.py 92.59% <100.00%> (ø)
simpeg_drivers/electricals/base_2d.py 98.09% <100.00%> (ø)
simpeg_drivers/joint/joint_petrophysics/options.py 100.00% <100.00%> (ø)
simpeg_drivers/joint/joint_surveys/options.py 93.54% <100.00%> (ø)
simpeg_drivers/joint/options.py 100.00% <100.00%> (ø)
simpeg_drivers/options.py 95.94% <100.00%> (ø)
simpeg_drivers/plate_simulation/driver.py 88.65% <100.00%> (ø)
simpeg_drivers/potential_fields/gravity/options.py 100.00% <100.00%> (ø)
...rivers/potential_fields/magnetic_scalar/options.py 100.00% <100.00%> (ø)
...rivers/potential_fields/magnetic_vector/options.py 100.00% <100.00%> (ø)
... and 2 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gmcga
gmcga self-requested a review August 28, 2026 18:20
domfournier and others added 4 commits August 31, 2026 09:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts:
#	environments/py-3.12-linux-64-dev.conda.lock.yml
#	environments/py-3.12-win-64-dev.conda.lock.yml
#	environments/py-3.13-linux-64-dev.conda.lock.yml
#	environments/py-3.13-win-64-dev.conda.lock.yml
#	py-3.12.conda-lock.yml
#	py-3.13.conda-lock.yml

@gmcga gmcga left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

see comments. otherwise looks good.

Comment thread simpeg_drivers-assets/uijson/joint_cross_gradient_inversion.ui.json
Comment thread simpeg_drivers-assets/uijson/tdem_inversion.ui.json
@domfournier
domfournier merged commit 0053243 into develop Sep 3, 2026
17 checks passed
@domfournier
domfournier deleted the GEOPY-3040 branch September 3, 2026 19:25
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.

3 participants