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.
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:
sqlalchemy.orm.decl_api.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¶
- children_replay¶
- children_strat¶
- children_config¶
@classmethod def from_sqlite(cls, row):
this = DBMasterTable() this.unique_id = row[“unique_id”] this.experiment_name = row[“experiment_name”] this.experiment_description = row[“experiment_description”] this.experiment_id = row[“experiment_id”] return this
- class aepsych.database.tables.DbReplayTable(**kwargs)[source]¶
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.
- 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:
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.
- unique_id¶
- timestamp¶
- strat¶
- master_table_id¶
- parent¶
- class aepsych.database.tables.DbConfigTable(**kwargs)[source]¶
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.
- unique_id¶
- timestamp¶
- config¶
- master_table_id¶
- parent¶