aepsych.database¶
Submodules¶
aepsych.database.db module¶
- class aepsych.database.db.Database(db_path=None)[source]¶
Bases:
object
- perform_updates()[source]¶
Perform updates on known tables. SQLAlchemy doesn’t do alters so they’re done the old fashioned way.
- execute_sql_query(query, vals)[source]¶
Execute an arbitrary query written in sql.
- Parameters:
query (str) –
vals (Dict[str, str]) –
- get_master_record(experiment_id)[source]¶
Grab the list of master record for a specific experiment (master) id.
- get_strat_for(master_id, strat_id=- 1)[source]¶
Get a specific strat record for a specific master row.
- get_all_params_for(master_id)[source]¶
Get the parameters for all the iterations of a specific experiment.
- get_param_for(master_id, iteration_id)[source]¶
Get the parameters for a specific iteration of a specific experiment.
- get_all_outcomes_for(master_id)[source]¶
Get the outcomes for all the iterations of a specific experiment.
- get_outcome_for(master_id, iteration_id)[source]¶
Get the outcomes for a specific iteration of a specific experiment.
aepsych.database.tables module¶
- class aepsych.database.tables.Base(**kwargs)¶
Bases:
object
The base class of the class hierarchy.
When called, it accepts no arguments and returns a new featureless instance that has no instance attributes and cannot be given any.
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.
- metadata = MetaData()¶
- registry = <sqlalchemy.orm.decl_api.registry object>¶
- class aepsych.database.tables.DBMasterTable(**kwargs)[source]¶
Bases:
Base
Master table to keep track of all experiments and unique keys associated with the experiment
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.
- unique_id¶
- experiment_name¶
- experiment_description¶
- experiment_id¶
- participant_id¶
- extra_metadata¶
- children_replay¶
- children_strat¶
- children_config¶
- children_raw¶
- class aepsych.database.tables.DbReplayTable(**kwargs)[source]¶
Bases:
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.
- use_extra_info = False¶
- unique_id¶
- timestamp¶
- message_type¶
- message_contents¶
- extra_info¶
- master_table_id¶
- parent¶
- class aepsych.database.tables.DbStratTable(**kwargs)[source]¶
Bases:
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.
- unique_id¶
- timestamp¶
- strat¶
- master_table_id¶
- parent¶
- class aepsych.database.tables.DbConfigTable(**kwargs)[source]¶
Bases:
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.
- unique_id¶
- timestamp¶
- config¶
- master_table_id¶
- parent¶
- class aepsych.database.tables.DbRawTable(**kwargs)[source]¶
Bases:
Base
Fact table to store the raw data of each iteration of an experiment.
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.
- unique_id¶
- timestamp¶
- model_data¶
- master_table_id¶
- parent¶
- children_param¶
- children_outcome¶
- class aepsych.database.tables.DbParamTable(**kwargs)[source]¶
Bases:
Base
Dimension table to store the parameters of each iteration of an experiment. Supports multiple parameters per iteration, and multiple stimuli per parameter.
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.
- unique_id¶
- param_name¶
- param_value¶
- iteration_id¶
- parent¶
- class aepsych.database.tables.DbOutcomeTable(**kwargs)[source]¶
Bases:
Base
Dimension table to store the outcomes of each iteration of an experiment. Supports multiple outcomes per iteration.
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.
- unique_id¶
- outcome_name¶
- outcome_value¶
- iteration_id¶
- parent¶