From 78fa54ba9ee5648552a112187499ddc2508cef54 Mon Sep 17 00:00:00 2001 From: "Karl N. Kappler" Date: Fri, 25 Mar 2022 15:08:31 -0700 Subject: [PATCH] Preparing to merge isssue_153 branch into dev replaced config with expected_sample_rate in validate_sample_rate and also have already got one import from mt_metadata in pipelines/helpers.py in anticipation of merge [Issue(s): #153, #80 ] --- aurora/pipelines/helpers.py | 5 ++++- tests/parkfield/test_process_parkfield.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/aurora/pipelines/helpers.py b/aurora/pipelines/helpers.py index 5705c976..ffceb9a4 100644 --- a/aurora/pipelines/helpers.py +++ b/aurora/pipelines/helpers.py @@ -1,7 +1,7 @@ from pathlib import Path from aurora.config.processing_config import RunConfig - +from aurora.config.metadata.processing import Processing def initialize_config(run_config): """ @@ -19,6 +19,9 @@ def initialize_config(run_config): config.from_json(run_config) elif isinstance(run_config, RunConfig): config = run_config + print("ToBeDeprecated") + elif isinstance(run_config, Processing): + config = run_config else: print(f"Unrecognized config of type {type(run_config)}") raise Exception diff --git a/tests/parkfield/test_process_parkfield.py b/tests/parkfield/test_process_parkfield.py index d4c3c257..e702ff29 100644 --- a/tests/parkfield/test_process_parkfield.py +++ b/tests/parkfield/test_process_parkfield.py @@ -31,7 +31,7 @@ def process_decimation_level(config, run_id, units="MT"): local_run_obj = mth5_obj.get_run(config["local_station_id"], run_id) local_run_ts = local_run_obj.to_runts() - validate_sample_rate(local_run_ts, config) + validate_sample_rate(local_run_ts, config.sample_rate) local_stft_obj = run_ts_to_calibrated_stft( local_run_ts, local_run_obj, config, units=units )