geoffroychaussonnet / script_to_monitor_Covid19

Python scripts to monitor Covid-19
BSD 3-Clause "New" or "Revised" License
1 stars 1 forks source link

Create an `Area` class #8

Open jferard opened 4 years ago

jferard commented 4 years ago

The idea is to group name, quarantine date and subareas in one object:

ITALY = Area("Italy", '3/9/20') # subareas={} as default
EU = Area("EU", None, {ITALY, ...}) # no global quarantine date

And to write something like:

for area in [ITALY, FRANCE, SPAIN, US, ...]:
    plot_area(area, dataParam, displayParam, fitParam, ax) # instead of plot_country

And use area.name, quarantine_date, subareas in plot_area.

jferard commented 4 years ago

Maybe not a so good idea since we do not control the list of the countries. It would be better to use strings. But the idea to store the quarantine date with the country name (in a dict) is still interesting. And the idea to store subareas of superareas too.