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

A saved collection of settings that can be used to generate stats from a TRS file (for the Reliability App). More...

Inheritance diagram for data_structs.check.Check:

Public Member Functions

def __init__
 Constructor. More...
 
def db_insert
 See superclass description. More...
 
def db_delete
 See superclass description. More...
 
def mark_as_completed
 Sets the 'completed' attribute (a timestamp in string form) of this Check to the current date/time. More...
 
def mark_last_run
 Updates the "last run" attribute/database column value. More...
 
def db_update_test_index
 Updates the test_index property/database column value. 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

 name
 
 created
 
 input_filename
 
 wav_filename
 
 num_segs
 
 default_context_padding
 
 tests
 
 test_index
 
 completed
 
 db_id
 
 filters
 
 pick_randomly
 
 last_run
 
- Public Attributes inherited from data_structs.base_objects.DBObject
 db_id
 

Private Member Functions

def _update_timestamp
 Updates a timestamp column in the DB, and in this object instance. More...
 

Detailed Description

A saved collection of settings that can be used to generate stats from a TRS file (for the Reliability App).

Definition at line 10 of file check.py.

Constructor & Destructor Documentation

def data_structs.check.Check.__init__ (   self,
  name,
  input_filename,
  wav_filename,
  num_segs,
  default_context_padding,
  tests,
  test_index,
  completed = None,
  created = None,
  db_id = None,
  filters = [],
  pick_randomly = False,
  last_run = None 
)

Constructor.

Parameters
self
name(string) user-defined name for this check (string) absolute path to the trs/csv file that this check will be run on (string) absolute path to the wav file that this check will use (int) integer representing the upper limit on the number of segs that can be picked (takes precidence over previous param when limit is exceeded). WIll be set to 0 if no limit is to be enforced.
default_context_padding(int) number of seconds to pad sound clip, on each side, when context is being used
completed(string=None) timestamp string representing the date/time of this check's first run. In general, code should not set this. It's set from db_select(). Will be None if this check has not yet been run.
db_id(int=None) Primary key value of this check in the Checks 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.
filters(list=[]) List of SegFilter objects to filter the segments from the trs file before picking the clips to test on.
pick_randomly(boolean=False) Set to True if user elected to randomly pick segments, False if they want continuous segments to be used.
last_run(string=None) String timestamp representing the last time this check was run. Set to None if it has never been run before.

Definition at line 36 of file check.py.

Member Function Documentation

def data_structs.check.Check._update_timestamp (   self,
  attr_name,
  db 
)
private

Updates a timestamp column in the DB, and in this object instance.

If the instance is not in the database, an exception is raised.

Parameters
self
attr_name(string) name of the instance attribute we will be updating - this name must match the name of the column in the DB checks table.
db(BLLDatabase) a database instance

Definition at line 146 of file check.py.

def data_structs.check.Check.db_delete (   self,
  db 
)

See superclass description.

Returns
(int) the number of rows that were soft deleted.

Definition at line 88 of file check.py.

def data_structs.check.Check.db_insert (   self,
  db 
)

See superclass description.

Definition at line 55 of file check.py.

def data_structs.check.Check.db_select (   db,
  ids = [] 
)
static

See superclass description.

Returns
(list) list of Check objects

Definition at line 108 of file check.py.

def data_structs.check.Check.db_update_test_index (   self,
  db 
)

Updates the test_index property/database column value.

This allows us to restore a saved check to the position where the user left off. If the instance is not in the database, an exception is raised.

Parameters
self
db(BLLDatabase) the DB handle object to use for the update operation

Definition at line 173 of file check.py.

def data_structs.check.Check.mark_as_completed (   self,
  db 
)

Sets the 'completed' attribute (a timestamp in string form) of this Check to the current date/time.

Parameters
self
db(BLLDatabase) the DB handle object to use for the update operation

Definition at line 161 of file check.py.

def data_structs.check.Check.mark_last_run (   self,
  db 
)

Updates the "last run" attribute/database column value.

Parameters
self
db(BLLDatabase) the DB handle object to use for the update operation

Definition at line 167 of file check.py.

Member Data Documentation

data_structs.check.Check.completed

Definition at line 48 of file check.py.

data_structs.check.Check.created

Definition at line 41 of file check.py.

data_structs.check.Check.db_id

Definition at line 49 of file check.py.

data_structs.check.Check.default_context_padding

Definition at line 45 of file check.py.

data_structs.check.Check.filters

Definition at line 50 of file check.py.

data_structs.check.Check.input_filename

Definition at line 42 of file check.py.

data_structs.check.Check.last_run

Definition at line 52 of file check.py.

data_structs.check.Check.name

Definition at line 40 of file check.py.

data_structs.check.Check.num_segs

Definition at line 44 of file check.py.

data_structs.check.Check.pick_randomly

Definition at line 51 of file check.py.

data_structs.check.Check.test_index

Definition at line 47 of file check.py.

data_structs.check.Check.tests

Definition at line 46 of file check.py.

data_structs.check.Check.wav_filename

Definition at line 43 of file check.py.


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