Skip to content

Commit

Permalink
Merge branch 'develop' into Tutorial_ipynb_Heat_Network_Four_Consumers
Browse files Browse the repository at this point in the history
  • Loading branch information
EPrade authored Sep 2, 2024
2 parents b4df4e7 + 257c99f commit d363f73
Show file tree
Hide file tree
Showing 27 changed files with 236 additions and 169 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
59 changes: 28 additions & 31 deletions .github/workflows/run_tests_develop.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# 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-develop branch
# pandapipes-develop branch is designed to work with pandapower-master branch, but checks the ability to
# work with pandapower-develop branch (relying tests, usually not required for merges) in order to avoid
# problems in future releases

name: ppipes_dev

Expand All @@ -17,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 @@ -28,25 +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 pandapower
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 @@ -55,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 @@ -66,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 @@ -103,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 @@ -120,8 +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 git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
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,9 +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 git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower
python -m pip install .["all"]
shell: bash
- name: List all installed packages
Expand All @@ -162,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
44 changes: 21 additions & 23 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,37 +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 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, 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 @@ -71,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 @@ -88,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 @@ -115,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 @@ -125,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
11 changes: 7 additions & 4 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ 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
- [ADDED] t_outlet_k to result tables of branch components
- [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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pandapipes.component_models.abstract_models.branch_models import BranchComponent
from pandapipes.component_models.component_toolbox import set_entry_check_repeat, vinterp, \
p_correction_height_air
from pandapipes.idx_branch import ACTIVE, FROM_NODE, FROM_NODE_T, TO_NODE, TO_NODE_T, TOUTINIT, ELEMENT_IDX, TOUTINIT
from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, ELEMENT_IDX, TOUTINIT
from pandapipes.idx_node import (L, node_cols, TINIT as TINIT_NODE, HEIGHT, PINIT, PAMB,
ACTIVE as ACTIVE_ND)
from pandapipes.pf.pipeflow_setup import add_table_lookup, get_lookup, get_table_number
Expand Down Expand Up @@ -207,9 +207,7 @@ def create_pit_branch_entries(cls, net, branch_pit):
branch_w_internals_pit, ACTIVE, net[cls.table_name()][cls.active_identifier()].values,
internal_pipe_number, has_internals)
branch_w_internals_pit[:, FROM_NODE] = from_nodes
branch_w_internals_pit[:, FROM_NODE_T] = from_nodes
branch_w_internals_pit[:, TO_NODE] = to_nodes
branch_w_internals_pit[:, TO_NODE_T] = to_nodes
branch_w_internals_pit[:, TOUTINIT] = node_pit[to_nodes, TINIT_NODE]
return branch_w_internals_pit, internal_pipe_number

Expand Down
Loading

0 comments on commit d363f73

Please sign in to comment.