feijoa.storages package#
Subpackages#
Submodules#
feijoa.storages.storage module#
- class feijoa.storages.storage.Storage#
Bases:
object- 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]
- abstract 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.
- abstract 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
- abstract 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
- abstract 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]
- abstract 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.
- Return type
- abstract 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.
- abstract is_job_name_exists(name)#
Find job in storage.
- Parameters
name (str) – Job name.
- Raises
AnyError – If anything bad happens.
- abstract 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
- abstract 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.
- abstract property version#
Get version of database schema.
feijoa.storages.tiny module#
TinyDB storage module.
- class feijoa.storages.tiny.TinyDBStorage(json_file)#
Bases:
feijoa.storages.storage.StorageTinyDB storage uses tinydb library.
- Parameters
json_file (str) –
- 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
- 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.
- Return type
- 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
- 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#
Storages module.