def test_google_output():
    # check the characteristics of the sciensano data loda function
    df = get_google_mobility_data(update=False)
    # set of variable names as output
    assert set(df.columns) == set([
        'retail_recreation', 'grocery', 'parks', 'transport', 'work',
        'residential'
    ])
    # index is a datetime index with daily frequency
    assert isinstance(df.index, pd.DatetimeIndex)
    assert df.index.freq == 'D'
Beispiel #2
0
job = 'FULL'

# ---------
# Load data
# ---------

# Contact matrices
initN, Nc_all = model_parameters.get_integrated_willem2012_interaction_matrices(
)
levels = initN.size
# Sciensano public data
df_sciensano = sciensano.get_sciensano_COVID19_data(update=False)
# Sciensano mortality data
df_sciensano_mortality = sciensano.get_mortality_data()
# Google Mobility data
df_google = mobility.get_google_mobility_data(update=False)
# Serological data
df_sero_herzog, df_sero_sciensano = sciensano.get_serological_data()

# ---------------------------------
# Time-dependant parameter function
# ---------------------------------


def compliance_func(t, states, param, l, effectivity):
    # Convert tau and l to dates
    l_days = pd.Timedelta(l, unit='D')
    # Measures
    start_measures = pd.to_datetime('2020-03-15')
    if t < start_measures:
        return param