Interface

The base interface is DismodSQLite, and the input and output class has getters and setters for each of the tables (DismodIO, not documented here).

To use a DismodIO(DismodSQLite) interface, you can do

from cascade_at.dismod.api.dismod_io import DismodIO
file = 'my_database.db'
db = DismodIO(file)

# Tables are stored as attributes, e.g.
db.data
db.age
db.time
db.prior

# Tables can be set with
db.data = pd.DataFrame(...)
class cascade_at.dismod.api.dismod_sqlite.DismodSQLite(path)[source]

Bases: object

Initiates an SQLite reader from the path.

Parameters

path (Union[str, Path]) – A string or Path pointing to the DisMod database file.

create_tables(tables=None)[source]

Make all of the tables in the metadata.

update_table_columns(table_name, table)[source]

Updates the table columns with additional columns like “c_” which are comments and “x_” which are covariates.

read_table(table_name)[source]

Read a table from the database in engine specified.

write_table(table_name, table)[source]

Writes a table to the database in the engine specified.

Parameters
  • table_name (str) – the name of the table to write to

  • table (pd.DataFrame) – data frame to write

empty_table(table_name, extra_columns=None)[source]

Initializes an empty table for table_name.