def test_custom_run(self): mr = cr.run_model( _model=CompartmentalModel.ID, _profile='custom', camp='Moria', load_from_cache=False, save_to_cache=False, is_save_plots=False, is_show_plots=False, is_save_report=False, overrides='{"numberOfIterations": 4, "nProcesses": 1}' ) actual_report_df = mr.get('report') expected_df = pd.read_csv(pu._path('../runner/tests', 'expected_report.csv')) pdt.assert_frame_equal(expected_df, actual_report_df, check_exact=False, check_less_precise=1)
def check(actual, expected): actual = actual.reset_index() # actual.to_csv(expected, index=False) expected_df = pd.read_csv(pu._path('../runner/tests', expected)) pdt.assert_frame_equal(expected_df, actual)
import dash import dash_core_components as dcc import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output, State from dash.exceptions import PreventUpdate from ai4good.webapp.apps import dash_app, facade, model_runner, _redis import ai4good.webapp.run_model_page as run_model_page from ai4good.webapp.model_runner import InputParameterCache import ai4good.utils.path_utils as pu import os text_disclaimer = 'Disclaimer: This tool is for informational and research purposes only and should not be considered as a medical predictor. The input parameters you have provided is a determining factor in the simulation results. ' base = '../../fs' path_country = pu._path(f'{base}/params/cm_model/contact_matrices/', '') country_raw = [ f for f in os.listdir(path_country) if os.path.isfile(os.path.join(path_country, f)) ] country_clean = sorted([f.split('.')[0] for f in country_raw]) layout = html.Div([ run_model_page.nav_bar(), html.Div([ dbc.Container([ dbc.Row(dbc.Col(dbc.Card([ html.H6(text_disclaimer, className='card-text'), html.Div(id='input-page-1-disclaimer') ], body=True),