pygsti.io.metadir.write_obj_to_meta_based_dir

pygsti.io.metadir.write_obj_to_meta_based_dir#

write_obj_to_meta_based_dir(obj, dirname, auxfile_types_member, omit_attributes=(), include_attributes=None, additional_meta=None)#

Write the contents of obj to dirname using a ‘meta.json’ file and an auxfile-types dictionary.

This is similar to write_meta_based_dir(), except it takes an object (obj) whose .__dict__, minus omitted attributes, is used as the dictionary to write and whose auxfile-types comes from another object attribute.

Parameters:
  • obj (object) – the object to serialize

  • dirname (str) – the directory name

  • auxfile_types_member (str or None) – the name of the attribute within obj that holds the dictionary mapping of attributes to auxiliary-file types. Usually this is “auxfile_types”.

  • omit_attributes (list or tuple) – List of (string-valued) names of attributes to omit when serializing this object. Usually you should just leave this empty.

  • include_attributes (list or tuple or None) – A list of (string-valued) names of attributes to specifically include when serializing this object. If None, then all attributes are included except those specifically omitted via omit_attributes. If include_attributes is not None then omit_attributes is ignored.

  • additional_meta (dict, optional) – A dictionary of additional meta-data to be included in the ‘meta.json’ file (but that isn’t an attribute of obj).

Return type:

None