feijoa.storages.rdb package#

Submodules#

feijoa.storages.rdb.models module#

SQLAlchemy models module.

class feijoa.storages.rdb.models.ExperimentModel(**kwargs)#

Bases: sqlalchemy.orm.decl_api.Base

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

create_timestamp#
finish_timestamp#
hash#
id#
job#
job_id#
metadata = MetaData()#
metrics#
objective_result#
params#
registry = <sqlalchemy.orm.decl_api.registry object>#
requestor#
state#
class feijoa.storages.rdb.models.JobModel(**kwargs)#

Bases: sqlalchemy.orm.decl_api.Base

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

id#
last_optimizer#
metadata = MetaData()#
name#
registry = <sqlalchemy.orm.decl_api.registry object>#
search_space#
search_space_id#
class feijoa.storages.rdb.models.ParameterModel(**kwargs)#

Bases: sqlalchemy.orm.decl_api.Base

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

id#
kind#
meta#
metadata = MetaData()#
name#
registry = <sqlalchemy.orm.decl_api.registry object>#
search_space#
search_space_id#
class feijoa.storages.rdb.models.SearchSpaceModel(**kwargs)#

Bases: sqlalchemy.orm.decl_api.Base

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

id#
metadata = MetaData()#
registry = <sqlalchemy.orm.decl_api.registry object>#

feijoa.storages.rdb.storage module#

RDB storage uses SQLAlchemy module.

class feijoa.storages.rdb.storage.RDBStorage(url)#

Bases: feijoa.storages.storage.Storage

Relational Database Storage.

Uses SQLAlchemy framework.

Raises

AnyError – If anything bad happens.

best_experiment(job)#

Get best experiment from job.

Parameters

job (Job) – Job instance.

Raises

AnyError – If anything bad happens.

Return type

Optional[feijoa.models.experiment.Experiment]

get_experiment(job_id, experiment_id)#

Get experiment from job.

Parameters
  • job_id (int) – Job index.

  • experiment_id (int) – Experiment index.

Raises

AnyError – If anything bad happens.

get_experiments_by_job_id(job_id)#

Get experiments from job

Parameters

job_id – Index of job in storage.

Raises

AnyError – If anything bad happens.

Return type

List[feijoa.models.experiment.Experiment]

get_experiments_count(job_id)#

Get experiments count in specified job.

Parameters

job_id (int) – Job id.

Raises

AnyError – If anything bad happens.

Return type

int

get_job_id_by_name(name)#

Get job by id in storage.

Parameters

name (str) – Name of job.

Raises

AnyError – If anything bad happens.

Return type

Optional[int]

get_optimizer_name_by_job_id(job_id)#

Get optimizer name by id in storage.

Parameters

job_id (int) – Job index.

Raises

AnyError – If anything bad happens.

Return type

Optional[str]

get_search_space_by_job_id(job_id)#

Get search space from existed job.

Parameters

job_id (int) – Job index.

Raises

AnyError – If anything bad happens.

insert_experiment(experiment)#

Insert experiment into storage.

Parameters

experiment (Experiment) – Experiment instance to insert.

Raises

AnyError – If anything bad happens.

insert_job(job)#

Insert job into storage.

Parameters

job (Job) – Job instance.

Raises

AnyError – If anything bad happens.

is_job_name_exists(name)#

Find job in storage.

Parameters

name (str) – Job name.

Raises

AnyError – If anything bad happens.

property jobs#

Pick up jobs from storage.

property jobs_count#

Get jobs count from storage.

top_experiments(job_id, n)#

Get top experiments from job. Experiments is sorted by objective values.

Parameters

job_id (int) – Job index.

Raises

AnyError – If anything bad happens.

Return type

List[feijoa.models.experiment.Experiment]

update_optimizer_name_by_job_id(job_id, name)#

Update optimizer name by id in storage.

Parameters
  • job_id (int) – Job index.

  • name (str) – New optimizer name.

Raises

AnyError – If anything bad happens.

property version#

Get version of database schema.

Module contents#