From 8c0eb437036a7a3c23639592c23839a12f34df4b Mon Sep 17 00:00:00 2001 From: dachrisch Date: Wed, 24 Jan 2024 00:25:19 +0100 Subject: [PATCH 1/3] update project and test dependencies and updated dataframe append and index functionality --- gamedays/service/model_wrapper.py | 5 +++-- league_table/service/league_table.py | 2 +- requirements.txt | 24 ++++++++++++------------ test_requirements.txt | 10 +++++----- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/gamedays/service/model_wrapper.py b/gamedays/service/model_wrapper.py index dff4c21f..fc755053 100644 --- a/gamedays/service/model_wrapper.py +++ b/gamedays/service/model_wrapper.py @@ -151,7 +151,8 @@ def _get_table(self): def get_qualify_team_by(self, place, standing): qualify_round = self._get_table() - return qualify_round.groupby(STANDING).nth(place - 1).loc[standing][TEAM_NAME] + nth_standing = qualify_round.groupby(STANDING).nth(place - 1) + return nth_standing[nth_standing[STANDING] == standing][TEAM_NAME].iloc[0] def get_team_by_points(self, place, standing, points): teams = self._get_teams_by(standing, points) @@ -168,7 +169,7 @@ def _has_standing(self, check): def is_finished(self, check): if self._has_standing(check): return len(self._gameinfo[(self._gameinfo[STANDING] == check) & (self._gameinfo[STATUS] == FINISHED)]) \ - == len(self._gameinfo[(self._gameinfo[STANDING] == check)]) + == len(self._gameinfo[(self._gameinfo[STANDING] == check)]) return len(self._gameinfo[(self._gameinfo[STAGE] == check) & (self._gameinfo[STATUS] == FINISHED)]) == len( self._gameinfo[(self._gameinfo[STAGE] == check)]) diff --git a/league_table/service/league_table.py b/league_table/service/league_table.py index de697839..5e2c7403 100644 --- a/league_table/service/league_table.py +++ b/league_table/service/league_table.py @@ -22,7 +22,7 @@ def get_standing(self, season=None, league=None): for gameday in all_gamedays: try: gmw = GamedayModelWrapper(gameday.pk) - all_standings = all_standings.append(gmw.get_final_table(), ignore_index=True) + all_standings = pd.concat([all_standings, gmw.get_final_table()], ignore_index=True) except Gameinfo.DoesNotExist: pass if all_standings.empty: diff --git a/requirements.txt b/requirements.txt index 027e3675..aff954ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,17 +1,17 @@ -Django==4.1.7 -django-crispy-forms==2.0 -crispy-bootstrap5==0.7 -numpy==1.24.2 -pandas==1.4.3 +Django==4.2.9 +django-crispy-forms==2.1 +crispy-bootstrap5==2023.10 +numpy==1.26.3 +pandas==2.2.0 django-pandas==0.6.6 djangorestframework==3.14.0 -Markdown==3.4.1 -django-cors-headers==3.14.0 -Pillow==9.5.0 +Markdown==3.5.2 +django-cors-headers==4.3.1 +Pillow==10.2.0 django-rest-knox==4.2.0 -django-debug-toolbar==3.5.0 -python-dotenv==1.0.0 -mysqlclient==2.1.1 +django-debug-toolbar==4.2.0 +python-dotenv==1.0.1 +mysqlclient==2.2.1 WebTest==3.0.0 -requests==2.28.2 +requests==2.31.0 diff --git a/test_requirements.txt b/test_requirements.txt index 72e0db36..3bfc3e70 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,5 +1,5 @@ -django-webtest==1.9.10 -pytest==7.2.2 -pytest-django==4.5.2 -pytest-cov==4.0.0 -factory-boy==3.2.1 +django-webtest==1.9.11 +pytest==7.4.4 +pytest-django==4.7.0 +pytest-cov==4.1.0 +factory-boy==3.3.0 From f597152add68f0d944cb0e3517a207764df6201a Mon Sep 17 00:00:00 2001 From: dachrisch Date: Wed, 24 Jan 2024 01:09:17 +0100 Subject: [PATCH 2/3] test multiple python versions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b7f9210..9d0f0c95 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.9] + python-version: [3.9,3.10,3.11,3.12] services: mysql: image: mysql:8.0 From 94c35b29eee3e2e49870f2d2635b94fe53ef3ffe Mon Sep 17 00:00:00 2001 From: dachrisch Date: Wed, 24 Jan 2024 01:10:54 +0100 Subject: [PATCH 3/3] Revert "test multiple python versions" This reverts commit f597152add68f0d944cb0e3517a207764df6201a. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d0f0c95..0b7f9210 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [3.9,3.10,3.11,3.12] + python-version: [3.9] services: mysql: image: mysql:8.0