get_database_dir

View page source

Get Database Directory Corresponding To a Fit

Prototype

# at_cascade.get_database_dir
def get_database_dir(
    node_table                    ,
    split_reference_table         ,
    node_split_set          = None,
    root_node_id            = None,
    root_split_reference_id = None,
    fit_node_id             = None,
    fit_split_reference_id  = None,
) :
    assert type(node_table) == list
    assert type(split_reference_table) == list
    assert node_split_set == None or type(node_split_set) == set
    assert type(root_node_id) == int
    assert root_split_reference_id==None or type(root_split_reference_id)==int
    assert type(fit_node_id) == int
    assert fit_split_reference_id==None or type(fit_split_reference_id)==int
    #  ...
    assert type(database_dir) == str
    return database_dir

node_table

is the node_table for this cascade as a list'' of ``dict. It can’t be None.

split_reference_table

is the split_reference_table as a list of dict. It can’t be None. If the list has length zero, we say that the table is empty.

node_split_set

If split_reference_table is empty, this argument must be None. Otherwise it is a set of int containing the node_id values that appear in the node_spit table.

root_node_id

is the node_id for the root_node.

root_split_reference_id

If split_reference_table is empty, this argument must be None. Otherwise it is an int specifying the split_reference_id that the root node corresponds to.

fit_node_id

This argument is an int is the node_id for the fit_node.

fit_split_reference_id

If split_reference_table is empty, this argument must be None. Otherwise it is an int specifying the split_reference_id that the fit corresponds to.

database_dir

The return value is a str containing the directory, relative to the result_dir, where the database corresponding to the fit is (or will be) located. In other words, the fit database has the following path:

result_dir/ database_dir/dismod.db