SciPy

tethne.persistence.hdf5.tapmodel module

class tethne.persistence.hdf5.tapmodel.HDF5TAPModel(T=None, datapath=None)[source]

Bases: tethne.model.social.tapmodel.TAPModel

Provides HDF5 persistence for TAPModel.

tethne.persistence.hdf5.tapmodel.from_hdf5(HD_or_path)[source]

Load a LDAModel from a HDF5LDAModel.

Parameters:

HD_or_path : str or HDF5LDAModel

If str, must be a path to a HDF5LDAModel HDF5 repo.

Returns:

model : LDAModel

Examples

From a path:

>>> model = from_hdf5('/path/to/my/HDF5LDAModel.h5')
tethne.persistence.hdf5.tapmodel.to_hdf5(model, datapath=None)[source]

Generate a HDF5TAPModel from the current instance.

Parameters:

model : TAPModel

datapath : str

(optional) Path to an HDF5 repository. If not provided, generates a temporary path, which can be accessed as the .path attribute.

Returns:

hdf5_model : HDF5TAPModel