diff --git a/Analyser.py b/Analyser.py index 05593ac..e54fecd 100644 --- a/Analyser.py +++ b/Analyser.py @@ -56,18 +56,18 @@ class Analyser: countryTimeData = countryTimeData.sort_values('dateRep') countryTimeData['cases'] = countryTimeData['cases'].cumsum() - print(countryTimeData.head()) + print(countryTimeData) countryTimeData.plot(ax=ax, x='dateRep', y='cases') plt.show(block=True) + filePath = ('graphs/casesGraph_' + country + '_' + datetime.now().strftime('%Y-%m-%d')) + plt.savefig(filePath) - # TODO Change return - return 'abc' + return filePath else: print('Unknown country') - # TODO Change return - return 'abc' + return '-1' def getCaseIncreaseGraph(self, country): """ @@ -90,13 +90,13 @@ class Analyser: countryTimeData.plot(ax=ax, x='dateRep', y='cases') plt.show(block=True) + filePath = ('graphs/casesIncreaseGraph_' + country + '_' + datetime.now().strftime('%Y-%m-%d')) + plt.savefig(filePath) - # TODO Change return - return 'abc' + return filePath else: print('Unknown country') - # TODO Change return - return 'abc' + return '-1' def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int: """ diff --git a/Main.py b/Main.py index 9f462a9..0a944b3 100644 --- a/Main.py +++ b/Main.py @@ -13,4 +13,5 @@ if __name__ == '__main__': country = input('What country do you want the graph for: ') analyser.getCasesGraph(country, start_date='2020-02-14') print(analyser.getTotalCases(country)) + analyser.getCaseIncreaseGraph(country) fetcher.updateStatsFile()