Skip to content

Commit 61ca40f

Browse files
committed
Merge branch 'GEOPY-2793' of github.com:MiraGeoscience/geoapps-utils into GEOPY-2793
2 parents 2a154d6 + b1f0eb2 commit 61ca40f

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

geoapps_utils/modelling/plates.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,16 @@ def from_maxwell_plate(cls, plate: MaxwellPlate) -> Self:
115115
raise ValueError("Maxwell plate must have its geometry set.")
116116
return cls(PlateModel.from_maxwell_plate_geometry(plate.geometry))
117117

118-
def to_maxwell_plate(
119-
self, workspace: Workspace, name: str | None = None
120-
) -> MaxwellPlate:
118+
def to_maxwell_plate(self, workspace: Workspace, **plate_kwargs) -> MaxwellPlate:
121119
"""
122120
Save the Plate as a MaxwellPlate entity in the provided workspace.
123121
124122
:param workspace: Workspace to save the MaxwellPlate in.
125-
:param name: Name of the MaxwellPlate entity.
123+
:param plate_kwargs: Arguments passed on to the MaxwellPlate instantiation.
126124
"""
127125
with fetch_active_workspace(workspace) as ws:
128126
plate = MaxwellPlate.create(
129-
ws, name=name, geometry=self.params.to_maxwell_plate_geometry()
127+
ws, geometry=self.params.to_maxwell_plate_geometry(), **plate_kwargs
130128
)
131129
return plate
132130

tests/plates_test.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,6 @@ def test_maxwell_plate_integration(tmp_path):
223223
maxwell_plate.geometry.rotation = 10.0
224224

225225
with pytest.warns(UserWarning, match="Plunging plate"):
226-
plate = Plate.from_maxwell_plate(maxwell_plate)
227-
228-
assert plate.params.strike_length == 100
229-
assert plate.params.dip_length == 300
230-
assert plate.params.width == 20
231-
assert plate.params.easting == 100
232-
assert plate.params.northing == 0
233-
assert plate.params.elevation == 0
234-
assert plate.params.direction == 90
235-
assert plate.params.dip == 45
226+
new_plate = Plate.from_maxwell_plate(maxwell_plate)
227+
228+
assert new_plate.params == plate.params

0 commit comments

Comments
 (0)