Skip to content

Commit 03a87f9

Browse files
committed
[TEST] Simplify serialization validation
1 parent 52dd88f commit 03a87f9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/test_modules/test_serialize_model.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def test_generate_horizontal_stratigraphic_model():
3838

3939

4040
def _validate_serialization(original_model, model_deserialized):
41-
a = hash(original_model.structural_frame.structural_elements[1].surface_points.data.tobytes())
42-
b = hash(model_deserialized.structural_frame.structural_elements[1].surface_points.data.tobytes())
43-
o_a = hash(original_model.structural_frame.structural_elements[1].orientations.data.tobytes())
44-
o_b = hash(model_deserialized.structural_frame.structural_elements[1].orientations.data.tobytes())
41+
a = hash(original_model.structural_frame.surface_points_copy.data.tobytes())
42+
b = hash(model_deserialized.structural_frame.surface_points_copy.data.tobytes())
43+
o_a = hash(original_model.structural_frame.orientations_copy.data.tobytes())
44+
o_b = hash(model_deserialized.structural_frame.orientations_copy.data.tobytes())
4545
assert a == b, "Hashes for surface points are not equal"
4646
assert o_a == o_b, "Hashes for orientations are not equal"
4747
assert model_deserialized.__str__() == original_model.__str__()
@@ -55,6 +55,11 @@ def test_save_model_to_disk():
5555
loaded_model = load_model("temp/test_save_model_to_disk.json")
5656
_validate_serialization(model, loaded_model)
5757

58+
gp.compute_model(loaded_model)
59+
if True:
60+
import gempy_viewer as gpv
61+
gpv.plot_3d(loaded_model)
62+
5863

5964

6065

0 commit comments

Comments
 (0)