Customizing the app for a different country
These are the things that need to be changed for the app to work for another country:
NOTE: some of these could not be necessary, but since I was in a hurry I just changed all of the mentions to 'Slovenia'. I'll have to check (or, feel free to explore) if there's a subset of these modifications which works as well.
-
in 'VisualizationSlo/all_slo_new_layout.py':
- default_country = 'Slovenia';
- 2 occurrences in the text;
-
in 'Visualization/data_manipulation.py':
- def get_country_data(df, country='Slovenia')
-
in 'Visualization/app.py':
- default_country = 'Slovenia' if 'Slovenia' in default_countries else default_countries[0];
- 1 occurrence in text (def tab6():)
-
in 'Visualization/visualize_plan.py':
- def plot_all(path, country='Slovenia', infections_col='Infections', stringency_col='Stringency',
-
in 'Visualization/Phase2Framework/visualization_call.py':
- def generate_plans(weights, start_date, end_date, predictor=None, limits=None, country="Slovenia", region=""):
- def generate_plans_placeholder(weights, start_date, end_date, predictor=None, limits=None, country="Slovenia", region="", sleep=0):
- output_file = path+"/webpage_workspace/output_Slovenia__2021-03-08_2021-05-08_35972.csv" (ok, this is not really necessary, but let's be decent people here
😁 )
-
in 'Phase2Framework/visualization_call.py':
- def generate_plans(weights, start_date, end_date, predictor=None, limits=None, country="Slovenia", region=""):
- def generate_plans_placeholder(weights, start_date, end_date, predictor=None, limits=None, country="Slovenia", region="", sleep=0):
- output_file = path+"/webpage_workspace/output_Slovak_Republic__2021-03-08_2021-05-08_35972.csv" (as above)
-
in 'Visualization/globals.py':
- DEFAULT_FILENAME_SLO = 'example_Slovak_Republic.csv'
-
A file with the starting examples of that country needs to be created and added to the
Visualization/assets
folder
Edited by Carlo De Masi