tests/unittests/core/test_pickleddb.py
def clean_db(orion_db, exp_config):
    """Clean insert example experiment entries to collections."""
    if os.path.exists(orion_db.host):
        os.remove(orion_db.host)

    ephemeral_db = orion_db._get_database()
    database = ephemeral_db._db
    database["experiments"].drop()
    database["experiments"].insert_many(exp_config[0])
    database["trials"].drop()
    database["trials"].insert_many(exp_config[1])
    database["workers"].drop()
    database["workers"].insert_many(exp_config[2])
    database["resources"].drop()
    database["resources"].insert_many(exp_config[3])
    orion_db._dump_database(ephemeral_db)
Clean insert example experiment entries to collections.
Clean insert example experiment entries to collections.
Clean insert example experiment entries to collections .
def clean_db(orion_db, exp_config):
    if os.path.exists(orion_db.host):
        os.remove(orion_db.host)
    ephemeral_db = orion_db._get_database()
    database = ephemeral_db._db
    database["experiments"].drop()
    database["experiments"].insert_many(exp_config[0])
    database["trials"].drop()
    database["trials"].insert_many(exp_config[1])
    database["workers"].drop()
    database["workers"].insert_many(exp_config[2])
    database["resources"].drop()
    database["resources"].insert_many(exp_config[3])
    orion_db._dump_database(ephemeral_db)
def clean_db ( orion_db , exp_config ) : if os . path . exists ( orion_db . host ) : os . remove ( orion_db . host ) ephemeral_db = orion_db . _get_database ( ) database = ephemeral_db . _db database [ "experiments" ] . drop ( ) database [ "experiments" ] . insert_many ( exp_config [ 0 ] ) database [ "trials" ] . drop ( ) database [ "trials" ] . insert_many ( exp_config [ 1 ] ) database [ "workers" ] . drop ( ) database [ "workers" ] . insert_many ( exp_config [ 2 ] ) database [ "resources" ] . drop ( ) database [ "resources" ] . insert_many ( exp_config [ 3 ] ) orion_db . _dump_database ( ephemeral_db )
Clean insert example experiment entries to collections.
Clean insert example experiment entries to collections .
"""Clean insert example experiment entries to collections."""
orion_db
exp_config