SciPy

tethne.persistence.hdf5.util module

Helper classes and methods for tethne.persistence.hdf5.

TODO: move away from index table pattern, toward index array pattern.

class tethne.persistence.hdf5.util.HDF5ArrayDict(h5file, group, name, values)[source]

Bases: dict

items()[source]
iteritems()[source]
keys()[source]
values()[source]
class tethne.persistence.hdf5.util.HDF5Axes(h5file)[source]

Bases: dict

Organizes axes.

class tethne.persistence.hdf5.util.HDF5Axis(h5file, fgroup, name)[source]

Bases: dict

Organizes a single axis.

class tethne.persistence.hdf5.util.HDF5FeatureSet(h5file, fgroup, name)[source]

Bases: dict

Stores data about the distribution of a specific feature-set, e.g. unigrams, across papers in the Corpus.

class tethne.persistence.hdf5.util.HDF5FeatureValues(h5file, group, name, keyatom=StringAtom(itemsize=200, shape=(), dflt=''), indexatom=Int32Atom(shape=(), dflt=0), valueatom=Float64Atom(shape=(), dflt=0.0))[source]

Bases: dict

iteritems()[source]
class tethne.persistence.hdf5.util.HDF5Features(h5file)[source]

Bases: dict

Organizes feature-sets, each as a HDF5Feature.

class tethne.persistence.hdf5.util.HDF5Metadata(h5file, metadata=None)[source]

Bases: dict

class tethne.persistence.hdf5.util.HDF5SparseValues(h5file, group, name, iatom, katom, indexatom)[source]

Bases: dict

Parameters:

h5file

group

name

iatom

katom

indexatom

iteritems()[source]
tethne.persistence.hdf5.util.get_h5file(typename, datapath=None)[source]

Load or create an HDF5 data file.

tethne.persistence.hdf5.util.get_or_create_array(h5file, group, name, values)[source]
tethne.persistence.hdf5.util.get_or_create_group(h5file, name, where=None)[source]
tethne.persistence.hdf5.util.get_or_create_table(h5file, group, name, model)[source]
class tethne.persistence.hdf5.util.papers_table(h5file, index_by, name, citations=None, index_citation_by='ayjid')[source]

Bases: dict

Mimics the papers dict in Paper, providing HDF5 persistence.

Values should be set only once for a key.

Parameters:

h5file : tables.file.File

A tables.file.File object.

index_by : str

Key in Paper used to index papers in this Corpus.

iteritems()[source]
keys()[source]
values()[source]
class tethne.persistence.hdf5.util.vlarray_dict(h5file, group, name, atom, keyatom)[source]

Bases: dict

Provides dict-like access to an HDF5 VLArray.

items()[source]
iteritems()[source]
keys()[source]
values()[source]