fix: Calculation of remaining days for vaccination goals was wrong
This commit is contained in:
parent
6c112de357
commit
d7ded70f1b
1 changed files with 3 additions and 4 deletions
7
plot.py
7
plot.py
|
@ -105,10 +105,10 @@ def calculate_vaccination_data(data):
|
||||||
|
|
||||||
def extrapolate(rate, to_be_vaccinated):
|
def extrapolate(rate, to_be_vaccinated):
|
||||||
days_extrapolated = int(np.ceil(to_be_vaccinated / rate))
|
days_extrapolated = int(np.ceil(to_be_vaccinated / rate))
|
||||||
extrapolated_dates = np.array([dates[0] + datetime.timedelta(days=i) for i in range(days_extrapolated)])
|
days_extrapolated_herd_immunity = int(np.ceil((einwohner_deutschland * 0.7 - total) / rate))
|
||||||
|
|
||||||
date_done = extrapolated_dates[-1]
|
date_done = today + datetime.timedelta(days_extrapolated)
|
||||||
date_herd_immunity = extrapolated_dates[int(np.ceil(days_extrapolated * herd_immunity))]
|
date_herd_immunity = today + datetime.timedelta(days_extrapolated_herd_immunity)
|
||||||
|
|
||||||
extrapolated_vaccinations = total + rate * range(-days_since_start_of_reporting, days_extrapolated - days_since_start_of_reporting)
|
extrapolated_vaccinations = total + rate * range(-days_since_start_of_reporting, days_extrapolated - days_since_start_of_reporting)
|
||||||
|
|
||||||
|
@ -116,7 +116,6 @@ def calculate_vaccination_data(data):
|
||||||
'rate': rate,
|
'rate': rate,
|
||||||
'rate_int': int(np.round(rate)),
|
'rate_int': int(np.round(rate)),
|
||||||
'days_extrapolated': days_extrapolated,
|
'days_extrapolated': days_extrapolated,
|
||||||
'dates': extrapolated_dates,
|
|
||||||
'date_done': date_done,
|
'date_done': date_done,
|
||||||
'date_done_str': date_done.strftime('%d. %B %Y'),
|
'date_done_str': date_done.strftime('%d. %B %Y'),
|
||||||
'date_herd_immunity': date_herd_immunity,
|
'date_herd_immunity': date_herd_immunity,
|
||||||
|
|
Loading…
Reference in a new issue