scitools.NumPyDB

Efficient database for NumPy objects.

class scitools.NumPyDB.NumPyDB(database_name, mode='store')[source]

Methods

dump(a, identifier) Dump NumPy array a with identifier.
load(identifier[, bestapprox]) Load NumPy array with identifier or find best approx.
locate(identifier[, bestapprox]) Find position in files where data corresponding to identifier are stored.
__init__(database_name, mode='store')[source]
__module__ = 'scitools.NumPyDB'
dump(a, identifier)[source]

Dump NumPy array a with identifier.

load(identifier, bestapprox=None)[source]

Load NumPy array with identifier or find best approx.

locate(identifier, bestapprox=None)[source]

Find position in files where data corresponding to identifier are stored. bestapprox is a user-defined function for computing the distance between two identifiers.

class scitools.NumPyDB.NumPyDB_cPickle(database_name, mode='store')[source]

Bases: scitools.NumPyDB.NumPyDB

Use basic cPickle class.

Methods

dump(a, identifier) Dump NumPy array a with identifier.
load(identifier[, bestapprox]) Load NumPy array with a given identifier. In case the
locate(identifier[, bestapprox]) Find position in files where data corresponding to identifier are stored.
__init__(database_name, mode='store')[source]
__module__ = 'scitools.NumPyDB'
dump(a, identifier)[source]

Dump NumPy array a with identifier.

load(identifier, bestapprox=None)[source]

Load NumPy array with a given identifier. In case the identifier is not found, bestapprox != None means that an approximation is sought. The bestapprox argument is then taken as a function that can be used for computing the distance between two identifiers id1 and id2.

locate(identifier, bestapprox=None)

Find position in files where data corresponding to identifier are stored. bestapprox is a user-defined function for computing the distance between two identifiers.

class scitools.NumPyDB.NumPyDB_pickle(database_name, mode='store')[source]

Bases: scitools.NumPyDB.NumPyDB

Use basic Pickle class.

Methods

dump(a, identifier) Dump NumPy array a with identifier.
load(identifier[, bestapprox]) Load NumPy array with a given identifier. In case the
locate(identifier[, bestapprox]) Find position in files where data corresponding to identifier are stored.
__init__(database_name, mode='store')[source]
__module__ = 'scitools.NumPyDB'
dump(a, identifier)[source]

Dump NumPy array a with identifier.

load(identifier, bestapprox=None)[source]

Load NumPy array with a given identifier. In case the identifier is not found, bestapprox != None means that an approximation is sought. The bestapprox argument is then taken as a function that can be used for computing the distance between two identifiers id1 and id2.

locate(identifier, bestapprox=None)

Find position in files where data corresponding to identifier are stored. bestapprox is a user-defined function for computing the distance between two identifiers.

class scitools.NumPyDB.NumPyDB_shelve(database_name, mode='store')[source]

Implement the database via shelving.

Methods

dump(a, identifier) Dump NumPy array a with identifier.
load(identifier[, bestapprox]) Load NumPy array with a given identifier. In case the
locate(identifier[, bestapprox]) Return identifier key in shelf.
__init__(database_name, mode='store')[source]
__module__ = 'scitools.NumPyDB'
dump(a, identifier)[source]

Dump NumPy array a with identifier.

load(identifier, bestapprox=None)[source]

Load NumPy array with a given identifier. In case the identifier is not found, bestapprox != None means that an approximation is sought. The bestapprox argument is then taken as a function that can be used for computing the distance between two identifiers id1 and id2.

locate(identifier, bestapprox=None)[source]

Return identifier key in shelf.

class scitools.NumPyDB.NumPyDB_text(database_name, mode='store')[source]

Bases: scitools.NumPyDB.NumPyDB

Use plain ASCII string representation.

Methods

dump(a, identifier) Dump NumPy array a with identifier.
load(identifier[, bestapprox]) Load NumPy array with a given identifier. In case the
locate(identifier[, bestapprox]) Find position in files where data corresponding to identifier are stored.
__init__(database_name, mode='store')[source]
__module__ = 'scitools.NumPyDB'
dump(a, identifier)[source]

Dump NumPy array a with identifier.

load(identifier, bestapprox=None)[source]

Load NumPy array with a given identifier. In case the identifier is not found, bestapprox != None means that an approximation is sought. The bestapprox argument is then taken as a function that can be used for computing the distance between two identifiers id1 and id2.

locate(identifier, bestapprox=None)

Find position in files where data corresponding to identifier are stored. bestapprox is a user-defined function for computing the distance between two identifiers.

scitools.NumPyDB.float_dist(id1, id2)[source]

Compute distance between two identities for NumPyDB. Assumption: id1 and id2 are real numbers (but always sent as strings). This function is typically used when time values are used as identifiers.

scitools.NumPyDB.main(n, length, method, name)[source]
scitools.NumPyDB.test_dist(id1, id2)[source]

Return distance between identifiers id1 and id2. The identifiers are of the form ‘time=some number’.

This Page