X-Git-Url: https://git.njae.me.uk/?p=covid19.git;a=blobdiff_plain;f=publish.py;h=d60a7ef7e4d7220327317d4faeec6d0a8a9f16bd;hp=8dd4b0d4da946baad0372de1495afa5ff3add313;hb=4104f54bfd2a8f5094704f1f78f8abf44dae0534;hpb=56d432e0c16154f702bafe32e42286784bf3c578 diff --git a/publish.py b/publish.py index 8dd4b0d..d60a7ef 100644 --- a/publish.py +++ b/publish.py @@ -52,7 +52,9 @@ thirty_days_ago = last_uk_date - datetime.timedelta(days=30) # %% -total_uk_deaths = singleton_sql_value(engine, 'select sum(new_deaths) from uk_data') +# total_uk_deaths = singleton_sql_value(engine, 'select (cum_deaths) from uk_data') +total_uk_deaths = singleton_sql_value(engine, + 'select cum_deaths from uk_data where cum_deaths > 0 order by date desc limit 1') deaths_in_past_month = singleton_sql_value(engine, f"select sum(new_deaths) from uk_data where date > '{thirty_days_ago.isoformat()}'") cases_in_past_month = singleton_sql_value(engine, f"select sum(new_cases) from uk_data where date > '{thirty_days_ago.isoformat()}'") total_uk_deaths, deaths_in_past_month, cases_in_past_month @@ -132,7 +134,7 @@ with open('covid_summary.md', 'a') as f: f.write('\n') f.write('![Cases and deaths in last 60 days](cases_and_deaths_last_60_days.png)\n') f.write('\n') - f.write('![Deaths compared to past five years](deaths-radar-2021.png)\n') + f.write('![Deaths compared to past five years](deaths_radar_2021.png)\n') f.write('\n') # %%