kujaku11 / mt_metadata

Tools for standardizing metadata, geared towards magnetotelluric (MT) data but is general enough to accommodate "any" type of metadata.
https://mt-metadata.readthedocs.io/en/latest/
MIT License
18 stars 4 forks source link

Processing config should load from json #222

Open kkappler opened 2 months ago

kkappler commented 2 months ago

Loading processing config from json fails to parse time period.

After an mt_metadata.transfer_functions.processing.aurora.processing.Processing is populated and saved to json, it does not load back into an mt_metadata object.

The original test for this lived in aurora/aurora/test_utils/synthetic/make_processing_configs.py. A processing config was populated with parameters, saved to json, and then loaded from json

p = Processing()
json_fn = CONFIG_PATH.joinpath(processing_config.json_fn())
p.from_json(json_fn)

This resulted in TypeError: not sure what to do with type <class 'dict'>.

File "/home/kkappler/software/irismt/mt_metadata/mt_metadata/transfer_functions/processing/aurora/run.py", line 100, in time_periods raise TypeError(f"not sure what to do with type {type(item)}") TypeError: not sure what to do with type <class 'dict'>

This appears to be related to parsing the time_period elements from the json.

This relates to aurora issue 172