pept.save#

pept.save(filepath, obj)[source]#

Save an object obj instance as a binary file at filepath.

Saves the full object state, including e.g. the inner .lines NumPy array, sample_size, etc. in a fast, portable binary format. Load back the object using the pept.load method.

Parameters
filepathfilename or file handle

If filepath is a path (rather than file handle), it is relative to where python is called.

objobject

Any - tipically PEPT-oriented - object to be saved in the binary pickle format.

Examples

Save a LineData instance, then load it back:

>>> lines = pept.LineData([[1, 2, 3, 4, 5, 6, 7]])
>>> pept.save("lines.pickle", lines)
>>> lines_reloaded = pept.load("lines.pickle")