Skip to content

Commit

Permalink
Merge branch 'develop' into fix/from_node_t_lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohmeier authored Aug 27, 2024
2 parents 691295f + aac49d6 commit 34d0bac
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
needs: upload
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- name: Set up Python ${{ matrix.python-version }}
Expand Down
52 changes: 25 additions & 27 deletions .github/workflows/run_tests_develop.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# A coverage report will be created for the Python 3.8 version
# A coverage report will be created for the Python 3.9 version
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

# pandapipes-develop branch is designed to work with pandapower-master branch, but checks the ability to
Expand All @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -30,24 +30,27 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.9' }}
if: ${{ matrix.python-version != '3.11' }}
run: |
python -m pytest
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install pytest-cov
python -m pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v1
with:
verbose: true
Expand All @@ -56,7 +59,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -67,30 +70,23 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest igraph pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.9' }}
if: ${{ matrix.python-version != '3.11' }}
run: |
python -m pytest
- name: Test with numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install numba
python -m pytest -n=auto
- name: Test with pytest and Codecov
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install pytest-cov
python -m pytest -n=auto --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v4
with:
verbose: true
Expand All @@ -104,12 +100,17 @@ jobs:
'pandapipes/networks/network_files/**'
'**.yml'
'**.rst'
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
linting:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.11']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -121,7 +122,6 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install flake8
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
shell: bash
- name: List all installed packages
Expand All @@ -140,7 +140,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -151,8 +151,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest==8.0.2 nbmake pytest-xdist pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
shell: bash
- name: List all installed packages
Expand All @@ -161,17 +159,17 @@ jobs:
- name: Test with pytest
run: |
python -m pytest --nbmake -n=auto "./tutorials"
- name: Test with numba
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install numba
python -m pip uninstall numba -y
python -m pytest --nbmake -n=auto "./tutorials"
docs_check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ '3.11' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
43 changes: 21 additions & 22 deletions .github/workflows/run_tests_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -27,36 +27,29 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.9' }}
if: ${{ matrix.python-version != '3.11' }}
run: |
python -m pytest
- name: Test with numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install numba
python -m pytest -n=auto
- name: Test with pytest, Codecov and Coverage
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install pytest-cov
python -m pytest --nbmake -n=auto --cov=./ --cov-report=xml
cp ./coverage.xml ./codecov_coverage.xml
- name: Upload coverage to Codacy
if: ${{ matrix.python-version == '3.9' && matrix.os == 'ubuntu-latest'}}
if: ${{ matrix.python-version == '3.11' && matrix.os == 'ubuntu-latest'}}
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml
- name: Upload coverage to Codecov
if: ${{ matrix.python-version == '3.9' }}
if: ${{ matrix.python-version == '3.11' }}
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand All @@ -70,13 +63,18 @@ jobs:
'pandapipes/networks/network_files/**'
'**.yml'
'**.rst'
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
relying:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -87,23 +85,26 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
shell: bash
- name: List all installed packages
run: |
python -m pip list
- name: Test with pytest
if: ${{ matrix.python-version != '3.9' }}
# if: ${{ matrix.python-version != '3.11' }}
run: |
python -m pytest -n=auto
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip uninstall numba -y
python -m pytest -n=auto
tutorial_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.9', '3.10', '3.11', '3.12']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
Expand All @@ -114,8 +115,6 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest==8.0.2 nbmake pytest-xdist pytest-split
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
python -m pip install .["all"]
shell: bash
- name: List all installed packages
Expand All @@ -124,18 +123,18 @@ jobs:
- name: Test with pytest
run: |
python -m pytest --nbmake -n=auto "./tutorials"
- name: Test with numba
- name: Test without numba
if: ${{ matrix.python-version == '3.11' }}
run: |
python -m pip install numba
python -m pip uninstall numba -y
python -m pytest --nbmake -n=auto "./tutorials"
docs_check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.10' ]
python-version: [ '3.11' ]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
Expand Down
10 changes: 6 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ Change Log
=============


-[ADDED] heat_consumer plotting
-[CHANGED] switched from setup.py to pyproject.toml
- [CHANGED] variable "alpha_w_per_m2k" to "u_w_per_m2k"
- [FIXED] Pressure plot not working for circ pump
- [ADDED] heat_consumer plotting
- [ADDED] variable "u_w_per_m2k" to std_type pipe
- [ADDED] standard district heating pipe types
- [ADDED] support for Python 3.12
- [CHANGED] switched from setup.py to pyproject.toml
- [CHANGED] variable "alpha_w_per_m2k" to "u_w_per_m2k"
- [FIXED] Pressure plot not working for circ pump
- [REMOVED] support for Python 3.8 due to EOL



Expand Down
15 changes: 9 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors=[
description = "A pipeflow calculation tool that complements pandapower in the simulation of multi energy grids"
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
Expand All @@ -26,7 +26,6 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
# Add the specific Python versions supported here, e.g.:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand All @@ -38,7 +37,8 @@ dependencies = [
"shapely",
]
keywords = [
"network", "analysis", "optimization", "automation", "grid", "energy", "engineering", "simulation", "pipeflow", "pandapipes", "gas"
"network", "analysis", "optimization", "automation", "grid", "energy", "engineering",
"simulation", "pipeflow", "pandapipes", "gas"
]

[project.urls]
Expand All @@ -53,11 +53,14 @@ Changelog = "https://github.com/e2nIEE/pandapipes/blob/develop/CHANGELOG.rst"
[project.optional-dependencies]
docs = ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "sphinx-pyproject"]
plotting = ["plotly", "igraph"]
test = ["pytest", "pytest-xdist", "nbmake"]
test = [
"pytest", "pytest-xdist", "pytest-split", "nbmake", "numba",
"setuptools; python_version >= '3.12'"
]
all = [
"numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex",
"plotly", "igraph",
"pytest", "pytest-xdist", "nbmake"
"plotly", "igraph", "pytest", "pytest-xdist", "pytest-split", "nbmake", "numba",
"setuptools; python_version >= '3.12'"
]

[tool.setuptools.packages.find]
Expand Down
7 changes: 6 additions & 1 deletion src/pandapipes/test/test_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@

import pytest
from pandapipes import pp_dir
from setuptools import find_packages
try:
from setuptools import find_packages
SETUPTOOLS_AVAILABLE = True
except ImportError:
SETUPTOOLS_AVAILABLE = False


@pytest.mark.skipif(not SETUPTOOLS_AVAILABLE, reason="setuptools not available")
def test_import_packages():
all_packages = find_packages(pp_dir)
for pck in all_packages:
Expand Down

0 comments on commit 34d0bac

Please sign in to comment.