GEOPY-2770: Consolidate code for plate model definition between different repos#370
GEOPY-2770: Consolidate code for plate model definition between different repos#370
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the plate simulation and synthetics configuration/tests to align with the newer PlateModel/plate-simulation parameter schema (splitting origin into easting/northing/elevation and renaming plate/overburden property fields).
Changes:
- Replaced
origin=(x, y, z)plate positioning with expliciteasting/northing/elevationacross synthetics run tests. - Refactored plate simulation options to use
plate_property,overburden_property, and nestedgeometry: PlateModel. - Updated UI JSON keys and plate simulation tests to match the renamed parameters and nested geometry structure.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/run_tests/oriented_airborne_tem_receiver_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/oriented_airborne_fem_receiver_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_rotated_gradients_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_ip_2d_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_ground_tem_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin (two occurrences). |
| tests/run_tests/driver_dc_2d_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_dc_2d_rotated_gradients_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_app_con_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/run_tests/driver_airborne_fem_test.py | Update PlateModel construction to use easting/northing/elevation instead of origin. |
| tests/plate_simulation/runtest/sweep_test.py | Update UI JSON option key usage from overburden to overburden_property. |
| tests/plate_simulation/runtest/match_test.py | Update access paths to new nested model structure (overburden, plate.geometry). |
| tests/plate_simulation/runtest/gravity_test.py | Update plate simulation params to nested geometry + renamed properties. |
| tests/plate_simulation/runtest/driver_test.py | Update input keys and assertions to renamed fields and nested geometry. |
| tests/plate_simulation/models/plates_test.py | Update plate model construction to nested geometry and remove Plate(..., center=...) usage. |
| tests/plate_simulation/models/params_test.py | Update plate model construction to nested geometry and adjust expectations accordingly. |
| tests/plate_simulation/models/events_test.py | Update anomaly plate construction to nested geometry and remove explicit center argument. |
| simpeg_drivers/utils/synthetics/options.py | Update default ModelOptions.plate to use easting/northing/elevation instead of origin. |
| simpeg_drivers/utils/synthetics/meshes.py | Adapt mesh refinement path to new PlateOptions(geometry=PlateModel(...)) structure. |
| simpeg_drivers/plate_simulation/models/parametric.py | Update Plate geometry/rotation/masking to use params.geometry and remove center handling. |
| simpeg_drivers/plate_simulation/models/options.py | Refactor plate/overburden/model options to renamed fields and nested geometry. |
| simpeg_drivers/plate_simulation/match/driver.py | Update matching driver to new model_options.overburden and model_options.plate.geometry paths. |
| simpeg_drivers/plate_simulation/driver.py | Update driver logic to renamed fields and nested geometry for plate generation/model building. |
| simpeg_drivers-assets/uijson/plate_simulation.ui.json | Rename UI JSON keys to overburden_property and plate_property. |
Comments suppressed due to low confidence (1)
simpeg_drivers/plate_simulation/models/options.py:133
- Typo in docstring: "blackground" should be "background".
class ModelOptions(BaseModel):
"""
Parameters for the blackground + overburden and plate model.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 43 out of 43 changed files in this pull request and generated 10 comments.
Comments suppressed due to low confidence (2)
simpeg_drivers/utils/synthetics/options.py:44
- The
limitsdocstring says "East-West bounding box" but the returned list includes both x and y extents ([xmin, xmax, ymin, ymax]). Update the wording to reflect an XY bounding box to avoid misleading documentation.
def limits(self) -> list[float]:
"""East-West bounding box of the survey as [xmin, xmax, ymin, ymax]."""
return [
self.center[0] - self.width / 2,
self.center[0] + self.width / 2,
self.center[1] - self.height / 2,
self.center[1] + self.height / 2,
]
tests/run_tests/driver_mvi_test.py:201
MeshOptionsno longer defines arefinementfield, sorefinement=refinementhere will be ignored (or fail validation). Update this instantiation to use the new refinement fields (e.g.,survey_refinement=list(refinement), plustopography_refinement/plate_refinementas appropriate).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…the cell_size argument
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nd finds 'plate' and 'overbuden' fields elsewhere in the model.
|
|
||
| thickness: float | ||
| overburden: float | ||
| overburden_property: float |
There was a problem hiding this comment.
Can you add an alias for backward compatibility. We can drop it later, but while we transition
| overburden_property: float | |
| overburden_property: float = Field(validation_alias=AliasChoices("overburden_property", "overburden") |
| dip_length: float | ||
| dip: float = 90.0 | ||
| dip_direction: float = 90.0 | ||
| plate_property: float |
There was a problem hiding this comment.
Same here, add an alias to preserve the former name
| plate_property: float | |
| plate_property: float = Field(validation_alias=AliasChoices("plate_property", "plate") |
| @property | ||
| def surface(self): | ||
| """ | ||
| A surface object representing the plate. | ||
| """ | ||
| return self._surface |
There was a problem hiding this comment.
I am guessing you will have a PR on geoapps-utils to port this over?
GEOPY-2770 - Consolidate code for plate model definition between different repos