MCPcopy Create free account
hub / github.com/ahalev/python-microgrid / add_path_to_arr_like

Function add_path_to_arr_like

src/pymgrid/utils/serialize.py:42–52  ·  view source on GitHub ↗
(data_dict, path, yaml_tag)

Source from the content-addressed store, hash-verified

40
41
42def add_path_to_arr_like(data_dict, path, yaml_tag):
43 for key, value in data_dict.items():
44 if isinstance(value, dict):
45 data_dict[key] = add_path_to_arr_like(value, path / key, yaml_tag)
46 elif isinstance(value, TO_CSV_TYPES):
47 if isinstance(value, np.ndarray):
48 value = NDArraySubclass(value)
49 value.path = path / f'{yaml_tag.lstrip("!")}/{key}.csv.gz'
50 data_dict[key] = value
51
52 return data_dict
53
54
55def add_numpy_pandas_representers():

Callers 1

dump_dataFunction · 0.85

Calls 1

NDArraySubclassClass · 0.85

Tested by

no test coverage detected