pygsti.io.metadir.write_meta_based_dir#
- write_meta_based_dir(root_dir, valuedict, auxfile_types=None, init_meta=None)#
Write a dictionary of quantities to a directory.
Write the dictionary by placing everything in a ‘meta.json’ file except for special key/value pairs (“special” usually because they lend themselves to an non-JSON format or they simply cannot be rendered as JSON) which are placed in “auxiliary” files formatted according to auxfile_types (which itself is saved in meta.json).
- Parameters:
root_dir (str) – The directory to write to (will be created if needed).
valuedict (dict) – The dictionary of values to serialize to disk.
auxfile_types (dict, optional) – A dictionary whose keys are a subset of the keys of valuedict, and whose values are known “aux-file” types. auxfile_types[key] says that valuedict[key] should be serialized into a separate file (whose name is usually key + an appropriate extension) of the given format rather than be included directly in ‘meta.json`. If None, this dictionary is assumed to be valuedict[‘auxfile_types’].
init_meta (dict, optional) – A dictionary of “initial” meta-data to be included in the ‘meta.json’ (but that isn’t in valuedict). For example, the class name of an object is often stored as in the “type” field of meta.json when the_model objects .__dict__ is used as valuedict.
- Return type:
None