pymatgen.util.serialization module¶
Most features of this module has been moved to monty. Please refer to monty.json and monty.serialization documentation.
-
class
PmgPickler
(file, protocol=None, fix_imports=True, buffer_callback=None)[source]¶ Bases:
_pickle.Pickler
Persistence of External Objects as described in section 12.1.5.1 of https://docs.python.org/3/library/pickle.html
-
class
PmgUnpickler
(file, *, fix_imports=True, encoding='ASCII', errors='strict', buffers=())[source]¶ Bases:
_pickle.Unpickler
Persistence of External Objects as described in section 12.1.5.1 of https://docs.python.org/3/library/pickle.html
-
class
SlotPickleMixin
[source]¶ Bases:
object
This mixin makes it possible to pickle/unpickle objects with __slots__ defined.
-
json_pretty_dump
(obj, filename)[source]¶ Serialize obj as a JSON formatted stream to the given filename ( pretty printing version)
-
pmg_pickle_dump
(obj, filobj, **kwargs)[source]¶ Dump an object to a pickle file using PmgPickler.
- Parameters
obj – Object to dump.
fileobj – File-like object
**kwargs – Any of the keyword arguments supported by PmgPickler