Exemple #1
0
def bayesdb_open(pathname=None,
                 builtin_metamodels=None,
                 seed=None,
                 version=None,
                 compatible=None):
    """Open the BayesDB in the file at `pathname`.

    If there is no file at `pathname`, it is automatically created.
    If `pathname` is unspecified or ``None``, a temporary in-memory
    BayesDB instance is created.

    `seed` is a 32-byte string specifying a pseudorandom number
    generation seed.  If not specified, it defaults to all zeros.

    If `compatible` is `None` or `False` and the database already
    exists, `bayesdb_open` may have the effect of incompatibly
    changing the format of the database so that older versions of
    bayeslite cannot read it.  If `compatible` is `True`,
    `bayesdb_open` will not incompatibly change the format of the
    database (but some newer bayesdb features may not work).
    """
    if builtin_metamodels is None:
        builtin_metamodels = True
    bdb = BayesDB(bayesdb_open_cookie,
                  pathname=pathname,
                  seed=seed,
                  version=version,
                  compatible=compatible)
    if builtin_metamodels:
        metamodel.bayesdb_register_builtin_metamodels(bdb)
    return bdb
Exemple #2
0
def bayesdb_open(pathname=None, builtin_metamodels=None, seed=None,
        version=None, compatible=None):
    """Open the BayesDB in the file at `pathname`.

    If there is no file at `pathname`, it is automatically created.
    If `pathname` is unspecified or ``None``, a temporary in-memory
    BayesDB instance is created.

    `seed` is a 32-byte string specifying a pseudorandom number
    generation seed.  If not specified, it defaults to all zeros.

    If `compatible` is `None` or `False` and the database already
    exists, `bayesdb_open` may have the effect of incompatibly
    changing the format of the database so that older versions of
    bayeslite cannot read it.  If `compatible` is `True`,
    `bayesdb_open` will not incompatibly change the format of the
    database.
    """
    if builtin_metamodels is None:
        builtin_metamodels = True
    bdb = BayesDB(bayesdb_open_cookie, pathname=pathname, seed=seed,
        version=version, compatible=compatible)
    if builtin_metamodels:
        metamodel.bayesdb_register_builtin_metamodels(bdb)
    return bdb
def bayesdb_open(pathname=None, builtin_metamodels=None):
    """Open the BayesDB in the file at `pathname`.

    If there is no file at `pathname`, it is automatically created.
    If `pathname` is unspecified or ``None``, a temporary in-memory
    BayesDB instance is created.
    """
    if builtin_metamodels is None:
        builtin_metamodels = True
    bdb = BayesDB(bayesdb_open_cookie, pathname=pathname)
    if builtin_metamodels:
        metamodel.bayesdb_register_builtin_metamodels(bdb)
    return bdb