pygsti.io.metadir.load_meta_based_dir#
- load_meta_based_dir(root_dir, auxfile_types_member='auxfile_types', ignore_meta=('type',), separate_auxfiletypes=False, quick_load=False)#
Load the contents of a root_dir into a dict.
The de-serialization uses the ‘meta.json’ file within root_dir to describe how the directory was serialized.
- Parameters:
root_dir (str) – The directory name.
auxfile_types_member (str, optional) – The key within meta.json that is used to describe how other members have been serialized into files. Unless you know what you’re doing, leave this as the default.
ignore_meta (tuple, optional) – Keys within meta.json that should be ignored, i.e. not loaded into elements of the returned dict. By default, “type” is in this category because it describes a class name to be built and is used in a separate first-pass processing to construct a object. Unless you know what you’re doing, leave this as the default.
separate_auxfiletypes (bool, optional) – If True, then return the auxfile_types_member element (a dict describing how quantities that aren’t in ‘meta.json’ have been serialized) as a separate return value, instead of placing it within the returned dict.
quick_load (bool, optional) – Setting this to True skips the loading of members that may take a long time to load, namely those in separate files whose files are large. When the loading of an attribute is skipped, it is set to None.
- Returns:
loaded_qtys (dict) – A dictionary of the quantities in ‘meta.json’ plus any loaded from the auxiliary files.
auxfile_types (dict) – Only returned as a separate value when separate_auxfiletypes=True. A dict describing how members of loaded_qtys that weren’t loaded directly from ‘meta.json’ were serialized.