This class represents one trial's worth of data for the reliability2 app.
More...
|
| def | _update_timestamp |
| | Performs a db update of a timestamp column, setting it to the date/time at the point this method is executed. More...
|
| |
This class represents one trial's worth of data for the reliability2 app.
Definition at line 11 of file check2.py.
| def data_structs.check2.Check2.__init__ |
( |
|
self, |
|
|
|
csv_filename, |
|
|
|
wav_foldername, |
|
|
|
activities, |
|
|
|
environments, |
|
|
|
blocks_per_activity, |
|
|
|
completed = None, |
|
|
|
created = None, |
|
|
|
modified = None, |
|
|
|
test2s = [], |
|
|
|
test2_index = 0, |
|
|
|
db_id = None |
|
) |
| |
Constructor.
- Parameters
-
| self | |
| csv_filename | (string) path to the csv file that will be used - blocks will be picked from this file and presented to the user (see parsers.csv_parser for a list of the columns that must be present. In addition to those, we also need "environment" and "activity" columns.) |
| wav_foldername | (string) path to a folder containing all the wav files that correspond to blocks that could be picked from the csv file |
| activities | (list) list of strings, one for each activity that will be run (within each environment). E.g. ['mealtime', 'playtime', ...] |
| environments | (list) list of strings, one for each environment that will be run. E.g ['home', 'daycare centre', ...] |
| blocks_per_activity | (int) the number of 5 minute blocks that will be picked for each activity (blocks will be picked for each activity, separately for each environment) |
| completed | (string=None) timestamp string representing the date/time when this check2 was completed. Is None if it has not yet been completed by the user. |
| created | (string=None) timestamp string representing the date/time when this check2 was created by the user. This is assigned by the database in the insert() method. So if the check2 is not in the DB, this may be None. |
| modified | (string=None) timestamp string representing the last time this check2 was modified by the user. For example, the last time the progress in the application was saved when working on this check. This is assigned by the DB. It will be None if the check2 has never been saved in an incomplete trial. It is possible for check2s to be completed, but not modified (if the user goes through the whole trial without saving/quitting). |
| test2s | (list=[]) a list of all the Test2 data structure objects for this trial. Each Test2 object represents (and contains all the data for) the input for a single block that the user has completed. |
| test2_index | (int=0) the index we are currently sitting at in the test2 list (previous param). This information is used to restore the state of the app to where the user left off, when a saved check2 is loaded back up. |
| db_id | (int=None) the primary key value of this check2 in the check2 database table. In general, code should not set this. It's set from db_select(), and upon db_insert(). Will be None if object is not yet in the DB. |
Definition at line 38 of file check2.py.
| def data_structs.check2.Check2._update_timestamp |
( |
|
self, |
|
|
|
db, |
|
|
|
col |
|
) |
| |
|
private |
Performs a db update of a timestamp column, setting it to the date/time at the point this method is executed.
If this instance is not already in the db, an exception is raised.
- Parameters
-
| self | |
| db | (BLLDatabase) a database object |
| col | (string) name of the timestamp column from the checks2 database table to update. |
Definition at line 85 of file check2.py.
| def data_structs.check2.Check2.db_delete |
( |
|
self, |
|
|
|
db |
|
) |
| |
See superclass description.
Definition at line 117 of file check2.py.
| def data_structs.check2.Check2.db_insert |
( |
|
self, |
|
|
|
db |
|
) |
| |
See superclass description.
If any of this instance's test2 objects are not yet in the DB, this method will insert them as well.
Definition at line 93 of file check2.py.
| def data_structs.check2.Check2.db_select |
( |
|
db, |
|
|
|
ids = [] |
|
) |
| |
|
static |
See superclass description.
Definition at line 129 of file check2.py.
| def data_structs.check2.Check2.update_completed |
( |
|
self, |
|
|
|
db |
|
) |
| |
Overwrites the completed timestamp (both in the DB and the object attribute for this instance) with the current date/time.
- Parameters
-
| self | |
| db | (BLLDatabase) a database object |
Definition at line 57 of file check2.py.
| def data_structs.check2.Check2.update_modified |
( |
|
self, |
|
|
|
db |
|
) |
| |
Overwrites the modified timestamp (both in the DB and the object attribute for this instance) with the current date/time.
- Parameters
-
| self | |
| db | (BLLDatabase) a database object |
Definition at line 66 of file check2.py.
| def data_structs.check2.Check2.update_test2_index |
( |
|
self, |
|
|
|
db |
|
) |
| |
Updates the test2_index value in the database.
It is set to the current value for this instance. If the instance is not already in the dd, an exception is raised.
- Parameters
-
| self | |
| db | (BLLDatabase) a database object |
Definition at line 75 of file check2.py.
| data_structs.check2.Check2.activities |
| data_structs.check2.Check2.blocks_per_activity |
| data_structs.check2.Check2.completed |
| data_structs.check2.Check2.created |
| data_structs.check2.Check2.csv_filename |
| data_structs.check2.Check2.db_id |
| data_structs.check2.Check2.environments |
| data_structs.check2.Check2.modified |
| data_structs.check2.Check2.test2_index |
| data_structs.check2.Check2.test2s |
| data_structs.check2.Check2.wav_foldername |
The documentation for this class was generated from the following file:
- C:/Users/Wayne/Documents/baby-lab/bll_app/data_structs/check2.py