From 2a72a1d6fd338f5f0b80c8a2a9e468cf95dae67d Mon Sep 17 00:00:00 2001 From: Benedikt Bastin Date: Wed, 17 Feb 2021 12:15:07 +0100 Subject: [PATCH] fix: Prevent regenerating figure every time if nothing has changed --- plot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plot.py b/plot.py index 906462f..f2ac2be 100644 --- a/plot.py +++ b/plot.py @@ -635,9 +635,9 @@ def plot_vaccination_rate(): archive_plot_filename = '{}/vaccination_rate'.format(archive_folder) latest_plot_filename = '{}/vaccination_rate'.format(site_folder) - #if os.path.isfile(archive_plot_filename + '.pdf'): - #print('Plot {} already exists'.format(archive_plot_filename)) - #return + if os.path.isfile(archive_plot_filename + '.pdf'): + print('Plot {} already exists'.format(archive_plot_filename)) + return fig, ax = plt.subplots(1)