Skip to content

Commit

Permalink
drop Python 3.7 and add 3.11 (#1842)
Browse files Browse the repository at this point in the history
* drop 3.7 and add 3.11

* Update github_test_action.yml

update to the latest versions of the setuppython and checkout actions

* Update github_test_action.yml

Install numba only for Python Versions < 3.11

* remove deprecated np.float, np.int

use built-in float, int instead

* changelog

* increase timeout for jupyter tests to 15 min per cell (due to pandamodels tests requiring more time to run sometimes)

---------

Co-authored-by: jkisse <jolando.kisse@uni-kassel.de>
  • Loading branch information
rbolgaryn and jkisse committed Feb 2, 2023
1 parent e9a765c commit d23e92a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 26 deletions.
49 changes: 25 additions & 24 deletions .github/workflows/github_test_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
group: [ 1, 2 ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
#- uses: julia-actions/setup-julia@v1.5
- 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
Expand All @@ -35,12 +35,12 @@ jobs:
python -m pip install pytest pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .["all"]
if ${{ matrix.python-version == '3.7' }}; then python -m pip install pypower; fi
if ${{ matrix.python-version != '3.7' }}; then python -m pip install numba; fi
if ${{ matrix.python-version == '3.7' }}; then python -m pip install lightsim2grid; fi
if ${{ matrix.python-version == '3.8' }}; then python -m pip install pypower; fi
if ${{ matrix.python-version != '3.8' && matrix.python-version != '3.11' }}; then python -m pip install numba; fi
if ${{ matrix.python-version == '3.8' }}; then python -m pip install lightsim2grid; fi
if ${{ matrix.python-version == '3.10' }}; then python -m pip install lightsim2grid; fi
- name: Install Julia
if: ${{ matrix.python-version == '3.7' }}
if: ${{ matrix.python-version == '3.8' }}
run: |
./.install_julia.sh 1.5
pip install julia
Expand All @@ -49,16 +49,16 @@ jobs:
run: |
pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.8' }}
if: ${{ matrix.python-version != '3.9' }}
run: |
pytest --splits 2 --group ${{ matrix.group }}
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.9' }}
run: |
pip install pytest-cov
pytest --cov=./ --cov-report=xml --splits 2 --group ${{ matrix.group }}
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.8' }}
if: ${{ matrix.python-version == '3.9' }}
uses: codecov/codecov-action@v1
with:
verbose: true
Expand All @@ -68,12 +68,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['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
Expand All @@ -83,9 +83,10 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install .
pip install matplotlib
if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi
- name: Install pandapipes and simbench
run: |
python -m pip install git+https://github.com/e2nIEE/pandapipes@develop#egg=pandapipes numba
python -m pip install git+https://github.com/e2nIEE/pandapipes@develop#egg=pandapipes
python -m pip install git+https://github.com/e2nIEE/simbench@develop#egg=simbench
- name: List of installed packages
run: |
Expand All @@ -107,9 +108,9 @@ jobs:
python-version: ['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
Expand Down Expand Up @@ -137,12 +138,12 @@ jobs:
runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ['3.7', '3.8', '3.9', '3.10']
# python-version: ['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: '3.10'
- name: Install dependencies
Expand Down Expand Up @@ -171,9 +172,9 @@ jobs:
matrix:
python-version: ['3.9']
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
Expand All @@ -190,17 +191,17 @@ jobs:
pip list
- name: Test with pytest
run: |
pytest --nbmake -n=auto "./tutorials"
pytest --nbmake -n=auto --nbmake-timeout=900 "./tutorials"
docs_check:
runs-on: ubuntu-latest
strategy:
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 }}
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Change Log
- [FIXED] create.py: if optional arguments are None or nan, the optional columns will not be added
- [FIXED] add tap_dependent_impedance attributes to trafo3w instead of trafo, in create.create_transformer3w and create.create_transformer3w_from_parameters
- [ADDED] add TDPF parameters as optional parameters for create line functions in create.py
- [CHANGED] remove support for Python 3.7 and add Python 3.11

[2.11.1] - 2023-01-02
-------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pandapower/grid_equivalents/rei_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def _create_net_zpbn(net, boundary_buses, all_internal_buses, all_external_buses
value_types = net[elm][c][elm_org.bus.isin(all_external_buses)].apply(type).unique()
if len(value_types) > 1:
other_cols_mixed |= {c}
elif value_types[0] in (np.float, np.int):
elif value_types[0] in (float, int):
other_cols_number |= {c}
elif value_types[0] == bool:
other_cols_bool |= {c}
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

with open('.github/workflows/github_test_action.yml', 'rb') as f:
lines = f.read().decode('utf-8')
versions = set(re.findall('3.[7-9]', lines)) | set(re.findall('3.1[0-9]', lines))
versions = set(re.findall('3.[8-9]', lines)) | set(re.findall('3.1[0-9]', lines))
for version in sorted(versions):
classifiers.append('Programming Language :: Python :: %s' % version)

Expand Down

0 comments on commit d23e92a

Please sign in to comment.