From 10026fc5c4203f7847219535986b8cb5895a0cfd Mon Sep 17 00:00:00 2001 From: joda9 Date: Tue, 16 Jul 2024 12:14:29 +0200 Subject: [PATCH 1/2] improve python3.11 compatibility --- .github/workflows/tests-coverage.yml | 11 +++++++---- edisgo/network/topology.py | 2 +- setup.py | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests-coverage.yml b/.github/workflows/tests-coverage.yml index 951972d4d..5468cf565 100644 --- a/.github/workflows/tests-coverage.yml +++ b/.github/workflows/tests-coverage.yml @@ -20,13 +20,16 @@ jobs: include: - name-suffix: "coverage" os: ubuntu-latest - python-version: 3.8 + python-version: 3.9 - name-suffix: "basic" os: ubuntu-latest - python-version: 3.9 + python-version: 3.10 + - name-suffix: "basic" + os: ubuntu-latest + python-version: 3.11 - name-suffix: "basic" os: windows-latest - python-version: 3.8 + python-version: 3.9 steps: - name: Checkout repo @@ -71,7 +74,7 @@ jobs: python -m pytest --runslow --disable-warnings --color=yes -v - name: Run tests, coverage and send to coveralls - if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'coverage' + if: runner.os == 'Linux' && matrix.python-version == 3.9 && matrix.name-suffix == 'coverage' run: | pip install pytest pytest-notebook coveralls coverage run --source=edisgo -m pytest --runslow --runonlinux --disable-warnings --color=yes -v diff --git a/edisgo/network/topology.py b/edisgo/network/topology.py index f411bf312..2462314f0 100755 --- a/edisgo/network/topology.py +++ b/edisgo/network/topology.py @@ -2123,7 +2123,7 @@ def _choose_random_substation_id(): """ if comp_type == "generator": - random.seed(a=comp_data["generator_id"]) + random.seed(a=int(comp_data["generator_id"])) elif comp_type == "storage_unit": random.seed(a=len(self.storage_units_df)) else: diff --git a/setup.py b/setup.py index 0d83f01f4..93acf2c42 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ def read(fname): "pypsa", "pyyaml", "saio", - "scikit-learn <= 1.1.1", + "scikit-learn < 1.3.0", "shapely >= 1.7.0", "sqlalchemy < 1.4.0", "sshtunnel", From 27ed75bf065fd2129b86df4837628a3e33fb6a2a Mon Sep 17 00:00:00 2001 From: joda9 Date: Tue, 16 Jul 2024 12:16:26 +0200 Subject: [PATCH 2/2] improve python3.11 compatibility --- .github/workflows/tests-coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests-coverage.yml b/.github/workflows/tests-coverage.yml index 5468cf565..6bcc81f6d 100644 --- a/.github/workflows/tests-coverage.yml +++ b/.github/workflows/tests-coverage.yml @@ -23,7 +23,7 @@ jobs: python-version: 3.9 - name-suffix: "basic" os: ubuntu-latest - python-version: 3.10 + python-version: "3.10" - name-suffix: "basic" os: ubuntu-latest python-version: 3.11