Skip to content

Commit 4d88363

Browse files
committed
[BUG] Verify paths not properly set
1 parent 59b0c7c commit 4d88363

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

test/test_modules/test_serialize_model.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import json
2-
import numpy as np
3-
42
import os
53
import pprint
64

75
import gempy as gp
86
from gempy.core.data.encoders.converters import loading_model_injection
97
from gempy.core.data.enumerators import ExampleModel
108
from gempy_engine.core.data import InterpolationOptions
11-
from verify_helper import verify_json, verify_json_ignoring_dates
9+
from test.verify_helper import verify_json
1210

1311

1412
def test_generate_horizontal_stratigraphic_model():

test/verify_helper.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -35,42 +35,6 @@ def verify_json(item, name: str):
3535
verify(item, options=parameters)
3636

3737

38-
def verify_json_ignoring_dates(item, name: str, date_fields=None):
39-
"""
40-
Verify JSON content while ignoring specified date fields.
41-
42-
Args:
43-
item: The JSON object to verify
44-
name: Name for the verification
45-
date_fields: List of field names containing dates to ignore
46-
"""
47-
# Deep copy to avoid modifying the original
48-
import copy
49-
item_copy = copy.deepcopy(item)
50-
51-
# Replace date fields with placeholders
52-
date_fields = date_fields or ["date", "created_at", "updated_at", "timestamp"]
53-
_replace_dates_recursive(item_copy, date_fields)
54-
55-
# Use your existing verify_json function
56-
verify_json(item_copy, name)
57-
58-
59-
def _replace_dates_recursive(obj, date_fields):
60-
"""Helper function to recursively replace date values."""
61-
if isinstance(obj, dict):
62-
for key, value in obj.items():
63-
if key in date_fields and isinstance(value, str):
64-
obj[key] = "<DATE_IGNORED>"
65-
elif isinstance(value, (dict, list)):
66-
_replace_dates_recursive(value, date_fields)
67-
elif isinstance(obj, list):
68-
for item in obj:
69-
if isinstance(item, (dict, list)):
70-
_replace_dates_recursive(item, date_fields)
71-
72-
73-
7438
def gempy_verify_array(item, name: str, rtol: float = 1e-5, atol: float = 1e-5, ):
7539
# ! You will have to set the path to your diff tool
7640
reporter = GenericDiffReporter.create(

0 commit comments

Comments
 (0)