diff --git a/Analyser.py b/Analyser.py index f295092..2868be1 100644 --- a/Analyser.py +++ b/Analyser.py @@ -54,12 +54,11 @@ class Analyser: def getTotalCases(self, country, date=datetime.now().strftime('%Y-%m-%d')) -> int: """ Get the current total cases for the entered country - :param country: The country you want the case number for - :param date: The date for which the case number is returned. Standard is the current date. + :param country: The country you want the case number for. Access available countries via getAvailableCountries() + :param date: The date for which the case number is returned. Standard is the current date. Format YYYY-MM-DD :return: The case number """ countryData = self.df[self.df['countriesAndTerritories'].isin([country])] - finalData = pd.DataFrame - countryData.filter(datetime.strptime(country)) - print(finalData) - return countryData['cases'].sum() + mask = (countryData['dateRep'] <= date) + countryTimeData = countryData.loc[mask] + return countryTimeData['cases'].sum() diff --git a/Main.py b/Main.py index fdc32e1..e7ac1f3 100644 --- a/Main.py +++ b/Main.py @@ -10,4 +10,4 @@ import Analyser as ana if __name__ == '__main__': analyser = ana.Analyser() country = input('What country do you want the graph for: ') - analyser.getTotalCases(country, '2020-03-27') + print(analyser.getTotalCases(country, '2020-03-28')) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index 29957a5..b7ed91f 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -11,13 +11,15 @@ pipelines: - step: deployment: production script: - - echo "Running deployment to production" - - pipe: atlassian/sftp-deploy:0.5.2 - variables: - USER: $SFTP_Username - SERVER: $SFTP_Host_Path - REMOTE_PATH: $SFTP_Production_Path - PASSWORD: $SFTP_Password + - echo "Skipping Deployment as the website implementation is currently to complex" +# - echo "Running deployment to production" +# - pipe: atlassian/sftp-deploy:0.5.2 +# variables: +# USER: $SFTP_Username +# SERVER: $SFTP_Host_Path +# REMOTE_PATH: $SFTP_Production_Path +# PASSWORD: $SFTP_Password + # feature: # - step: # deployment: test