dump

negmas.helpers.dump(d, file_name, sort_keys=True, compact=False)[source]

Saves an object depending on the extension of the file given. If the filename given has no extension, DEFAULT_DUMP_EXTENSION will be used

Parameters
  • d (Any) – Object to save

  • file_name (Union[str, PathLike, Path]) – file name

  • sort_keys – If true, the keys will be sorted before saving

  • compact – If given, a compact representation will be tried

Remarks:

  • Supported formats are json, yaml

  • If None is given, the file will be created but will be empty

  • Numpy arrays will be converted to lists before being dumped

Return type

None