Skip to content

Commit

Permalink
Merge pull request #509 from e2nIEE/hotfix_0.8.4
Browse files Browse the repository at this point in the history
Hotfix 0.8.4
  • Loading branch information
SimonRubenDrauz committed Feb 2, 2023
2 parents af5bdc7 + d14ca6e commit fa4d506
Show file tree
Hide file tree
Showing 10 changed files with 908 additions and 24 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +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
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# This workflow will create a Python package and upload it to testPyPi or PyPi
# Then, it installs pandapipes from there and all dependencies and runs tests with different Python versions

name: release

Expand All @@ -20,21 +19,20 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
upload:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# Sets up python3
- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: '3.10'
# Installs and upgrades pip, installs other dependencies and installs the package from setup.py
# Installs and upgrades pip, installs twine and other packages for the release-process
- name: Install dependencies
run: |
# Upgrade pip
Expand Down Expand Up @@ -80,15 +78,14 @@ jobs:
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest nbmake python-igraph pytest-xdist pytest-split numba
python -m pip install pytest python-igraph pytest-split numba
- name: Install pandapipes from TestPyPI
if: ${{ inputs.upload_server == 'testpypi'}}
run: |
Expand All @@ -102,5 +99,4 @@ jobs:
pip list
- name: Test with pytest
run: |
pytest
pytest --nbmake -n=auto "./tutorials"
pytest --pyargs pandapipes.test
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Change Log
=============

[0.8.4] - 2023-02-02
-------------------------------
- [FIXED] added flow control to nxgraph
- [FIXED] in case of multiple pumps, there was a bug when calculating pressure
- [FIXED] if all pumps are out of service, the pipeflow did not converge
- [FIXED] remove unnecessary checkout in release.yml and tutorial tests

[0.8.3] - 2023-01-09
-------------------------------
- [FIXED] inconsistency between testpypi and pypi
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
# The short X.Y version.
version = "0.8"
# The full version, including alpha/beta/rc tags.
release = "0.8.3"
release = "0.8.4"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion pandapipes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

__version__ = '0.8.3'
__version__ = '0.8.4'
__format_version__ = '0.8.0'

import pandas as pd
Expand Down
9 changes: 5 additions & 4 deletions pandapipes/component_models/pump_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,11 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo
else:
v_mean = v_mps
vol = v_mean * area
fcts = itemgetter(*std_types)(net['std_types']['pump'])
fcts = [fcts] if not isinstance(fcts, tuple) else fcts
pl = np.array(list(map(lambda x, y: x.get_pressure(y), fcts, vol)))
pump_pit[:, PL] = pl
if len(std_types):
fcts = itemgetter(*std_types)(net['std_types']['pump'])
fcts = [fcts] if not isinstance(fcts, tuple) else fcts
pl = np.array(list(map(lambda x, y: x.get_pressure(y), fcts, vol)))
pump_pit[:, PL] = pl

@classmethod
def calculate_temperature_lift(cls, net, branch_component_pit, node_pit):
Expand Down
3 changes: 2 additions & 1 deletion pandapipes/std_types/std_type_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ def get_pressure(self, vdot_m3_per_s):
"Bypassing without pressure change is assumed" % str(self.name))
mask = vdot_m3_per_s >= 0
# no negative pressure lift - bypassing always allowed:
results[mask] = np.where(mask, sum(self.reg_par * (vdot_m3_per_s[mask] * 3600) ** (n - 1)), 0)
results[mask] = \
np.where(mask, np.sum(self.reg_par * (vdot_m3_per_s[mask][:, None] * 3600) ** (n - 1), axis=1), 0)
else:
if vdot_m3_per_s < 0:
logger.debug("Reverse flow observed in a %s pump. "
Expand Down
412 changes: 412 additions & 0 deletions pandapipes/test/api/old_versions/example_0.8.4_gas.json

Large diffs are not rendered by default.

Loading

0 comments on commit fa4d506

Please sign in to comment.