Baby Language Lab Scripts
A collection of data processing tools.
 All Classes Namespaces Files Functions Variables Pages
data_structs.check2.Check2 Class Reference

This class represents one trial's worth of data for the reliability2 app. More...

Inheritance diagram for data_structs.check2.Check2:

Public Member Functions

def __init__
 Constructor. More...
 
def update_completed
 Overwrites the completed timestamp (both in the DB and the object attribute for this instance) with the current date/time. More...
 
def update_modified
 Overwrites the modified timestamp (both in the DB and the object attribute for this instance) with the current date/time. More...
 
def update_test2_index
 Updates the test2_index value in the database. More...
 
def db_insert
 See superclass description. More...
 
def db_delete
 See superclass description. More...
 
- Public Member Functions inherited from data_structs.base_objects.DBObject
def __init__
 Constructor. More...
 
def db_insert
 Performs operations needed to insert this object into the database. More...
 
def db_delete
 Performs operations needed to delete this object from the database. More...
 
- Public Member Functions inherited from data_structs.base_objects.BLLObject
def __str__
 Builds a nicely formatted string containing all attributes of this object (except those in omit_attr_names), for debugging purposes. More...
 

Static Public Member Functions

def db_select
 See superclass description. More...
 
- Static Public Member Functions inherited from data_structs.base_objects.DBObject
def db_select
 Selects objects of this type from the database. More...
 

Public Attributes

 csv_filename
 
 wav_foldername
 
 activities
 
 environments
 
 blocks_per_activity
 
 completed
 
 created
 
 modified
 
 test2s
 
 test2_index
 
 db_id
 
- Public Attributes inherited from data_structs.base_objects.DBObject
 db_id
 

Private Member Functions

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...
 

Detailed Description

This class represents one trial's worth of data for the reliability2 app.

Definition at line 11 of file check2.py.

Constructor & Destructor Documentation

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.

Member Function Documentation

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.

Member Data Documentation

data_structs.check2.Check2.activities

Definition at line 44 of file check2.py.

data_structs.check2.Check2.blocks_per_activity

Definition at line 46 of file check2.py.

data_structs.check2.Check2.completed

Definition at line 47 of file check2.py.

data_structs.check2.Check2.created

Definition at line 48 of file check2.py.

data_structs.check2.Check2.csv_filename

Definition at line 42 of file check2.py.

data_structs.check2.Check2.db_id

Definition at line 52 of file check2.py.

data_structs.check2.Check2.environments

Definition at line 45 of file check2.py.

data_structs.check2.Check2.modified

Definition at line 49 of file check2.py.

data_structs.check2.Check2.test2_index

Definition at line 51 of file check2.py.

data_structs.check2.Check2.test2s

Definition at line 50 of file check2.py.

data_structs.check2.Check2.wav_foldername

Definition at line 43 of file check2.py.


The documentation for this class was generated from the following file: