Prev 
Next 
Index-> 
contents 
reference 
index 
search 
external 
 
 
Up-> 
dismod_at 
database 
input 
mulcov_table 
mulcov_table.py 
 
 
 
 
 
 
mulcov_table.py 
 
This is dismod_at-20221105 documentation:  Here is a link to its
current documentation mulcov_table: Example and Test def mulcov_table ()  : 
   import import import # =  'example.db' 
   new            =  True
   connection     =  dismod_at. create_connection ( file_name,  new) 
   cursor         =  connection. cursor () 
   # # create a mulcov table =  collections. OrderedDict (  [ 
      ( 'mulcov_type' ,   'text'     ), 
      ( 'rate_id' ,       'integer'  ), 
      ( 'integrand_id' ,  'integer'  ), 
      ( 'covariate_id' ,  'integer'  ), 
      ( 'smooth_id' ,     'integer'  ) 
   ]  ) 
   col_name =  list ( col_name2type. keys ()) 
   col_type =  list ( col_name2type. values ()) 
   row_list =  [  [ 
      'meas_value' ,  # muitiplier_type ,         # rate_id is null becasue measurement covariate 2 ,            # integrand_id 1 ,            # covariate_id 2             # smooth_id ],[ 
      'rate_value' ,   # muitiplier_type 1 ,             # rate_id ,          # integrand_id is null because a rate covariate 2 ,             # covariate_id 2              # smooth_id ]  ] 
   tbl_name =  'mulcov' 
   dismod_at. create_table ( connection,  tbl_name,  col_name,  col_type,  row_list) 
   # ---------------------------------------------------------------------- # include primary key in test =  [  tbl_name +  '_id'  ]  +  col_name
   check_list =  list () 
   for in range (  len ( row_list)  )  : 
      check_list. append (  [ i]  +  row_list[ i]  ) 
   # =  dismod_at. get_row_list ( connection,  tbl_name,  check_name) 
   assert ==  check_list
   # ---------------------------------------------------------------------- . close () 
   print ( 'mulcov_table: OK' )