gwexpy.interop.json_
Functions
|
Create a TimeSeries from a dictionary. |
|
Create a TimeSeries from a JSON string. |
|
Convert a TimeSeries to a dictionary. |
|
Convert TimeSeries to a JSON string. |
- gwexpy.interop.json_.to_json(ts)[source]
Convert TimeSeries to a JSON string.
Includes data and basic metadata.
- gwexpy.interop.json_.to_dict(ts)[source]
Convert a TimeSeries to a dictionary.
- gwexpy.interop.json_.from_json(cls, json_str, **kwargs)[source]
Create a TimeSeries from a JSON string.
Extra keyword arguments are forwarded to
from_dict()so callers can override metadata (unit/channel/name/t0/dt) absent from the JSON payload.
- gwexpy.interop.json_.from_dict(cls, data_dict, *, unit=None, channel=None, name=None, t0=None, dt=None)[source]
Create a TimeSeries from a dictionary.
Metadata not present in
data_dictcan be supplied explicitly via the keyword arguments; an explicit argument always takes priority over a value stored in the dictionary (user > source). Missingt0/dtfall back to0/1with aUserWarningrather than silently.