Legacy Database

Legacy storage

Old Storage implementation.

class orion.storage.legacy.Legacy(database=None, setup=True)[source]

Legacy protocol, store all experiments and trials inside the Database()

Parameters
config: Dict

configuration definition passed from experiment_builder to storage factory to legacy constructor. See Database for more details

setup: bool

Setup the database (create indexes)

Methods

count_broken_trials(experiment)

See orion.storage.base.BaseStorageProtocol.count_broken_trials()

count_completed_trials(experiment)

See orion.storage.base.BaseStorageProtocol.count_completed_trials()

create_benchmark(config)

Insert a new benchmark inside the database

create_experiment(config)

See orion.storage.base.BaseStorageProtocol.create_experiment()

delete_experiment([experiment, uid])

See orion.storage.base.BaseStorageProtocol.delete_experiment()

delete_trials([experiment, uid, where])

See orion.storage.base.BaseStorageProtocol.delete_trials()

fetch_benchmark(query[, selection])

Fetch all benchmarks that match the query

fetch_experiments(query[, selection])

See orion.storage.base.BaseStorageProtocol.fetch_experiments()

fetch_lost_trials(experiment)

See orion.storage.base.BaseStorageProtocol.fetch_lost_trials()

fetch_noncompleted_trials(experiment)

See orion.storage.base.BaseStorageProtocol.fetch_noncompleted_trials()

fetch_pending_trials(experiment)

See orion.storage.base.BaseStorageProtocol.fetch_pending_trials()

fetch_trials([experiment, uid, where])

See orion.storage.base.BaseStorageProtocol.fetch_trials()

fetch_trials_by_status(experiment, status)

See orion.storage.base.BaseStorageProtocol.fetch_trials_by_status()

get_trial([trial, uid])

See orion.storage.base.BaseStorageProtocol.get_trial()

push_trial_results(trial)

See orion.storage.base.BaseStorageProtocol.push_trial_results()

register_lie(trial)

See orion.storage.base.BaseStorageProtocol.register_lie()

register_trial(trial)

See orion.storage.base.BaseStorageProtocol.register_trial()

reserve_trial(experiment)

See orion.storage.base.BaseStorageProtocol.reserve_trial()

retrieve_result(trial, **kwargs)

Do nothing for the legacy backend.

set_trial_status(trial, status[, heartbeat, was])

See orion.storage.base.BaseStorageProtocol.set_trial_status()

update_experiment([experiment, uid, where])

See orion.storage.base.BaseStorageProtocol.update_experiment()

update_heartbeat(trial)

Update trial's heartbeat

update_trial([trial, uid, where])

See orion.storage.base.BaseStorageProtocol.update_trial()

update_trials([experiment, uid, where])

See orion.storage.base.BaseStorageProtocol.update_trials()

count_broken_trials(experiment)[source]

See orion.storage.base.BaseStorageProtocol.count_broken_trials()

count_completed_trials(experiment)[source]

See orion.storage.base.BaseStorageProtocol.count_completed_trials()

create_benchmark(config)[source]

Insert a new benchmark inside the database

create_experiment(config)[source]

See orion.storage.base.BaseStorageProtocol.create_experiment()

delete_experiment(experiment=None, uid=None)[source]

See orion.storage.base.BaseStorageProtocol.delete_experiment()

delete_trials(experiment=None, uid=None, where=None)[source]

See orion.storage.base.BaseStorageProtocol.delete_trials()

fetch_benchmark(query, selection=None)[source]

Fetch all benchmarks that match the query

fetch_experiments(query, selection=None)[source]

See orion.storage.base.BaseStorageProtocol.fetch_experiments()

fetch_lost_trials(experiment)[source]

See orion.storage.base.BaseStorageProtocol.fetch_lost_trials()

fetch_noncompleted_trials(experiment)[source]

See orion.storage.base.BaseStorageProtocol.fetch_noncompleted_trials()

fetch_pending_trials(experiment)[source]

See orion.storage.base.BaseStorageProtocol.fetch_pending_trials()

fetch_trials(experiment=None, uid=None, where=None)[source]

See orion.storage.base.BaseStorageProtocol.fetch_trials()

fetch_trials_by_status(experiment, status)[source]

See orion.storage.base.BaseStorageProtocol.fetch_trials_by_status()

get_trial(trial=None, uid=None)[source]

See orion.storage.base.BaseStorageProtocol.get_trial()

push_trial_results(trial)[source]

See orion.storage.base.BaseStorageProtocol.push_trial_results()

register_lie(trial)[source]

See orion.storage.base.BaseStorageProtocol.register_lie()

register_trial(trial)[source]

See orion.storage.base.BaseStorageProtocol.register_trial()

reserve_trial(experiment)[source]

See orion.storage.base.BaseStorageProtocol.reserve_trial()

retrieve_result(trial, **kwargs)[source]

Do nothing for the legacy backend.

Trial object should already have its results at this point.

Parameters
trial: Trial

The trial object to be updated

Returns
returns the trial object

Notes

This does not update the database!

set_trial_status(trial, status, heartbeat=None, was=None)[source]

See orion.storage.base.BaseStorageProtocol.set_trial_status()

update_experiment(experiment=None, uid=None, where=None, **kwargs)[source]

See orion.storage.base.BaseStorageProtocol.update_experiment()

update_heartbeat(trial)[source]

Update trial’s heartbeat

update_trial(trial=None, uid=None, where=None, **kwargs)[source]

See orion.storage.base.BaseStorageProtocol.update_trial()

update_trials(experiment=None, uid=None, where=None, **kwargs)[source]

See orion.storage.base.BaseStorageProtocol.update_trials()

orion.storage.legacy.get_database()[source]

Return current database

This is a wrapper around the Database Singleton object to provide better error message when it is used without being initialized.

Raises
RuntimeError

If the underlying database was not initialized prior to calling this function

Notes

To initialize the underlying database you must first call Database(…) with the appropriate arguments for the chosen backend

orion.storage.legacy.setup_database(config=None)[source]

Create the Database instance from a configuration.

Parameters
config: dict

Configuration for the database backend. If not defined, global configuration is used.