get_var_id

View page source

Map Var Table Values to its Primary Key

Prototype

# at_cascade.get_var_id
def get_var_id(
    var_table          ,
    var_type           ,
    smooth_id    = None,
    age_id       = None,
    time_id      = None,
    node_id      = None,
    rate_id      = None,
    mulcov_id    = None,
    group_id     = None,
    subgroup_id  = None,
) :
    assert type(var_table) == list
    assert type(var_type)  == str
    # ...
    assert type(var_id) == int
    return var_id

var_table

This is a list of dict representation of the a dismod_at var table.

var_type

This is a str that specifies the type of variable for the corresponding row of the var table. It must have one of the values in the table below (and cannot be None).

Other Arguments

All of the arguments, other than var_type, are int values. Depending on the value of var_type only certain of the other arguments matter:

Other Arguments That Matter by Variable Type

var_type

Other Arguments

mulstd_value

smooth_id

mulstd_dage

smooth_id

mulstd_dtime

smooth_id

rate

age_id, time_id, node_id, rate_id

mulcov_rate_value

age_id, time_id, mulcov_id, group_id, subgroup_id

mulcov_meas_value

age_id, time_id, mulcov_id, group_id, subgroup_id

mulcov_meas_noise

age_id, time_id, mulcov_id, group_id