From d0bb7f6200bc9d8461352cf38274f4d3ca5bf5f3 Mon Sep 17 00:00:00 2001 From: joda9 <66819219+joda9@users.noreply.github.com> Date: Wed, 17 Jul 2024 17:39:27 +0200 Subject: [PATCH] Feature/compatibility python 3.11 (#408) * improve python3.11 compatibility --- .github/workflows/tests-coverage.yml | 3 +++ eDisGo_env.yml | 2 +- eDisGo_env_dev.yml | 2 +- edisgo/network/topology.py | 2 +- rtd_requirements.txt | 2 +- setup.py | 2 +- 6 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests-coverage.yml b/.github/workflows/tests-coverage.yml index 0005070a1..6bcc81f6d 100644 --- a/.github/workflows/tests-coverage.yml +++ b/.github/workflows/tests-coverage.yml @@ -24,6 +24,9 @@ jobs: - name-suffix: "basic" os: ubuntu-latest python-version: "3.10" + - name-suffix: "basic" + os: ubuntu-latest + python-version: 3.11 - name-suffix: "basic" os: windows-latest python-version: 3.9 diff --git a/eDisGo_env.yml b/eDisGo_env.yml index 7e9a6ef7a..c9f4e6239 100644 --- a/eDisGo_env.yml +++ b/eDisGo_env.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python >= 3.9, < 3.11 + - python >= 3.9, <= 3.11 - pip - pandas >= 1.4, < 2.2.0 - conda-forge::fiona diff --git a/eDisGo_env_dev.yml b/eDisGo_env_dev.yml index 3cbea7d30..859e39546 100644 --- a/eDisGo_env_dev.yml +++ b/eDisGo_env_dev.yml @@ -3,7 +3,7 @@ channels: - conda-forge - defaults dependencies: - - python >= 3.9, < 3.11 + - python >= 3.9, <= 3.11 - pip - pandas >= 1.4, < 2.2.0 - conda-forge::fiona 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/rtd_requirements.txt b/rtd_requirements.txt index c9e102ded..3900ea862 100644 --- a/rtd_requirements.txt +++ b/rtd_requirements.txt @@ -13,7 +13,7 @@ pyproj >= 3.0.0 pypsa == 0.26.2 pyyaml saio -scikit-learn +scikit-learn < 1.3.0 sphinx sphinx_rtd_theme >=0.5.2 sphinx-autodoc-typehints diff --git a/setup.py b/setup.py index 5b67f566a..f04a4b97c 100644 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ def read(fname): "pypsa == 0.26.2", "pyyaml", "saio", - "scikit-learn <= 1.1.1", + "scikit-learn < 1.3.0", "shapely >= 1.7.0", "sqlalchemy < 1.4.0", "sshtunnel",