From 55147eeed57ddb0496d7b0b4f21adcf6037cf8a1 Mon Sep 17 00:00:00 2001 From: Benedikt Bastin Date: Fri, 15 Jan 2021 01:26:02 +0100 Subject: [PATCH] feat: Subfolders for data files and plots --- Plots/.gitignore | 3 +++ Quellen/.gitignore | 3 +++ plot.py | 7 +++++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 Plots/.gitignore create mode 100644 Quellen/.gitignore diff --git a/Plots/.gitignore b/Plots/.gitignore new file mode 100644 index 0000000..a5baada --- /dev/null +++ b/Plots/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore + diff --git a/Quellen/.gitignore b/Quellen/.gitignore new file mode 100644 index 0000000..a5baada --- /dev/null +++ b/Quellen/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore + diff --git a/plot.py b/plot.py index 7b7686a..b5a9136 100644 --- a/plot.py +++ b/plot.py @@ -9,6 +9,9 @@ import datetime import re import requests as req +sources_folder = 'Quellen' +plots_folder = 'Plots' + einwohner_deutschland = 83190556 @@ -23,7 +26,7 @@ plt.rcParams["figure.figsize"] = [11.69, 8.27] # Download -filename = '{}_Impfquotenmonitoring.xlsx'.format(filename_now) +filename = '{}/{}_Impfquotenmonitoring.xlsx'.format(sources_folder, filename_now) r = req.get('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile') @@ -102,7 +105,7 @@ def plot_extrapolation_portion(percentage): ax2.set_ylabel('Kumulierte Impfungen') - plt.savefig('{}_extrapolated_to_{}_percent.pdf'.format(filename_stand, print_percentage)) + plt.savefig('{}/{}_extrapolated_to_{}_percent.pdf'.format(plots_folder, filename_stand, print_percentage)) plt.close()