Skip to content

Commit

Permalink
Merge pull request #394 from e2nIEE/develop
Browse files Browse the repository at this point in the history
release 0.7.0
  • Loading branch information
SimonRubenDrauz authored Aug 2, 2022
2 parents 01b92d0 + 3cca1dd commit f9b7cb0
Show file tree
Hide file tree
Showing 107 changed files with 4,316 additions and 2,042 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/run_tests_develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest python-igraph pytest-split
python -m pip install pytest python-igraph pytest-split numba
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 .
Expand Down Expand Up @@ -81,3 +81,28 @@ jobs:
run: |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
tutorial_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
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 pytest-xdist pytest-split python-igraph numba
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 .
- name: List all installed packages
run: |
pip list
- name: Test with pytest
run: |
pytest --nbmake -n=auto "./tutorials"
27 changes: 26 additions & 1 deletion .github/workflows/run_tests_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -49,3 +49,28 @@ jobs:
uses: codecov/codecov-action@v1
with:
verbose: true

tutorial_tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
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 pytest-xdist pytest-split python-igraph numba
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 .
- name: List all installed packages
run: |
pip list
- name: Test with pytest
run: |
pytest --nbmake -n=auto "./tutorials"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ doc/.build/*
doc/_build/*
doc/build/*
tutorials/.ipynb_checkpoints
tutorials/timeseries/results
pandapipes/data/*
pandapipes.egg-info/
27 changes: 25 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,35 @@
Change Log
=============

[0.7.0] - 2022-08-02
-------------------------------
- [ADDED] automated test with Python 3.10 added to GitHub Actions CI (now Python 3.7 - 3.10)
- [ADDED] function to test tutorials / jupyter notebooks for raised errors
- [ADDED] add tests for tutorials to GitHub Actions
- [ADDED] some internal functions of the hydraulic calculation are also implemented with numba's Just-in-time compilation mode for speed-up (switch on/off with the use_numba flag)
- [ADDED] function for subnet selection
- [ADDED] functions for standard type changes
- [ADDED] added \__eq__ method for JSONSerializableClass using deepdiff library in pandapower. Required adjustments in property comparison test.
- [CHANGED] timeseries progress bar now shown with tqdm as in pandapower
- [CHANGED] some restructuring (the pf package now contains different modules for pipeflow internals)
- [CHANGED] for hydraulic calculation, the derivatives and some result extraction functions were made global (previously in component models). Components can influence the calculation beforehand/afterwards (e.g. for pressure lift) in pre-/ post derivative calculation functions.
- [CHANGED] standard types now under net.std_types instead of net.std_type
- [CHANGED] renaming extract_results to init_results in component_models
- [CHANGED] standard types are created, not added anymore
- [FIXED] bugfix to resolve problems with numpy indexing (especially with numpy.repeat) in some component models
- [FIXED] HHV/LHV for H2 corrected
- [FIXED] only considering external grids, which are in service
- [FIXED] preventing unexpected behavior of pressure control component or displaying logger warnings
- [FIXED] usage of tqdm for progress bar print
- [FIXED] individual run function can be passed in run_timeseries now (test added)
- [FIXED] converged flag set equals to False at the beginning of each pipeflow

[0.6.0] - 2022-02-07
-------------------------------
- [ADDED] Adding pressure controler as new component
- [ADDED] Adding pressure controller as new component
- [ADDED] Adding compressor as new component
- [ADDED] Compressing power of a pump component are returned as result
- [ADDED] Adding polynominal fluids
- [ADDED] Adding polynomial fluids
- [CHANGED] Removing irrelevant results in branch models with zero length (mean velocity, lambda, reynolds)
- [FIXED] Only ext grids in service are considered
- [FIXED] Converting format of the nets in a multinet correctly
Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
# built documents.
#
# The short X.Y version.
version = "0.6"
version = "0.7"
# The full version, including alpha/beta/rc tags.
release = "0.6.0"
release = "0.7.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
4 changes: 2 additions & 2 deletions 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.6.0'
__version__ = '0.7.0'

import pandas as pd
import os
Expand All @@ -15,6 +15,6 @@
from pandapipes.io.file_io import *
from pandapipes.pipeflow import *
from pandapipes.toolbox import *
from pandapipes.pipeflow_setup import *
from pandapipes.pf.pipeflow_setup import *
from pandapipes.std_types import *
import pandapipes.plotting
64 changes: 43 additions & 21 deletions pandapipes/component_models/abstract_models/base_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# 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.

from pandapipes.component_models.auxiliaries.component_toolbox import init_results_element
from pandapipes.component_models.component_toolbox import init_results_element

try:
import pplog as logging
import pandaplan.core.pplog as logging
except ImportError:
import logging

Expand All @@ -19,23 +19,38 @@ def table_name(cls):
raise NotImplementedError()

@classmethod
def extract_results(cls, net, options, node_name):
def init_results(cls, net):
"""
Function that extracts certain results.
Function that intializes the result table for the component.
:param net: The pandapipes network
:type net: pandapipesNet
:param options:
:type options:
:param node_name:
:type node_name:
:return: No Output.
"""
output, all_float = cls.get_result_table(net)
init_results_element(net, cls.table_name(), output, all_float)
res_table = net["res_" + cls.table_name()]
return res_table

@classmethod
def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected):
"""
Function that extracts certain results.
:param net: The pandapipes network
:type net: pandapipesNet
:param options:
:type options:
:param branch_results:
:type branch_results:
:param nodes_connected:
:type nodes_connected:
:param branches_connected:
:type branches_connected:
:return: No Output.
"""
raise NotImplementedError

@classmethod
def get_component_input(cls):
"""
Expand All @@ -57,6 +72,14 @@ def get_result_table(cls, net):
"""
raise NotImplementedError

@classmethod
def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options):
pass

@classmethod
def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options):
pass

@classmethod
def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_start,
current_table, internal_nodes_lookup):
Expand All @@ -83,7 +106,8 @@ def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current
return current_start, current_table

@classmethod
def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_table, current_start):
def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_table,
current_start):
"""
Function which creates branch lookups.
Expand All @@ -104,31 +128,29 @@ def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, curre
return current_start, current_table

@classmethod
def create_pit_node_entries(cls, net, node_pit, node_name):
def create_pit_node_entries(cls, net, node_pit):
"""
Function which creates pit branch entries.
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_pit:
:type branch_pit:
:param node_pit:
:type node_pit:
:return: No Output.
"""

pass

@classmethod
def create_pit_branch_entries(cls, net, branch_pit, node_name):
def create_pit_branch_entries(cls, net, branch_pit):
"""
Function which creates pit branch entries.
:param net: The pandapipes network
:type net: pandapipesNet
:param node_pit:
:type node_pit:
:param branch_pit:
:type branch_pit:
:return: No Output.
"""

pass

@classmethod
Expand All @@ -138,8 +160,8 @@ def calculate_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups,
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_component_pit:
:type branch_component_pit:
:param branch_pit:
:type branch_pit:
:param node_pit:
:type node_pit:
:param idx_lookups:
Expand All @@ -157,8 +179,8 @@ def calculate_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, o
:param net: The pandapipes network
:type net: pandapipesNet
:param branch_component_pit:
:type branch_component_pit:
:param branch_pit:
:type branch_pit:
:param node_pit:
:type node_pit:
:param idx_lookups:
Expand Down
Loading

0 comments on commit f9b7cb0

Please sign in to comment.