pygsti.io.metadir.write_dict_to_json_or_pkl_files

pygsti.io.metadir.write_dict_to_json_or_pkl_files#

write_dict_to_json_or_pkl_files(d, dirname)#

Write each element of d into a separate file in dirname.

If the element is json-able, it is JSON-serialized and the “.json” extension is used. If not, pickle is used to serialize the element, and the “.pkl” extension is used. This is the reverse of _read_json_or_pkl_files_to_dict().

Parameters:
  • d (dict) – the dictionary of elements to serialize.

  • dirname (str) – the directory name.

Return type:

None