Repository: e2nIEE/pandapipes

Issue:
Add support for Python 3.11
We should add Python 3.11 to the test pipeline and fix any issues that are related to deprecations.

Comments:

Patch:
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 783719d..2ba5825 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,6 +1,10 @@
 Change Log
 =============
 
+[upcoming release] - 2023-..-..
+-------------------------------
+- [ADDED] support Python 3.11 (now included in test pipeline)
+
 [0.8.3] - 2023-01-09
 -------------------------------
 - [FIXED] inconsistency between testpypi and pypi
diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py
index a106c23..9f9544a 100644
--- a/pandapipes/pipeflow.py
+++ b/pandapipes/pipeflow.py
@@ -83,8 +83,8 @@ def pipeflow(net, sol_vec=None, **kwargs):
         nodes_connected, branches_connected = check_connectivity(
             net, branch_pit, node_pit, check_heat=calculate_heat)
     else:
-        nodes_connected = node_pit[:, ACTIVE_ND].astype(np.bool)
-        branches_connected = branch_pit[:, ACTIVE_BR].astype(np.bool)
+        nodes_connected = node_pit[:, ACTIVE_ND].astype(bool)
+        branches_connected = branch_pit[:, ACTIVE_BR].astype(bool)
 
     reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected)
 


Test patch:
diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml
index 30dfe43..30ed69b 100644
--- a/.github/workflows/run_tests_develop.yml
+++ b/.github/workflows/run_tests_develop.yml
@@ -18,17 +18,18 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ['3.7', '3.8', '3.9', '3.10']
+        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install pytest python-igraph pytest-split numba
+          python -m pip install pytest python-igraph pytest-split
+          if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
           if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
           python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
           pip install .
@@ -58,9 +59,9 @@ jobs:
         python-version: ['3.8']
 
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
@@ -86,17 +87,18 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ['3.7', '3.8', '3.9', '3.10']
+        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph numba 
+          python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph
+          if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
           if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
           python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
           pip install .
@@ -113,9 +115,9 @@ jobs:
       matrix:
         python-version: [ '3.8' ]
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Check docs for Python ${{ matrix.python-version }}
diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml
index d360b78..3597d16 100644
--- a/.github/workflows/run_tests_master.yml
+++ b/.github/workflows/run_tests_master.yml
@@ -17,18 +17,19 @@ jobs:
     runs-on: ubuntu-latest
     strategy:
       matrix:
-        python-version: ['3.7', '3.8', '3.9', '3.10']
+        python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
 
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install pytest python-igraph pytest-split numba
+          python -m pip install pytest python-igraph pytest-split
+          if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
           if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
           python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower
           pip install .
@@ -56,15 +57,16 @@ jobs:
       matrix:
         python-version: ['3.7', '3.8', '3.9', '3.10']
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
         run: |
           python -m pip install --upgrade pip
-          python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph numba 
+          python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph
+          if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
           if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
           python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower
           pip install .
@@ -81,9 +83,9 @@ jobs:
       matrix:
         python-version: [ '3.8' ]
     steps:
-      - uses: actions/checkout@v2
+      - uses: actions/checkout@v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Check docs for Python ${{ matrix.python-version }}