Skip to content

Commit 17798bd

Browse files
committed
factor loading of jsons into a method
1 parent c73a750 commit 17798bd

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

tests/synthetic/test_feature_weighting.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
from aurora.config.metadata import Processing
8+
from aurora.config.metadata.processing import _processing_obj_from_json_file
89
from aurora.general_helper_functions import PROCESSING_TEMPLATES_PATH
910
from aurora.pipelines.process_mth5 import process_mth5
1011
from aurora.test_utils.synthetic.paths import SyntheticTestPaths
@@ -71,9 +72,13 @@ def tst_feature_weights(
7172
return tf_cls
7273

7374

74-
def main():
75-
synthetic_test_paths = SyntheticTestPaths()
76-
mth5_path = synthetic_test_paths.mth5_path.joinpath("test12rr.h5")
75+
def load_processing_objects_from_file():
76+
"""
77+
Plaace to test reading in the processing jsons and check that their structures are as exoected
78+
Returns
79+
-------
80+
81+
"""
7782
processing_params_jsons = {}
7883
processing_params_jsons["default"] = PROCESSING_TEMPLATES_PATH.joinpath(
7984
"processing_configuration_template.json"
@@ -82,14 +87,20 @@ def main():
8287
"test_processing_config_with_weights_block.json"
8388
)
8489
processing_objects = {}
85-
from aurora.config.metadata.processing import _processing_obj_from_json_file
8690

8791
processing_objects["default"] = _processing_obj_from_json_file(
8892
processing_params_jsons["default"]
8993
)
9094
processing_objects["new"] = _processing_obj_from_json_file(
9195
processing_params_jsons["new"]
9296
)
97+
return processing_objects
98+
99+
100+
def main():
101+
synthetic_test_paths = SyntheticTestPaths()
102+
mth5_path = synthetic_test_paths.mth5_path.joinpath("test12rr.h5")
103+
processing_objects = load_processing_objects_from_file()
93104

94105
# tst_feature_weights(mth5_path, processing_objects["default"])
95106
tst_feature_weights(mth5_path, processing_objects["new"])

0 commit comments

Comments
 (0)