From 1e2e873e996445d9cdf0fc2b40f70771cab1221d Mon Sep 17 00:00:00 2001 From: jkisse Date: Tue, 10 Jan 2023 10:10:35 +0100 Subject: [PATCH 001/126] add missing init to the topology tests (#490) --- pandapipes/test/topology/__init__.py | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pandapipes/test/topology/__init__.py diff --git a/pandapipes/test/topology/__init__.py b/pandapipes/test/topology/__init__.py new file mode 100644 index 000000000..fe22a75dc --- /dev/null +++ b/pandapipes/test/topology/__init__.py @@ -0,0 +1,3 @@ +# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# 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 bb6d07678702152c8114bf05d9e4f681d4970326 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Thu, 12 Jan 2023 11:08:38 +0100 Subject: [PATCH 002/126] Load JSON string simplified In file_io: do not pass object_hook to JSON Decoder in json.loads, but registry_class. Please do not merge before pandapower has been updated to process this change! (cf. e2nIEE/pandapower#1827) --- pandapipes/io/file_io.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandapipes/io/file_io.py b/pandapipes/io/file_io.py index 97a3a61a6..a1aa0a86c 100644 --- a/pandapipes/io/file_io.py +++ b/pandapipes/io/file_io.py @@ -150,8 +150,7 @@ def from_json_string(json_string, convert=False, encryption_key=None): if encryption_key is not None: json_string = decrypt_string(json_string, encryption_key) - net = json.loads(json_string, cls=PPJSONDecoder, - object_hook=partial(pp_hook, registry_class=FromSerializableRegistryPpipe)) + net = json.loads(json_string, cls=PPJSONDecoder, registry_class=FromSerializableRegistryPpipe) if convert and isinstance(net, pandapipesNet): convert_format(net) From ea6aec9daf6ede861e8a0a72e495164983b257f6 Mon Sep 17 00:00:00 2001 From: SRDM <42580302+SimonRubenDrauz@users.noreply.github.com> Date: Thu, 26 Jan 2023 09:47:17 +0100 Subject: [PATCH 003/126] run release-tests without repo checkout, just with pip package (#492) * For the test job, make sure that the repo is not checked out and the only available pandapipes installation is the one from pip * Update the versions of the Actions Co-authored-by: jkisse --- .github/workflows/release.yml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b86b5f20e..72ae42326 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -20,7 +19,6 @@ 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 @@ -28,13 +26,13 @@ jobs: # 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 @@ -80,7 +78,6 @@ 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: @@ -88,7 +85,7 @@ jobs: - 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: | @@ -102,5 +99,4 @@ jobs: pip list - name: Test with pytest run: | - pytest - pytest --nbmake -n=auto "./tutorials" + pytest --pyargs pandapipes.test From cd85dc846bbe146862de2465d71c8df9e27daa94 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Thu, 26 Jan 2023 15:06:57 +0100 Subject: [PATCH 004/126] Flow control is considered in nx_graph creation Hotfix for nx_graph creation of networks with flow controllers, as the keywords concerning them were not correctly considered within the function (include_flow_controls could not be set to False). --- pandapipes/topology/create_graph.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandapipes/topology/create_graph.py b/pandapipes/topology/create_graph.py index 0e31b4d10..df9443fd2 100644 --- a/pandapipes/topology/create_graph.py +++ b/pandapipes/topology/create_graph.py @@ -108,13 +108,13 @@ def create_nxgraph(net, include_pipes=True, respect_status_pipes=True, else: mg = nx.Graph() - branch_params = {k: v for k, v in kwargs.items() if any( - k.startswith(par) for par in ["include", "respect_status", "weighting"])} + branch_kw = ["include", "respect_status", "weighting"] + branch_params = {k: v for k, v in kwargs.items() if any(k.startswith(par) for par in branch_kw)} loc = locals() - branch_params.update({"%s_%s" % (par, bc): loc.get("%s_%s" % (par, bc)) - for par in ["include", "respect_status", "weighting"] + branch_params.update({"%s_%s" % (par, bc): loc.get("%s_%s" % (par, bc)) for par in branch_kw for bc in ["pipes", "valves", "pumps", "press_controls", - "mass_circ_pumps", "press_circ_pumps", "valve_pipes"]}) + "mass_circ_pumps", "press_circ_pumps", "valve_pipes", + "flow_controls"]}) for comp in net.component_list: if not issubclass(comp, BranchComponent): continue From 78eff763859c2b37835d3516ff243eacb2e3c3b2 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Thu, 26 Jan 2023 15:09:58 +0100 Subject: [PATCH 005/126] small edit --- pandapipes/topology/create_graph.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pandapipes/topology/create_graph.py b/pandapipes/topology/create_graph.py index df9443fd2..529fa7f89 100644 --- a/pandapipes/topology/create_graph.py +++ b/pandapipes/topology/create_graph.py @@ -115,6 +115,7 @@ def create_nxgraph(net, include_pipes=True, respect_status_pipes=True, for bc in ["pipes", "valves", "pumps", "press_controls", "mass_circ_pumps", "press_circ_pumps", "valve_pipes", "flow_controls"]}) + for comp in net.component_list: if not issubclass(comp, BranchComponent): continue From e88f4b87622e52574de990154f150229e24bb2a3 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Mon, 30 Jan 2023 16:04:36 +0100 Subject: [PATCH 006/126] add Python 3.11 to test matrix on develop install Numba only for Python < 3.11 --- .github/workflows/run_tests_develop.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 30dfe43d7..2534717cf 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -18,17 +18,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '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 run: | python -m pip install --upgrade pip - python -m pip install pytest python-igraph pytest-split numba + python -m pip install pytest python-igraph pytest-split + if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . @@ -58,9 +59,9 @@ jobs: 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: Install dependencies @@ -88,15 +89,16 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '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 run: | python -m pip install --upgrade pip - python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph numba + python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph + if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . @@ -113,9 +115,9 @@ jobs: 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 }} From 528000e3268cd28c9bfb9f1345e5697e2d58fcf6 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Mon, 30 Jan 2023 16:11:02 +0100 Subject: [PATCH 007/126] add Python 3.11 to master workflow and tutorials, change np.bool to bool --- .github/workflows/run_tests_develop.yml | 2 +- .github/workflows/run_tests_master.yml | 8 +++++--- pandapipes/pipeflow.py | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 2534717cf..30ed69b1f 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index d360b78a7..87579b731 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v2 @@ -28,7 +28,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest python-igraph pytest-split numba + python -m pip install pytest python-igraph pytest-split + if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . @@ -64,7 +65,8 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph numba + python -m pip install pytest nbmake pytest-xdist pytest-split python-igraph + if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index a106c23b2..9f9544aa6 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -83,8 +83,8 @@ def pipeflow(net, sol_vec=None, **kwargs): nodes_connected, branches_connected = check_connectivity( net, branch_pit, node_pit, check_heat=calculate_heat) else: - nodes_connected = node_pit[:, ACTIVE_ND].astype(np.bool) - branches_connected = branch_pit[:, ACTIVE_BR].astype(np.bool) + nodes_connected = node_pit[:, ACTIVE_ND].astype(bool) + branches_connected = branch_pit[:, ACTIVE_BR].astype(bool) reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected) From e96bc810f47a7a3d25b19bef37f2304c75de5cbf Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Mon, 30 Jan 2023 16:55:34 +0100 Subject: [PATCH 008/126] use the latest versions of action/checkout and action/setup-python --- .github/workflows/run_tests_master.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index 87579b731..3597d1689 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -20,9 +20,9 @@ jobs: python-version: ['3.7', '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 @@ -57,9 +57,9 @@ jobs: matrix: python-version: ['3.7', '3.8', '3.9', '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 @@ -83,9 +83,9 @@ jobs: 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 }} From fd765391da2cc29a7e2cdbdff922ca6fd81fd377 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Mon, 30 Jan 2023 17:02:56 +0100 Subject: [PATCH 009/126] update CHANGELOG.rst --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 783719d85..2ba582530 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,10 @@ Change Log ============= +[upcoming release] - 2023-..-.. +------------------------------- +- [ADDED] support Python 3.11 (now included in test pipeline) + [0.8.3] - 2023-01-09 ------------------------------- - [FIXED] inconsistency between testpypi and pypi From 01377f9f468f2cff1e4ea4bb40664f05d426fb75 Mon Sep 17 00:00:00 2001 From: SRDM <42580302+SimonRubenDrauz@users.noreply.github.com> Date: Tue, 31 Jan 2023 11:17:25 +0100 Subject: [PATCH 010/126] add create function for multiple heat exchangers (#503) * enable multiple creation of heat exchanger * adapted changelog and added doc for multiple heat exchanger --- CHANGELOG.rst | 1 + .../heat_exchanger_component.rst | 6 ++ pandapipes/create.py | 56 ++++++++++++++++++- 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 2ba582530..53b4ece82 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,7 @@ Change Log [upcoming release] - 2023-..-.. ------------------------------- +- [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) [0.8.3] - 2023-01-09 diff --git a/doc/source/components/heat_exchanger/heat_exchanger_component.rst b/doc/source/components/heat_exchanger/heat_exchanger_component.rst index a853f442c..7ad146af9 100644 --- a/doc/source/components/heat_exchanger/heat_exchanger_component.rst +++ b/doc/source/components/heat_exchanger/heat_exchanger_component.rst @@ -7,9 +7,15 @@ Create Function .. _create_heat_exchanger: +For creating a single heat exchanger unit: .. autofunction:: pandapipes.create_heat_exchanger +For creating multiple heat exchangers at once: + +.. autofunction:: pandapipes.create_heat_exchangers + + Component Table Data ==================== diff --git a/pandapipes/create.py b/pandapipes/create.py index d9f67f387..ba4591a16 100644 --- a/pandapipes/create.py +++ b/pandapipes/create.py @@ -204,6 +204,7 @@ def create_source(net, junction, mdot_kg_per_s, scaling=1., name=None, index=Non return index + def create_mass_storage(net, junction, mdot_kg_per_s, init_m_stored_kg=0, min_m_stored_kg=0., max_m_stored_kg=np.inf, scaling=1., name=None, index=None, in_service=True, type="mass_storage", **kwargs): @@ -1502,7 +1503,7 @@ def create_pressure_controls(net, from_junctions, to_junctions, controlled_junct _set_multiple_entries(net, "press_control", index, **entries, **kwargs) controlled_elsewhere = (controlled_junctions != from_junctions) \ - & (controlled_junctions != to_junctions) + & (controlled_junctions != to_junctions) if np.any(controlled_elsewhere): controllers_warn = index[controlled_elsewhere] logger.warning("The pressure controllers %s control the pressure at junctions that they are" @@ -1572,6 +1573,59 @@ def create_flow_controls(net, from_junctions, to_junctions, controlled_mdot_kg_p return index +def create_heat_exchangers(net, from_junctions, to_junctions, diameter_m, qext_w, loss_coefficient=0, + name=None, index=None, in_service=True, type="heat_exchanger", **kwargs): + """ + Convenience function for creating many heat exchangers at once. Parameters 'from_junctions'\ + and 'to_junctions' must be arrays of equal length. Other parameters may be either arrays of the\ + same length or single values. + + :param net: The net for which the heat exchangers should be created + :type net: pandapipesNet + :param from_junctions: ID of the junctions on one side the heat exchangers will be\ + connected with + :type from_junctions: Iterable(int) + :param to_junctions: ID of the junctions on the other side the heat exchangers will be\ + connected with + :type to_junctions: Iterable(int) + :param diameter_m: The heat exchangers inner diameter in [m] + :type diameter_m: Iterable(float) or float + :param qext_w: External heat flux in [W]. If positive, heat is derived from the network. If + negative, heat is being fed into the network from a heat source. + :type qext_w: Iterable(float) or float + :param loss_coefficient: An additional pressure loss coefficient, introduced by e.g. bends + :type loss_coefficient: Iterable(float) or float + :param name: The name of the heat exchangers + :type name: str, default None + :param index: Force a specified ID if it is available. If None, the index one higher than the\ + highest already existing index is selected. + :type index: Iterable(str) or str, default None + :param in_service: True if the heat exchangers are in service or False if they are out of service + :type in_service: Iterable(bool) or bool, default True + :param type: Not used yet + :type type: Iterable(str) or str, default "heat exchanger" + :param kwargs: Additional keyword arguments will be added as further columns to the\ + net["heat_exchanger"] table + :return: index - The unique IDs of the created heat exchangers + :rtype: Iterable(int), default None + + :Example: + >>> create_heat_exchangers(net, from_junctions=[0,1], to_junctions=[2,3], + >>> diameter_m=40e-3, qext_w=2000) + """ + add_new_component(net, HeatExchanger) + + index = _get_multiple_index_with_check(net, "heat_exchanger", index, len(from_junctions)) + _check_branches(net, from_junctions, to_junctions, "heat_exchanger") + + entries = {"name": name, "from_junction": from_junctions, "to_junction": to_junctions, + "diameter_m": diameter_m, "qext_w": qext_w, "loss_coefficient": loss_coefficient, + "in_service": bool(in_service), "type": type} + _set_multiple_entries(net, "heat_exchanger", index, **entries, **kwargs) + + return index + + def create_fluid_from_lib(net, name, overwrite=True): """ Creates a fluid from library (if there is an entry) and sets net["fluid"] to this value. From 2cd2c641ae4cae8812293ba56849293c7e3d0d3f Mon Sep 17 00:00:00 2001 From: jkisse Date: Wed, 22 Feb 2023 11:41:07 +0100 Subject: [PATCH 011/126] Add even more Python 3.11 (#504) * add Python 3.11 to Release workflow * change Python Version of docs_check and linting to 3.10 --- .github/workflows/release.yml | 7 ++++--- .github/workflows/run_tests_develop.yml | 4 ++-- .github/workflows/run_tests_master.yml | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 72ae42326..9a90c7eec 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,17 +75,18 @@ jobs: needs: upload strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] os: [ ubuntu-latest, windows-latest ] steps: - 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 run: | python -m pip install --upgrade pip - python -m pip install pytest python-igraph pytest-split numba + python -m pip install pytest python-igraph pytest-split + if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi - name: Install pandapipes from TestPyPI if: ${{ inputs.upload_server == 'testpypi'}} run: | diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 30ed69b1f..b00dbee9e 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8'] + python-version: ['3.10'] steps: - uses: actions/checkout@v3 @@ -113,7 +113,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8' ] + python-version: [ '3.10' ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index 3597d1689..8c6c41464 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ '3.8' ] + python-version: [ '3.10' ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From 9527ded84769fdf1c6dc4ed73bf0400cf6f79bac Mon Sep 17 00:00:00 2001 From: Steffen Meinecke Date: Mon, 27 Feb 2023 10:24:32 +0100 Subject: [PATCH 012/126] pp.toolbox import fix & silence numpy warnings (#520) remove direct import from toolbox file --- pandapipes/test/io/test_file_io.py | 2 +- pandapipes/toolbox.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pandapipes/test/io/test_file_io.py b/pandapipes/test/io/test_file_io.py index 79eb37822..a3c3299c0 100644 --- a/pandapipes/test/io/test_file_io.py +++ b/pandapipes/test/io/test_file_io.py @@ -10,7 +10,7 @@ from pandapipes.test.multinet.test_control_multinet import get_gas_example, get_power_example_simple from pandapipes.multinet.create_multinet import create_empty_multinet, add_nets_to_multinet from pandapipes.multinet import MultiNet -from pandapower.toolbox import nets_equal as nets_equal_pandapower +from pandapower import nets_equal as nets_equal_pandapower from pandapipes.toolbox import nets_equal diff --git a/pandapipes/toolbox.py b/pandapipes/toolbox.py index 1d8de357c..afb78a44c 100644 --- a/pandapipes/toolbox.py +++ b/pandapipes/toolbox.py @@ -7,8 +7,7 @@ import numpy as np import pandas as pd from networkx import has_path -from pandapower.auxiliary import get_indices -from pandapower.toolbox import dataframes_equal, clear_result_tables +from pandapower import get_indices, dataframes_equal, clear_result_tables import pandapipes from pandapipes.component_models.abstract_models.branch_models import BranchComponent From cf96a0921e5afb084ba0c234f9fdea9fc57db8eb Mon Sep 17 00:00:00 2001 From: jkisse Date: Wed, 15 Mar 2023 08:43:36 +0100 Subject: [PATCH 013/126] remove Python 3.7 from test workflow (#524) * remove Python 3.7 from test workflow * update CHANGELOG.rst --- .github/workflows/release.yml | 2 +- .github/workflows/run_tests_develop.yml | 4 ++-- .github/workflows/run_tests_master.yml | 4 ++-- CHANGELOG.rst | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9a90c7eec..6a40ad8fe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,7 +75,7 @@ jobs: needs: upload strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] os: [ ubuntu-latest, windows-latest ] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index b00dbee9e..43c2877b0 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -87,7 +87,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index 8c6c41464..3561b3719 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.8', '3.9', '3.10', '3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0cdcae6fc..903afc7ed 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Change Log ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) +- [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) [0.8.4] - 2023-02-02 ------------------------------- From c437200fae2f9ef083170041869bf716dab98d9c Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Wed, 22 Mar 2023 18:05:05 +0100 Subject: [PATCH 014/126] created two biomethane gases --- .../properties/biomethane/compressibility.txt | 3 + pandapipes/properties/biomethane/density.txt | 58 +++++++++++++++++++ .../biomethane/der_compressibility.txt | 3 + .../properties/biomethane/gas_composition.txt | 9 +++ .../properties/biomethane/heat_capacity.txt | 58 +++++++++++++++++++ .../biomethane/higher_heating_value.txt | 3 + .../biomethane/lower_heating_value.txt | 1 + .../properties/biomethane/molar_mass.txt | 2 + .../properties/biomethane/viscosity.txt | 58 +++++++++++++++++++ .../biomethane_LPG/compressibility.txt | 3 + .../properties/biomethane_LPG/density.txt | 58 +++++++++++++++++++ .../biomethane_LPG/der_compressibility.txt | 3 + .../biomethane_LPG/gas_composition.txt | 12 ++++ .../biomethane_LPG/heat_capacity.txt | 58 +++++++++++++++++++ .../biomethane_LPG/higher_heating_value.txt | 3 + .../biomethane_LPG/lower_heating_value.txt | 1 + .../properties/biomethane_LPG/molar_mass.txt | 2 + .../properties/biomethane_LPG/viscosity.txt | 58 +++++++++++++++++++ 18 files changed, 393 insertions(+) create mode 100644 pandapipes/properties/biomethane/compressibility.txt create mode 100644 pandapipes/properties/biomethane/density.txt create mode 100644 pandapipes/properties/biomethane/der_compressibility.txt create mode 100644 pandapipes/properties/biomethane/gas_composition.txt create mode 100644 pandapipes/properties/biomethane/heat_capacity.txt create mode 100644 pandapipes/properties/biomethane/higher_heating_value.txt create mode 100644 pandapipes/properties/biomethane/lower_heating_value.txt create mode 100644 pandapipes/properties/biomethane/molar_mass.txt create mode 100644 pandapipes/properties/biomethane/viscosity.txt create mode 100644 pandapipes/properties/biomethane_LPG/compressibility.txt create mode 100644 pandapipes/properties/biomethane_LPG/density.txt create mode 100644 pandapipes/properties/biomethane_LPG/der_compressibility.txt create mode 100644 pandapipes/properties/biomethane_LPG/gas_composition.txt create mode 100644 pandapipes/properties/biomethane_LPG/heat_capacity.txt create mode 100644 pandapipes/properties/biomethane_LPG/higher_heating_value.txt create mode 100644 pandapipes/properties/biomethane_LPG/lower_heating_value.txt create mode 100644 pandapipes/properties/biomethane_LPG/molar_mass.txt create mode 100644 pandapipes/properties/biomethane_LPG/viscosity.txt diff --git a/pandapipes/properties/biomethane/compressibility.txt b/pandapipes/properties/biomethane/compressibility.txt new file mode 100644 index 000000000..194a3471a --- /dev/null +++ b/pandapipes/properties/biomethane/compressibility.txt @@ -0,0 +1,3 @@ +# source: linear approximation based on CoolProp (http://www.coolprop.org/) +# slope in 1/bar, offset for linear property +-0.0019303630399938587 0.9958350401842455 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/density.txt b/pandapipes/properties/biomethane/density.txt new file mode 100644 index 000000000..c90eac64b --- /dev/null +++ b/pandapipes/properties/biomethane/density.txt @@ -0,0 +1,58 @@ +# source: CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, nominal density in kg/Nm^3 at 1.01325 bar +263.15 0.7883176797706959 +265.15 0.7823175132720274 +267.15 0.7764086858132603 +269.15 0.7705891091714784 +271.15 0.7648567589356711 +273.15 0.7592096720602627 +275.15 0.7536459445317518 +277.15 0.7481637291423288 +279.15 0.742761233364706 +281.15 0.7374367173227688 +283.15 0.7321884918529732 +285.15 0.7270149166517398 +287.15 0.721914398504361 +289.15 0.7168853895912243 +291.15 0.7119263858673918 +293.15 0.7070359255118169 +295.15 0.7022125874426869 +297.15 0.6974549899243704 +299.15 0.6927617891486424 +301.15 0.6881316779168388 +303.15 0.6835633841304272 +305.15 0.679055670907835 +307.15 0.6746073333963901 +309.15 0.6702171990259529 +311.15 0.6658841261093711 +313.15 0.6616070028247312 +315.15 0.6573847462379292 +317.15 0.6532163013636869 +319.15 0.6491006402632528 +321.15 0.6450367611771036 +323.15 0.6410236876910659 +325.15 0.6370604679343483 +327.15 0.6331461738080604 +329.15 0.62927990024286 +331.15 0.6254607644844474 +333.15 0.6216879054056833 +335.15 0.6179604828441738 +337.15 0.6142776769642169 +339.15 0.6106386876420702 +341.15 0.6070427338735377 +343.15 0.6034890532029326 +345.15 0.5999769011734114 +347.15 0.5965055507927562 +349.15 0.5930742920256563 +351.15 0.589682431296971 +353.15 0.5863292910154656 +355.15 0.5830142091135528 +357.15 0.5797365386029372 +359.15 0.5764956471455245 +361.15 0.5732909166389835 +363.15 0.5701217428163711 +365.15 0.5669875348592726 +367.15 0.5638877150239164 +369.15 0.5608217182797604 +371.15 0.557788991960064 +373.15 0.5547889954239786 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/der_compressibility.txt b/pandapipes/properties/biomethane/der_compressibility.txt new file mode 100644 index 000000000..7561489ee --- /dev/null +++ b/pandapipes/properties/biomethane/der_compressibility.txt @@ -0,0 +1,3 @@ +# source: own calculation based on CoolProp (http://www.coolprop.org/) +# derivative (slope) of compressibility +-0.0019303630399938587 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/gas_composition.txt b/pandapipes/properties/biomethane/gas_composition.txt new file mode 100644 index 000000000..f94092840 --- /dev/null +++ b/pandapipes/properties/biomethane/gas_composition.txt @@ -0,0 +1,9 @@ +source: Arbeitsblatt DVGW G 260(A) + +Gas composition (molar fraction): +methane: 96.15 % +nitrogen: 0.75 % +carbon dioxide: 2.9 % +oxygen: 0.2 % + +Wobbe-Index (normal conditions) : 13.9 KWh/m³ \ No newline at end of file diff --git a/pandapipes/properties/biomethane/heat_capacity.txt b/pandapipes/properties/biomethane/heat_capacity.txt new file mode 100644 index 000000000..e02164ac0 --- /dev/null +++ b/pandapipes/properties/biomethane/heat_capacity.txt @@ -0,0 +1,58 @@ +#source CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, isobaric heat capacity in J/(kg K) +263.15 2043.9248427852253 +265.15 2046.988073303865 +267.15 2050.126087163204 +269.15 2053.3384737054007 +271.15 2056.6247917272185 +273.15 2059.9845702851426 +275.15 2063.417309553297 +277.15 2066.922481727277 +279.15 2070.4995319674445 +281.15 2074.1478793756605 +283.15 2077.8669179998637 +285.15 2081.6560178612567 +287.15 2085.514525999244 +289.15 2089.4417675296154 +291.15 2093.4370467118033 +293.15 2097.499648021338 +295.15 2101.628837223956 +297.15 2105.8238624483056 +299.15 2110.083955253294 +301.15 2114.4083316884407 +303.15 2118.7961933423576 +305.15 2123.246728391504 +307.15 2127.7591126080515 +309.15 2132.332510378635 +311.15 2136.9660756917788 +313.15 2141.6589531087366 +315.15 2146.41027871373 +317.15 2151.219181042416 +319.15 2156.0847819875867 +321.15 2161.0061976812103 +323.15 2165.982539352107 +325.15 2171.0129141586276 +327.15 2176.0964259958378 +329.15 2181.232176276832 +331.15 2186.419264687867 +333.15 2191.6567899171305 +335.15 2196.9438503570186 +337.15 2202.2795447799003 +339.15 2207.662972987398 +341.15 2213.0932364332866 +343.15 2218.569438820182 +345.15 2224.0906866702367 +347.15 2229.656089870096 +349.15 2235.2647621904885 +351.15 2240.9158217807285 +353.15 2246.608391638581 +355.15 2252.3416000559114 +357.15 2258.11458104055 +359.15 2263.9264747148845 +361.15 2269.7764276916773 +363.15 2275.6635934276164 +365.15 2281.587132555168 +367.15 2287.546213193266 +369.15 2293.540011237413 +371.15 2299.567710629771 +373.15 2305.6285036098143 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/higher_heating_value.txt b/pandapipes/properties/biomethane/higher_heating_value.txt new file mode 100644 index 000000000..8167b3888 --- /dev/null +++ b/pandapipes/properties/biomethane/higher_heating_value.txt @@ -0,0 +1,3 @@ +# source: Arbeitsblatt DVGW G 260(A) +# higher heating value in kWh/kg (at normal conditions) +13.94736842105263 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/lower_heating_value.txt b/pandapipes/properties/biomethane/lower_heating_value.txt new file mode 100644 index 000000000..e7b41c8d4 --- /dev/null +++ b/pandapipes/properties/biomethane/lower_heating_value.txt @@ -0,0 +1 @@ +# lower heating value in kWh/kg (at normal conditions) diff --git a/pandapipes/properties/biomethane/molar_mass.txt b/pandapipes/properties/biomethane/molar_mass.txt new file mode 100644 index 000000000..8aedf9214 --- /dev/null +++ b/pandapipes/properties/biomethane/molar_mass.txt @@ -0,0 +1,2 @@ +# source: CoolProp (http://www.coolprop.org/), kg/kmol +16.9755351 \ No newline at end of file diff --git a/pandapipes/properties/biomethane/viscosity.txt b/pandapipes/properties/biomethane/viscosity.txt new file mode 100644 index 000000000..ae4cb306d --- /dev/null +++ b/pandapipes/properties/biomethane/viscosity.txt @@ -0,0 +1,58 @@ +# source: CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, dynamic viscosity in kg/(m s) +263.15 1.018799917679172e-05 +265.15 1.0255447167391177e-05 +267.15 1.0322713803330764e-05 +269.15 1.0389800774187494e-05 +271.15 1.0456709739161057e-05 +273.15 1.0523442327979087e-05 +275.15 1.0590000141762678e-05 +277.15 1.0656384753854598e-05 +279.15 1.0722597710611642e-05 +281.15 1.0788640532164104e-05 +283.15 1.08545147131434e-05 +285.15 1.0920221723379986e-05 +287.15 1.0985763008573338e-05 +289.15 1.105113999093497e-05 +291.15 1.1116354069806426e-05 +293.15 1.1181406622253389e-05 +295.15 1.124629900363687e-05 +297.15 1.1311032548163775e-05 +299.15 1.1375608569415205e-05 +301.15 1.144002836085609e-05 +303.15 1.1504293196322224e-05 +305.15 1.1568404330518516e-05 +307.15 1.1632362999438391e-05 +309.15 1.1696170420830542e-05 +311.15 1.1759827794618619e-05 +313.15 1.1823336303312924e-05 +315.15 1.1886697112408354e-05 +317.15 1.194991137076894e-05 +319.15 1.201298021099999e-05 +321.15 1.2075904749808127e-05 +323.15 1.2138686088349675e-05 +325.15 1.2201325312568147e-05 +327.15 1.226382349352113e-05 +329.15 1.2326181687697131e-05 +331.15 1.2388400937322568e-05 +333.15 1.2450482270659557e-05 +335.15 1.2512426702294873e-05 +337.15 1.2574235233420227e-05 +339.15 1.2635908852104261e-05 +341.15 1.2697448533556995e-05 +343.15 1.2758855240386152e-05 +345.15 1.282012992284671e-05 +347.15 1.2881273519083055e-05 +349.15 1.2942286955364732e-05 +351.15 1.3003171146315279e-05 +353.15 1.3063926995135216e-05 +355.15 1.3124555393818743e-05 +357.15 1.3185057223364654e-05 +359.15 1.3245433353981949e-05 +361.15 1.3305684645289342e-05 +363.15 1.3365811946510463e-05 +365.15 1.3425816096663347e-05 +367.15 1.3485697924745226e-05 +369.15 1.3545458249912988e-05 +371.15 1.3605097881658395e-05 +373.15 1.3664617619979682e-05 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/compressibility.txt b/pandapipes/properties/biomethane_LPG/compressibility.txt new file mode 100644 index 000000000..7ebaa69ce --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/compressibility.txt @@ -0,0 +1,3 @@ +# source: linear approximation based on CoolProp (http://www.coolprop.org/) +# slope in 1/bar, offset for linear property +-0.0024789428559189412, 0.9962776221466679 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/density.txt b/pandapipes/properties/biomethane_LPG/density.txt new file mode 100644 index 000000000..940ab541b --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/density.txt @@ -0,0 +1,58 @@ +# source: CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, nominal density in kg/Nm^3 at 1.01325 bar +263.15 0.86048646407235 +265.15 0.8539252359131624 +267.15 0.8474642302098054 +269.15 0.8411011428532086 +271.15 0.8348337407285736 +273.15 0.8286598589619569 +275.15 0.8225773982960998 +277.15 0.816584322588365 +279.15 0.8106786564240795 +281.15 0.8048584828390211 +283.15 0.7991219411451699 +285.15 0.7934672248542186 +287.15 0.7878925796936597 +289.15 0.7823963017106081 +291.15 0.7769767354587873 +293.15 0.7716322722643928 +295.15 0.7663613485668018 +297.15 0.7611624443303306 +299.15 0.7560340815234674 +301.15 0.7509748226622115 +303.15 0.7459832694143467 +305.15 0.7410580612616586 +307.15 0.7361978742172673 +309.15 0.7314014195954124 +311.15 0.7266674428311796 +313.15 0.7219947223477784 +315.15 0.7173820685226427 +317.15 0.712828322486563 +319.15 0.7083323552601722 +321.15 0.7038930663980693 +323.15 0.6995093845290987 +325.15 0.695180264243638 +327.15 0.6909046867186862 +329.15 0.6866816585237271 +331.15 0.6825102108281128 +333.15 0.6783893986382189 +335.15 0.6743183000630635 +337.15 0.670296015607147 +339.15 0.6663216674893319 +341.15 0.6623943989866364 +343.15 0.6585133738018817 +345.15 0.6546777754541744 +347.15 0.6508868066912565 +349.15 0.6471396889228147 +351.15 0.6434356616738607 +353.15 0.6397739820573669 +355.15 0.6361539242660609 +357.15 0.6325747790786994 +359.15 0.6290358533891036 +361.15 0.6255364697463401 +363.15 0.6220759659128245 +365.15 0.6186536944370283 +367.15 0.6152690222406079 +369.15 0.6119213302193801 +371.15 0.60861001285761 +373.15 0.6053344778550793 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/der_compressibility.txt b/pandapipes/properties/biomethane_LPG/der_compressibility.txt new file mode 100644 index 000000000..22482b305 --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/der_compressibility.txt @@ -0,0 +1,3 @@ +# source: own calculation based on CoolProp (http://www.coolprop.org/) +# derivative (slope) of compressibility +-0.0024789428559189412 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/gas_composition.txt b/pandapipes/properties/biomethane_LPG/gas_composition.txt new file mode 100644 index 000000000..e30eb54a7 --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/gas_composition.txt @@ -0,0 +1,12 @@ +source: Arbeitsblatt DVGW G 260(A) + +Gas composition (molar fraction): +methane: 90.94% +nitrogen: 0.69 % +carbon dioxide: 2.68 % +oxygen: 0.19 % +propane: 5 % +butane: 0.5 % + + +Wobbe-Index (normal conditions) : 14.9 KWh/m³ \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/heat_capacity.txt b/pandapipes/properties/biomethane_LPG/heat_capacity.txt new file mode 100644 index 000000000..f9f78e48d --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/heat_capacity.txt @@ -0,0 +1,58 @@ +#source CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, isobaric heat capacity in J/(kg K) +263.151976.8823234072695 +265.15 1980.6134982832095 +267.15 1984.416050463013 +269.15 1988.2894370033634 +271.15 1992.2330899146655 +273.15 1996.246416873169 +275.15 2000.328801982753 +277.15 2004.4796065798193 +279.15 2008.6981700751355 +281.15 2012.9838108269525 +283.15 2017.3358270400702 +285.15 2021.753497685928 +287.15 2026.236083439167 +289.15 2030.7828276264033 +291.15 2035.3929571833426 +293.15 2040.0656836165801 +295.15 2044.8002039668168 +297.15 2049.5957017703836 +299.15 2054.4513480163328 +301.15 2059.3663020964914 +303.15 2064.3397127461894 +305.15 2069.370718973518 +307.15 2074.458450975239 +309.15 2079.6020310376007 +311.15 2084.800574420541 +313.15 2090.053190223892 +315.15 2095.358982234797 +317.15 2100.7170497532743 +319.15 2106.126488398847 +321.15 2111.5863908912784 +323.15 2117.0958478222283 +325.15 2122.65394837675 +327.15 2128.2597810582947 +329.15 2133.9124343761173 +331.15 2139.610997511174 +333.15 2145.3545609576 +335.15 2151.142217139677 +337.15 2156.9730610042843 +339.15 2162.8461905888544 +341.15 2168.760707564975 +343.15 2174.7157177577647 +345.15 2180.7103316412727 +347.15 2186.7436648101425 +349.15 2192.814838427854 +351.15 2198.922979651878 +353.15 2205.0672220361303 +355.15 2211.246705911128 +357.15 2217.460578742257 +359.15 2223.707995466675 +361.15 2229.9881188092413 +363.15 2236.300119578022 +365.15 2242.643176939882 +367.15 2249.0164786766545 +369.15 2255.4192214224554 +371.15 2261.8506108826527 +373.15 2268.3098620350665 diff --git a/pandapipes/properties/biomethane_LPG/higher_heating_value.txt b/pandapipes/properties/biomethane_LPG/higher_heating_value.txt new file mode 100644 index 000000000..0f31e255f --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/higher_heating_value.txt @@ -0,0 +1,3 @@ +# source: Arbeitsblatt DVGW G 260(A) +# higher heating value in kWh/kg (at normal conditions) +13.975903614457831 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/lower_heating_value.txt b/pandapipes/properties/biomethane_LPG/lower_heating_value.txt new file mode 100644 index 000000000..e7b41c8d4 --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/lower_heating_value.txt @@ -0,0 +1 @@ +# lower heating value in kWh/kg (at normal conditions) diff --git a/pandapipes/properties/biomethane_LPG/molar_mass.txt b/pandapipes/properties/biomethane_LPG/molar_mass.txt new file mode 100644 index 000000000..9322e972d --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/molar_mass.txt @@ -0,0 +1,2 @@ +# source: CoolProp (http://www.coolprop.org/) kg/kmol +18.518267691999997 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_LPG/viscosity.txt b/pandapipes/properties/biomethane_LPG/viscosity.txt new file mode 100644 index 000000000..226d005ba --- /dev/null +++ b/pandapipes/properties/biomethane_LPG/viscosity.txt @@ -0,0 +1,58 @@ +# source: CoolProp (http://www.coolprop.org/) +# temperature in Kelvin, dynamic viscosity in kg/(m s) +263.15 9.987598418270064e-06 +265.15 1.0054271376713275e-05 +267.15 1.01207712445252e-05 +269.15 1.0187099643189088e-05 +271.15 1.0253258161058564e-05 +273.15 1.0319248354546486e-05 +275.15 1.038507174925251e-05 +277.15 1.0450729841031813e-05 +279.15 1.0516224097009172e-05 +281.15 1.0581555956543026e-05 +283.15 1.064672683214113e-05 +285.15 1.0711738110332342e-05 +287.15 1.0776591152496127e-05 +289.15 1.0841287295653449e-05 +291.15 1.0905827853220495e-05 +293.15 1.097021411572817e-05 +295.15 1.1034447351508859e-05 +297.15 1.109852880735291e-05 +299.15 1.116245970913629e-05 +301.15 1.122624126242086e-05 +303.15 1.1289874653029489e-05 +305.15 1.1353361047596854e-05 +307.15 1.141670159409703e-05 +309.15 1.1479897422350304e-05 +311.15 1.1542949644508997e-05 +313.15 1.1605859355524109e-05 +315.15 1.166862763359458e-05 +317.15 1.1731255540595754e-05 +319.15 1.1793744122496459e-05 +321.15 1.185609440975119e-05 +323.15 1.1918307417708628e-05 +325.15 1.1980384146945096e-05 +327.15 1.2042325583645421e-05 +329.15 1.2104132699940739e-05 +331.15 1.2165806454240284e-05 +333.15 1.2227347791551614e-05 +335.15 1.2288757643789442e-05 +337.15 1.2350036930074347e-05 +339.15 1.2411186557021452e-05 +341.15 1.2472207419019115e-05 +343.15 1.2533100398498824e-05 +345.15 1.2593866366196224e-05 +347.15 1.2654506181403717e-05 +349.15 1.271502069221504e-05 +351.15 1.2775410735762185e-05 +353.15 1.2835677138445082e-05 +355.15 1.2895820716153996e-05 +357.15 1.2955842274485576e-05 +359.15 1.3015742608951777e-05 +361.15 1.3075522505183164e-05 +363.15 1.313518273912608e-05 +365.15 1.3194724077234009e-05 +367.15 1.3254147276653159e-05 +369.15 1.331345308540351e-05 +371.15 1.3372642242554015e-05 +373.15 1.3431715478393082e-05 \ No newline at end of file From bcfac5becdf2ae5719e012ade49766edb2c7e67c Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Thu, 23 Mar 2023 18:31:32 +0100 Subject: [PATCH 015/126] add biomethanes to call_lib and first effort to add docu about biomethane --- doc/source/fluid_properties/composition.csv | 8 +++++ doc/source/fluid_properties/fluids.rst | 30 +++++++++++++++++-- .../compressibility.txt | 0 .../density.txt | 0 .../der_compressibility.txt | 0 .../gas_composition.txt | 0 .../heat_capacity.txt | 0 .../higher_heating_value.txt | 0 .../lower_heating_value.txt | 0 .../molar_mass.txt | 0 .../viscosity.txt | 0 .../compressibility.txt | 0 .../density.txt | 0 .../der_compressibility.txt | 0 .../gas_composition.txt | 0 .../heat_capacity.txt | 0 .../higher_heating_value.txt | 0 .../lower_heating_value.txt | 0 .../molar_mass.txt | 0 .../viscosity.txt | 0 pandapipes/properties/fluids.py | 2 +- 21 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 doc/source/fluid_properties/composition.csv rename pandapipes/properties/{biomethane => biomethane_pure}/compressibility.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/density.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/der_compressibility.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/gas_composition.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/heat_capacity.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/higher_heating_value.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/lower_heating_value.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/molar_mass.txt (100%) rename pandapipes/properties/{biomethane => biomethane_pure}/viscosity.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/compressibility.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/density.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/der_compressibility.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/gas_composition.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/heat_capacity.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/higher_heating_value.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/lower_heating_value.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/molar_mass.txt (100%) rename pandapipes/properties/{biomethane_LPG => biomethane_treated}/viscosity.txt (100%) diff --git a/doc/source/fluid_properties/composition.csv b/doc/source/fluid_properties/composition.csv new file mode 100644 index 000000000..eb931ab4b --- /dev/null +++ b/doc/source/fluid_properties/composition.csv @@ -0,0 +1,8 @@ +;**Biomethane pure**;**Biomethane treated** +methane; 96.15% ; 90.94% +nitrogen; 0.75 % ;0.69 % +carbon dioxide; 2.9 % ;2.68 % +oxygen; 0.2 % ; 0.19 % +propane; 0 ; 5 % +butane; 0 ; 0.5 % +Wobbe-Index (normal conditions) :math:`[\frac{KWh}{m^3}]` ; 13.9 ; 14.9 \ No newline at end of file diff --git a/doc/source/fluid_properties/fluids.rst b/doc/source/fluid_properties/fluids.rst index 2689b0049..dfe800456 100644 --- a/doc/source/fluid_properties/fluids.rst +++ b/doc/source/fluid_properties/fluids.rst @@ -4,9 +4,35 @@ Fluid Properties in pandapipes The pipelines in the pandapipes network are run with a certain fluid. This can be chosen individually for the net from the fluid library or by own creation. The fluids -are defined by certain properties. In the fluid library currently high and low calorific natural -gas (hgas and lgas), hydrogen, methane, water and air are implemented with default properties. +are defined by certain properties. +The following fluids currently exist in the library: + +- `hgas` and `lgas` (high and low calorific natural gas), +- `hydrogen`, +- `methane`, +- `water`, +- `biomethane_pure` and `biomathane_treated`, +- `air`. + + +.. Note:: + **Biomethanes**: + A particularity of injecting biomethane in the gas grid in Germany is the addition of LPG to enhance + the Wobbe-Index and the heating value of the gas and thus make it equivalent to the (high-calorific) natural gas transported + in the grid. This addition is done in a gas treatment unit (Biogaseinspeiseanlage) upstream of the biomethane + feed-in junction. + +.. + tabularcolumns:: |l|l|l| + +.. csv-table:: + :file: composition.csv + :delim: ; + :widths: 10, 10, 10 + +.. + IDEALLY: embed the table in the box or decrease its size. The Fluid Class =============== diff --git a/pandapipes/properties/biomethane/compressibility.txt b/pandapipes/properties/biomethane_pure/compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane/compressibility.txt rename to pandapipes/properties/biomethane_pure/compressibility.txt diff --git a/pandapipes/properties/biomethane/density.txt b/pandapipes/properties/biomethane_pure/density.txt similarity index 100% rename from pandapipes/properties/biomethane/density.txt rename to pandapipes/properties/biomethane_pure/density.txt diff --git a/pandapipes/properties/biomethane/der_compressibility.txt b/pandapipes/properties/biomethane_pure/der_compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane/der_compressibility.txt rename to pandapipes/properties/biomethane_pure/der_compressibility.txt diff --git a/pandapipes/properties/biomethane/gas_composition.txt b/pandapipes/properties/biomethane_pure/gas_composition.txt similarity index 100% rename from pandapipes/properties/biomethane/gas_composition.txt rename to pandapipes/properties/biomethane_pure/gas_composition.txt diff --git a/pandapipes/properties/biomethane/heat_capacity.txt b/pandapipes/properties/biomethane_pure/heat_capacity.txt similarity index 100% rename from pandapipes/properties/biomethane/heat_capacity.txt rename to pandapipes/properties/biomethane_pure/heat_capacity.txt diff --git a/pandapipes/properties/biomethane/higher_heating_value.txt b/pandapipes/properties/biomethane_pure/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane/higher_heating_value.txt rename to pandapipes/properties/biomethane_pure/higher_heating_value.txt diff --git a/pandapipes/properties/biomethane/lower_heating_value.txt b/pandapipes/properties/biomethane_pure/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane/lower_heating_value.txt rename to pandapipes/properties/biomethane_pure/lower_heating_value.txt diff --git a/pandapipes/properties/biomethane/molar_mass.txt b/pandapipes/properties/biomethane_pure/molar_mass.txt similarity index 100% rename from pandapipes/properties/biomethane/molar_mass.txt rename to pandapipes/properties/biomethane_pure/molar_mass.txt diff --git a/pandapipes/properties/biomethane/viscosity.txt b/pandapipes/properties/biomethane_pure/viscosity.txt similarity index 100% rename from pandapipes/properties/biomethane/viscosity.txt rename to pandapipes/properties/biomethane_pure/viscosity.txt diff --git a/pandapipes/properties/biomethane_LPG/compressibility.txt b/pandapipes/properties/biomethane_treated/compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/compressibility.txt rename to pandapipes/properties/biomethane_treated/compressibility.txt diff --git a/pandapipes/properties/biomethane_LPG/density.txt b/pandapipes/properties/biomethane_treated/density.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/density.txt rename to pandapipes/properties/biomethane_treated/density.txt diff --git a/pandapipes/properties/biomethane_LPG/der_compressibility.txt b/pandapipes/properties/biomethane_treated/der_compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/der_compressibility.txt rename to pandapipes/properties/biomethane_treated/der_compressibility.txt diff --git a/pandapipes/properties/biomethane_LPG/gas_composition.txt b/pandapipes/properties/biomethane_treated/gas_composition.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/gas_composition.txt rename to pandapipes/properties/biomethane_treated/gas_composition.txt diff --git a/pandapipes/properties/biomethane_LPG/heat_capacity.txt b/pandapipes/properties/biomethane_treated/heat_capacity.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/heat_capacity.txt rename to pandapipes/properties/biomethane_treated/heat_capacity.txt diff --git a/pandapipes/properties/biomethane_LPG/higher_heating_value.txt b/pandapipes/properties/biomethane_treated/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/higher_heating_value.txt rename to pandapipes/properties/biomethane_treated/higher_heating_value.txt diff --git a/pandapipes/properties/biomethane_LPG/lower_heating_value.txt b/pandapipes/properties/biomethane_treated/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/lower_heating_value.txt rename to pandapipes/properties/biomethane_treated/lower_heating_value.txt diff --git a/pandapipes/properties/biomethane_LPG/molar_mass.txt b/pandapipes/properties/biomethane_treated/molar_mass.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/molar_mass.txt rename to pandapipes/properties/biomethane_treated/molar_mass.txt diff --git a/pandapipes/properties/biomethane_LPG/viscosity.txt b/pandapipes/properties/biomethane_treated/viscosity.txt similarity index 100% rename from pandapipes/properties/biomethane_LPG/viscosity.txt rename to pandapipes/properties/biomethane_treated/viscosity.txt diff --git a/pandapipes/properties/fluids.py b/pandapipes/properties/fluids.py index db0d045ed..9721fa3cd 100644 --- a/pandapipes/properties/fluids.py +++ b/pandapipes/properties/fluids.py @@ -669,7 +669,7 @@ def linear_property(prop): os.path.join(pp_dir, "properties", fluid_name, prop + ".txt")) liquids = ["water"] - gases = ["air", "lgas", "hgas", "hydrogen", "methane"] + gases = ["air", "lgas", "hgas", "hydrogen", "methane", "biomethane_pure", "biomethane_treated"] if fluid_name == "natural_gas": logger.error("'natural_gas' is ambigious. Please choose 'hgas' or 'lgas' " From 9d7b247d274213f13513bfce545148f30ced0b35 Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Fri, 24 Mar 2023 12:19:50 +0100 Subject: [PATCH 016/126] added the HHVS to the gas_compostions.txt --- pandapipes/properties/biomethane_pure/gas_composition.txt | 3 ++- pandapipes/properties/biomethane_pure/higher_heating_value.txt | 2 +- pandapipes/properties/biomethane_treated/gas_composition.txt | 3 ++- .../properties/biomethane_treated/higher_heating_value.txt | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandapipes/properties/biomethane_pure/gas_composition.txt b/pandapipes/properties/biomethane_pure/gas_composition.txt index f94092840..a6e56cccb 100644 --- a/pandapipes/properties/biomethane_pure/gas_composition.txt +++ b/pandapipes/properties/biomethane_pure/gas_composition.txt @@ -6,4 +6,5 @@ nitrogen: 0.75 % carbon dioxide: 2.9 % oxygen: 0.2 % -Wobbe-Index (normal conditions) : 13.9 KWh/m³ \ No newline at end of file +Wobbe-Index (normal conditions) : 13.9 KWh/m³ +HHV (normal conditions) : 10.6 KWh/m³ \ No newline at end of file diff --git a/pandapipes/properties/biomethane_pure/higher_heating_value.txt b/pandapipes/properties/biomethane_pure/higher_heating_value.txt index 8167b3888..56c79ba77 100644 --- a/pandapipes/properties/biomethane_pure/higher_heating_value.txt +++ b/pandapipes/properties/biomethane_pure/higher_heating_value.txt @@ -1,3 +1,3 @@ # source: Arbeitsblatt DVGW G 260(A) # higher heating value in kWh/kg (at normal conditions) -13.94736842105263 \ No newline at end of file +13.96188746019903 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_treated/gas_composition.txt b/pandapipes/properties/biomethane_treated/gas_composition.txt index e30eb54a7..c529c1d97 100644 --- a/pandapipes/properties/biomethane_treated/gas_composition.txt +++ b/pandapipes/properties/biomethane_treated/gas_composition.txt @@ -9,4 +9,5 @@ propane: 5 % butane: 0.5 % -Wobbe-Index (normal conditions) : 14.9 KWh/m³ \ No newline at end of file +Wobbe-Index (normal conditions) : 14.9 KWh/m³ +HHV (normal conditions) : 11.6 KWh/m³ \ No newline at end of file diff --git a/pandapipes/properties/biomethane_treated/higher_heating_value.txt b/pandapipes/properties/biomethane_treated/higher_heating_value.txt index 0f31e255f..dc86eb4a5 100644 --- a/pandapipes/properties/biomethane_treated/higher_heating_value.txt +++ b/pandapipes/properties/biomethane_treated/higher_heating_value.txt @@ -1,3 +1,3 @@ # source: Arbeitsblatt DVGW G 260(A) # higher heating value in kWh/kg (at normal conditions) -13.975903614457831 \ No newline at end of file +13.998505990782578 \ No newline at end of file From 29d5dbf1b29cabd24ed4fcd5d6c4d47fcdecdcd9 Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Fri, 24 Mar 2023 12:21:15 +0100 Subject: [PATCH 017/126] added biomethane to the doc, docstrings and to the tutos. --- doc/source/fluid_properties/composition.csv | 7 ++-- doc/source/fluid_properties/create_fluids.rst | 11 ++++-- doc/source/fluid_properties/fluids.rst | 30 +++++++--------- pandapipes/create.py | 4 +-- tutorials/creating_a_simple_network.ipynb | 36 +++++-------------- tutorials/minimal_example.ipynb | 4 ++- 6 files changed, 38 insertions(+), 54 deletions(-) diff --git a/doc/source/fluid_properties/composition.csv b/doc/source/fluid_properties/composition.csv index eb931ab4b..6f88aa3f0 100644 --- a/doc/source/fluid_properties/composition.csv +++ b/doc/source/fluid_properties/composition.csv @@ -3,6 +3,7 @@ methane; 96.15% ; 90.94% nitrogen; 0.75 % ;0.69 % carbon dioxide; 2.9 % ;2.68 % oxygen; 0.2 % ; 0.19 % -propane; 0 ; 5 % -butane; 0 ; 0.5 % -Wobbe-Index (normal conditions) :math:`[\frac{KWh}{m^3}]` ; 13.9 ; 14.9 \ No newline at end of file +propane; 0 % ; 5 % +butane; 0 %; 0.5 % +Wobbe-Index (normal conditions) :math:`[\frac{KWh}{m^3}]` ; 13.9 ; 14.9 +HHV (normal conditions) :math:`[\frac{KWh}{m^3}]`; 10.6 ; 11.6 \ No newline at end of file diff --git a/doc/source/fluid_properties/create_fluids.rst b/doc/source/fluid_properties/create_fluids.rst index 3c5dd9d88..32efef516 100644 --- a/doc/source/fluid_properties/create_fluids.rst +++ b/doc/source/fluid_properties/create_fluids.rst @@ -10,8 +10,15 @@ Fluid from Library ================== In the fluid library some default fluids are already implemented. Currently it is -possible to work with the default fluids high and low calorific natural -gas (hgas and lgas), hydrogen, methane, water and air. The values are loaded from txt-files in +possible to work with the default fluids: + +- ``hgas`` and ``lgas`` (high and low calorific natural gas), +- ``hydrogen``, +- ``methane``, +- ``water``, +- ``biomethane_pure`` and ``biomathane_treated`` (see `here `_ for the compositions), +- ``air``. +The values are loaded from txt-files in the 'pandapipes/properties/[fluid name]' folder. One of these default fluids can be created and added to an existing network by calling the following function. diff --git a/doc/source/fluid_properties/fluids.rst b/doc/source/fluid_properties/fluids.rst index dfe800456..d3e63a038 100644 --- a/doc/source/fluid_properties/fluids.rst +++ b/doc/source/fluid_properties/fluids.rst @@ -8,31 +8,25 @@ are defined by certain properties. The following fluids currently exist in the library: -- `hgas` and `lgas` (high and low calorific natural gas), -- `hydrogen`, -- `methane`, -- `water`, -- `biomethane_pure` and `biomathane_treated`, -- `air`. +- ``hgas`` and ``lgas`` (high and low calorific natural gas), +- ``hydrogen``, +- ``methane``, +- ``water``, +- ``biomethane_pure`` and ``biomathane_treated`` (compositions below) +- ``air``. .. Note:: - **Biomethanes**: + **Biomethane(s)**: A particularity of injecting biomethane in the gas grid in Germany is the addition of LPG to enhance the Wobbe-Index and the heating value of the gas and thus make it equivalent to the (high-calorific) natural gas transported in the grid. This addition is done in a gas treatment unit (Biogaseinspeiseanlage) upstream of the biomethane - feed-in junction. + feed-in junction. The properties of the biomethane(s) were computed based on the package `CoolProp `_. -.. - tabularcolumns:: |l|l|l| - -.. csv-table:: - :file: composition.csv - :delim: ; - :widths: 10, 10, 10 - -.. - IDEALLY: embed the table in the box or decrease its size. + .. csv-table:: + :file: composition.csv + :delim: ; + :widths: 10, 10, 10 The Fluid Class =============== diff --git a/pandapipes/create.py b/pandapipes/create.py index ba4591a16..dd3746ff5 100644 --- a/pandapipes/create.py +++ b/pandapipes/create.py @@ -1629,8 +1629,8 @@ def create_heat_exchangers(net, from_junctions, to_junctions, diameter_m, qext_w def create_fluid_from_lib(net, name, overwrite=True): """ Creates a fluid from library (if there is an entry) and sets net["fluid"] to this value. - Currently, existing fluids in the library are: "hgas", "lgas", "hydrogen", "methane", "water", - "air". + Currently, existing fluids in the library are: "hgas", "lgas", "hydrogen", "methane", "water","biomethane_pure", + "biomethane_treated", "air". :param net: The net for which this fluid should be created :type net: pandapipesNet diff --git a/tutorials/creating_a_simple_network.ipynb b/tutorials/creating_a_simple_network.ipynb index 8d81ac9d7..632540db9 100644 --- a/tutorials/creating_a_simple_network.ipynb +++ b/tutorials/creating_a_simple_network.ipynb @@ -36,8 +36,8 @@ "We have to state the name of the fluid for the network. In pandapipes, some fluids are already\n", "pre-defined, e.g. hgas, lgas\n", "(high and low calorific natural gas), hydrogen,\n", - "water, and air, but you can\n", - "also create your own fluid if you prefer (tutorial in preparation).\n", + "water, biomethane_pure, biomethane_treated (see [here](https://pandapipes.readthedocs.io/en/latest/fluid_properties/fluids.html) for the composition) and air. It is\n", + "also possible to create a fluid if needed (tutorial in preparation).\n", "\n", "In this example, we will create a medium pressure gas network and choose lgas from the predefined fluids in pandapipes." ] @@ -372,11 +372,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, + "metadata": {}, "outputs": [], "source": [ "pp.pipeflow(net)" @@ -384,11 +380,7 @@ }, { "cell_type": "markdown", - "metadata": { - "pycharm": { - "name": "#%% md\n" - } - }, + "metadata": {}, "source": [ "The results are written to `res_...` tables. They were added to the `net`container. " ] @@ -396,11 +388,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, + "metadata": {}, "outputs": [], "source": [ "net # result tables have been added to the net " @@ -409,11 +397,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, + "metadata": {}, "outputs": [], "source": [ "net.res_junction # calculated pressure and temperature at junctions" @@ -422,11 +406,7 @@ { "cell_type": "code", "execution_count": null, - "metadata": { - "pycharm": { - "name": "#%%\n" - } - }, + "metadata": {}, "outputs": [], "source": [ "net.res_pipe # velocities, mass flows through pipes and other results\n", @@ -455,4 +435,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} diff --git a/tutorials/minimal_example.ipynb b/tutorials/minimal_example.ipynb index a8d639ac7..bd341a31a 100644 --- a/tutorials/minimal_example.ipynb +++ b/tutorials/minimal_example.ipynb @@ -49,6 +49,8 @@ " - hgas\n", " - hydrogen\n", " - water\n", + " - biomethane_pure\n", + " - biomethane_treated (see [here](https://pandapipes.readthedocs.io/en/latest/fluid_properties/fluids.html) for the composition)\n", " - air\n", "\n", "And that the predefined valve element is an ideal valve. " @@ -328,4 +330,4 @@ }, "nbformat": 4, "nbformat_minor": 2 -} \ No newline at end of file +} From 13e7e72696027a47cebb6024d5a0acfce178bf3d Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Fri, 24 Mar 2023 12:36:59 +0100 Subject: [PATCH 018/126] slight modification in a tuto --- tutorials/minimal_example.ipynb | 155 ++++++-------------------------- 1 file changed, 26 insertions(+), 129 deletions(-) diff --git a/tutorials/minimal_example.ipynb b/tutorials/minimal_example.ipynb index bd341a31a..8701fc6b2 100644 --- a/tutorials/minimal_example.ipynb +++ b/tutorials/minimal_example.ipynb @@ -17,7 +17,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -44,14 +44,14 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Note that the fluid used here is lgas. You can find 5 predefined fluids in pandapipes:\n", - " - lgas\n", - " - hgas\n", - " - hydrogen\n", - " - water\n", - " - biomethane_pure\n", - " - biomethane_treated (see [here](https://pandapipes.readthedocs.io/en/latest/fluid_properties/fluids.html) for the composition)\n", - " - air\n", + "Note that the fluid used here is ``lgas`` (low-calorific natural gas). You can find 7 predefined fluids in pandapipes:\n", + "- ``lgas`` (low-calorific natural gas)\n", + "- ``hgas`` (high-calorific natural gas)\n", + "- ``hydrogen``\n", + "- ``water``\n", + "- ``biomethane_pure``\n", + "- ``biomethane_treated`` (see [here](https://pandapipes.readthedocs.io/en/latest/fluid_properties/fluids.html) for the composition)\n", + "- ``air``\n", "\n", "And that the predefined valve element is an ideal valve. " ] @@ -67,57 +67,27 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " name pn_bar tfluid_k height_m in_service type\n0 Junction 1 1.05 293.15 0.0 True junction\n1 Junction 2 1.05 293.15 0.0 True junction\n2 Junction 3 1.05 293.15 0.0 True junction", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
namepn_bartfluid_kheight_min_servicetype
0Junction 11.05293.150.0Truejunction
1Junction 21.05293.150.0Truejunction
2Junction 31.05293.150.0Truejunction
\n
" - }, - "execution_count": 2, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.junction" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " name from_junction to_junction std_type length_km diameter_m k_mm \\\n0 Pipe 1 0 1 None 0.1 0.05 1.0 \n\n loss_coefficient alpha_w_per_m2k text_k qext_w sections in_service \\\n0 0.0 0.0 293.0 0.0 1 True \n\n type \n0 pipe ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
namefrom_junctionto_junctionstd_typelength_kmdiameter_mk_mmloss_coefficientalpha_w_per_m2ktext_kqext_wsectionsin_servicetype
0Pipe 101None0.10.051.00.00.0293.00.01Truepipe
\n
" - }, - "execution_count": 3, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.pipe" ] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " name junction p_bar t_k in_service type\n0 Grid Connection 0 1.1 293.15 True pt", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
namejunctionp_bart_kin_servicetype
0Grid Connection01.1293.15Truept
\n
" - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.ext_grid" ] @@ -133,26 +103,9 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "hp.pandapipes.pipeflow - INFO: niter 0\n", - "hp.pandapipes.pipeflow - INFO: niter 1\n", - "hp.pandapipes.pipeflow - INFO: niter 2\n", - "hp.pandapipes.pipeflow - INFO: niter 3\n", - "hp.pandapipes.pipeflow - INFO: ---------------------------------------------------------------------------------\n", - "hp.pandapipes.pipeflow - INFO: Calculation completed. Preparing results...\n", - "hp.pandapipes.pipeflow - INFO: Converged after 4 iterations.\n", - "hp.pandapipes.pipeflow - INFO: Norm of residual: 1.6351116571833302e-08\n", - "hp.pandapipes.pipeflow - INFO: tol_p: 0.0001\n", - "hp.pandapipes.pipeflow - INFO: tol_v: 0.0001\n" - ] - } - ], + "outputs": [], "source": [ "pp.pipeflow(net)" ] @@ -166,19 +119,9 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " p_bar t_k\n0 1.100000 293.15\n1 0.913916 293.15\n2 0.913916 293.15", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
p_bart_k
01.100000293.15
10.913916293.15
20.913916293.15
\n
" - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.res_junction" ] @@ -192,19 +135,9 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " v_from_m_per_s v_to_m_per_s v_mean_m_per_s p_from_bar p_to_bar \\\n0 15.766074 17.295535 16.483877 1.1 0.913916 \n\n t_from_k t_to_k mdot_from_kg_per_s mdot_to_kg_per_s vdot_norm_m3_per_s \\\n0 293.15 293.15 0.045 -0.045 0.06044 \n\n reynolds lambda normfactor_from normfactor_to \n0 96710.314701 0.049222 0.512189 0.561877 ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
v_from_m_per_sv_to_m_per_sv_mean_m_per_sp_from_barp_to_bart_from_kt_to_kmdot_from_kg_per_smdot_to_kg_per_svdot_norm_m3_per_sreynoldslambdanormfactor_fromnormfactor_to
015.76607417.29553516.4838771.10.913916293.15293.150.045-0.0450.0604496710.3147010.0492220.5121890.561877
\n
" - }, - "execution_count": 7, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.res_pipe" ] @@ -220,7 +153,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -246,37 +179,11 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": { "scrolled": true }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "hp.pandapipes.pipeflow_setup - INFO: Setting the following nodes out of service for hydraulics calculation in connectivity check:\n", - "In table junction: [2]\n", - "hp.pandapipes.pipeflow - INFO: niter 0\n", - "hp.pandapipes.pipeflow - INFO: niter 1\n", - "hp.pandapipes.pipeflow - INFO: ---------------------------------------------------------------------------------\n", - "hp.pandapipes.pipeflow - INFO: Calculation completed. Preparing results...\n", - "hp.pandapipes.pipeflow - INFO: Converged after 2 iterations.\n", - "hp.pandapipes.pipeflow - INFO: Norm of residual: 6.635561679383765e-07\n", - "hp.pandapipes.pipeflow - INFO: tol_p: 0.0001\n", - "hp.pandapipes.pipeflow - INFO: tol_v: 0.0001\n" - ] - }, - { - "data": { - "text/plain": " p_bar t_k\n0 1.1 293.15\n1 1.1 293.15\n2 NaN NaN", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
p_bart_k
01.1293.15
11.1293.15
2NaNNaN
\n
" - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "pp.pipeflow(net)\n", "net.res_junction" @@ -291,19 +198,9 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": " v_from_m_per_s v_to_m_per_s v_mean_m_per_s p_from_bar p_to_bar \\\n0 0.0 0.0 0.0 1.1 1.1 \n\n t_from_k t_to_k mdot_from_kg_per_s mdot_to_kg_per_s vdot_norm_m3_per_s \\\n0 293.15 293.15 0.0 -0.0 0.0 \n\n reynolds lambda normfactor_from normfactor_to \n0 0.0 0.04856 0.512189 0.512189 ", - "text/html": "
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
v_from_m_per_sv_to_m_per_sv_mean_m_per_sp_from_barp_to_bart_from_kt_to_kmdot_from_kg_per_smdot_to_kg_per_svdot_norm_m3_per_sreynoldslambdanormfactor_fromnormfactor_to
00.00.00.01.11.1293.15293.150.0-0.00.00.00.048560.5121890.512189
\n
" - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "net.res_pipe" ] From de3210c2e71af791da137ac47107fa8e29613d41 Mon Sep 17 00:00:00 2001 From: hkoertge Date: Fri, 12 May 2023 15:35:15 +0200 Subject: [PATCH 019/126] updated find_packages() to find_namespace_packages() closes #535 --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0c3ff1377..196ecf5ba 100644 --- a/setup.py +++ b/setup.py @@ -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. -from setuptools import find_packages +from setuptools import find_namespace_packages from setuptools import setup import re @@ -49,7 +49,7 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "python-igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=find_packages(), + packages=find_namespace_packages(), include_package_data=True, classifiers=classifiers ) From 70c5a843284862b38fcb268f1ef837fad6dd1914 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 16 May 2023 12:19:47 +0200 Subject: [PATCH 020/126] separation of connectivity check for hydraulic and thermal calculation: - 2 function calls to connectivity check and pit reduction in case of "all" mode - result extraction from active pit to pit done after both calculations separately - all result extraction functions (also for all components) must consider that the connectivity lookups now differ between hydraulics and thermal calculation --- .../abstract_models/base_component.py | 8 +- .../abstract_models/branch_models.py | 2 +- .../branch_w_internals_models.py | 2 +- .../branch_wo_internals_models.py | 2 +- .../branch_wzerolength_models.py | 2 +- .../abstract_models/circulation_pump.py | 8 +- .../abstract_models/const_flow_models.py | 12 +- .../abstract_models/node_element_models.py | 2 +- .../abstract_models/node_models.py | 2 +- .../component_models/ext_grid_component.py | 8 +- .../flow_control_component.py | 24 +-- .../heat_exchanger_component.py | 22 ++- .../component_models/junction_component.py | 45 +++-- pandapipes/component_models/pipe_component.py | 26 +-- .../pressure_control_component.py | 24 +-- pandapipes/component_models/pump_component.py | 24 +-- .../component_models/valve_component.py | 21 ++- pandapipes/pf/pipeflow_setup.py | 71 ++++---- pandapipes/pf/result_extraction.py | 163 ++++++++++-------- pandapipes/pipeflow.py | 43 +++-- 20 files changed, 283 insertions(+), 228 deletions(-) diff --git a/pandapipes/component_models/abstract_models/base_component.py b/pandapipes/component_models/abstract_models/base_component.py index cdfb0f091..b5ce3a601 100644 --- a/pandapipes/component_models/abstract_models/base_component.py +++ b/pandapipes/component_models/abstract_models/base_component.py @@ -33,7 +33,7 @@ def init_results(cls, net): return res_table @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. @@ -43,10 +43,8 @@ def extract_results(cls, net, options, branch_results, nodes_connected, branches :type options: :param branch_results: :type branch_results: - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: + :param mode: + :type mode: :return: No Output. """ raise NotImplementedError diff --git a/pandapipes/component_models/abstract_models/branch_models.py b/pandapipes/component_models/abstract_models/branch_models.py index 3ee411465..4eeac9cc6 100644 --- a/pandapipes/component_models/abstract_models/branch_models.py +++ b/pandapipes/component_models/abstract_models/branch_models.py @@ -159,5 +159,5 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): raise NotImplementedError @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/pandapipes/component_models/abstract_models/branch_w_internals_models.py index 6861223ee..1b88f0eac 100644 --- a/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -217,7 +217,7 @@ def get_internal_pipe_number(cls, net): return np.array(net[cls.table_name()].sections.values) @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError @classmethod diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index 0efa325a9..106895d50 100644 --- a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -100,5 +100,5 @@ def get_connected_node_type(cls): raise NotImplementedError @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError diff --git a/pandapipes/component_models/abstract_models/branch_wzerolength_models.py b/pandapipes/component_models/abstract_models/branch_wzerolength_models.py index dc224f8a1..b9da3028f 100644 --- a/pandapipes/component_models/abstract_models/branch_wzerolength_models.py +++ b/pandapipes/component_models/abstract_models/branch_wzerolength_models.py @@ -61,7 +61,7 @@ def create_pit_branch_entries(cls, net, branch_pit): return branch_wzerolength_pit @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError @classmethod diff --git a/pandapipes/component_models/abstract_models/circulation_pump.py b/pandapipes/component_models/abstract_models/circulation_pump.py index cbcbfb602..767dc3368 100644 --- a/pandapipes/component_models/abstract_models/circulation_pump.py +++ b/pandapipes/component_models/abstract_models/circulation_pump.py @@ -97,14 +97,12 @@ def calculate_temperature_lift(cls, net, pipe_pit, node_pit): raise NotImplementedError @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: + :param mode: + :type mode: :param branch_results: :type branch_results: :param net: The pandapipes network diff --git a/pandapipes/component_models/abstract_models/const_flow_models.py b/pandapipes/component_models/abstract_models/const_flow_models.py index c49a58ec4..a10a4d0e4 100644 --- a/pandapipes/component_models/abstract_models/const_flow_models.py +++ b/pandapipes/component_models/abstract_models/const_flow_models.py @@ -51,14 +51,12 @@ def create_pit_node_entries(cls, net, node_pit): node_pit[index, LOAD] += loads_sum @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: + :param mode: + :type mode: :param branch_results: :type branch_results: :param net: The pandapipes network @@ -74,8 +72,8 @@ def extract_results(cls, net, options, branch_results, nodes_connected, branches is_loads = loads.in_service.values fj, tj = get_lookup(net, "node", "from_to")[cls.get_connected_node_type().table_name()] junct_pit = net["_pit"]["node"][fj:tj, :] - nodes_connected = get_lookup(net, "node", "active")[fj:tj] - is_juncts = np.isin(loads.junction.values, junct_pit[nodes_connected, ELEMENT_IDX]) + nodes_connected_hyd = get_lookup(net, "node", "active_hydraulics")[fj:tj] + is_juncts = np.isin(loads.junction.values, junct_pit[nodes_connected_hyd, ELEMENT_IDX]) is_calc = is_loads & is_juncts res_table["mdot_kg_per_s"].values[is_calc] = loads.mdot_kg_per_s.values[is_calc] \ diff --git a/pandapipes/component_models/abstract_models/node_element_models.py b/pandapipes/component_models/abstract_models/node_element_models.py index 04e594e2d..0792fa531 100644 --- a/pandapipes/component_models/abstract_models/node_element_models.py +++ b/pandapipes/component_models/abstract_models/node_element_models.py @@ -51,5 +51,5 @@ def create_pit_node_entries(cls, net, node_pit): raise NotImplementedError @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError diff --git a/pandapipes/component_models/abstract_models/node_models.py b/pandapipes/component_models/abstract_models/node_models.py index 5a917bef9..0ce18e4a9 100644 --- a/pandapipes/component_models/abstract_models/node_models.py +++ b/pandapipes/component_models/abstract_models/node_models.py @@ -66,5 +66,5 @@ def get_result_table(cls, net): raise NotImplementedError @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError diff --git a/pandapipes/component_models/ext_grid_component.py b/pandapipes/component_models/ext_grid_component.py index 9570f51e1..d78028320 100644 --- a/pandapipes/component_models/ext_grid_component.py +++ b/pandapipes/component_models/ext_grid_component.py @@ -62,20 +62,18 @@ def create_pit_node_entries(cls, net, node_pit): return ext_grids, press @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: :param branch_results: :type branch_results: :param net: The pandapipes network :type net: pandapipesNet :param options: :type options: + :param mode: + :type mode: :return: No Output. """ ext_grids = net[cls.table_name()] diff --git a/pandapipes/component_models/flow_control_component.py b/pandapipes/component_models/flow_control_component.py index d42f58155..2e08137f2 100644 --- a/pandapipes/component_models/flow_control_component.py +++ b/pandapipes/component_models/flow_control_component.py @@ -5,8 +5,8 @@ import numpy as np from numpy import dtype -from pandapipes.component_models.junction_component import Junction from pandapipes.component_models.abstract_models import BranchWZeroLengthComponent, get_fluid +from pandapipes.component_models.junction_component import Junction from pandapipes.idx_branch import D, AREA, TL, JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, VINIT, \ RHO, LOAD_VEC_BRANCHES, ELEMENT_IDX from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -83,24 +83,28 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): branch_component_pit[:, TL] = 0 @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): required_results = [ - ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("t_from_k", "temp_from"), - ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to"), ("mdot_from_kg_per_s", "mf_from"), - ("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), ("reynolds", "reynolds") + ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), + ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), + ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), + ("reynolds", "reynolds", False) ] if get_fluid(net).is_gas: required_results.extend([ - ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), - ("v_mean_m_per_s", "v_gas_mean"), ("normfactor_from", "normfactor_from"), - ("normfactor_to", "normfactor_to") + ("v_from_m_per_s", "v_gas_from", False), + ("v_to_m_per_s", "v_gas_to", False), + ("v_mean_m_per_s", "v_gas_mean", False), + ("normfactor_from", "normfactor_from", False), + ("normfactor_to", "normfactor_to", False) ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps")]) + required_results.extend([("v_mean_m_per_s", "v_mps", False)]) extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) @classmethod def get_component_input(cls): diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index abbb2259e..6bed45017 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -60,24 +60,28 @@ def create_pit_branch_entries(cls, net, branch_pit): heat_exchanger_pit[:, T_OUT] = 307 @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): required_results = [ - ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("t_from_k", "temp_from"), - ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to"), ("mdot_from_kg_per_s", "mf_from"), - ("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), ("reynolds", "reynolds") + ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), + ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), + ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), + ("reynolds", "reynolds", False) ] if get_fluid(net).is_gas: required_results.extend([ - ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), - ("v_mean_m_per_s", "v_gas_mean"), ("normfactor_from", "normfactor_from"), - ("normfactor_to", "normfactor_to") + ("v_from_m_per_s", "v_gas_from", False), + ("v_to_m_per_s", "v_gas_to", False), + ("v_mean_m_per_s", "v_gas_mean", False), + ("normfactor_from", "normfactor_from", False), + ("normfactor_to", "normfactor_to", False) ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps")]) + required_results.extend([("v_mean_m_per_s", "v_mps", False)]) extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) @classmethod def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): diff --git a/pandapipes/component_models/junction_component.py b/pandapipes/component_models/junction_component.py index 3426fae0c..fdf2a22ab 100644 --- a/pandapipes/component_models/junction_component.py +++ b/pandapipes/component_models/junction_component.py @@ -88,37 +88,44 @@ def create_pit_node_entries(cls, net, node_pit): junction_pit[:, ACTIVE_ND] = junctions.in_service.values @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: - :param branch_results: - :type branch_results: + :param mode: + :type mode: :param net: The pandapipes network :type net: pandapipesNet :param options: :type options: + :param branch_results: + :type branch_results: + :param mode: + :type mode: :return: No Output. """ res_table = net["res_" + cls.table_name()] f, t = get_lookup(net, "node", "from_to")[cls.table_name()] - fa, ta = get_lookup(net, "node", "from_to_active")[cls.table_name()] - - junction_pit = net["_active_pit"]["node"][fa:ta, :] - junctions_active = get_lookup(net, "node", "active")[f:t] - - if np.any(junction_pit[:, PINIT] < 0): - warn(UserWarning('Pipeflow converged, however, the results are physically incorrect ' - 'as pressure is negative at nodes %s' - % junction_pit[junction_pit[:, PINIT] < 0, ELEMENT_IDX])) - - res_table["p_bar"].values[junctions_active] = junction_pit[:, PINIT] - res_table["t_k"].values[junctions_active] = junction_pit[:, TINIT] + junction_pit = net["_pit"]["node"][f:t, :] + + if mode in ["hydraulics", "all"]: + junctions_connected_hydraulic = get_lookup(net, "node", "active_hydraulics")[f:t] + + if np.any(junction_pit[junctions_connected_hydraulic, PINIT] < 0): + warn(UserWarning('Pipeflow converged, however, the results are physically incorrect ' + 'as pressure is negative at nodes %s' + % junction_pit[junction_pit[:, PINIT] < 0, ELEMENT_IDX])) + + # res_table["p_bar"].values[junctions_connected_hydraulic] = junction_pit[:, PINIT] + # if mode == "hydraulics": + # res_table["t_k"].values[junctions_connected_hydraulic] = junction_pit[:, TINIT] + # + # if mode in ["heat", "all"]: + # junctions_connected_ht = get_lookup(net, "node", "active_heat_transfer")[f:t] + # res_table["t_k"].values[junctions_connected_ht] = junction_pit[:, TINIT] + res_table["p_bar"].values[:] = junction_pit[:, PINIT] + res_table["t_k"].values[:] = junction_pit[:, TINIT] @classmethod def get_component_input(cls): diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index f8f38aa18..f9555af27 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -170,28 +170,32 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): branch_component_pit[:, TL] = 0 @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): - res_nodes_from = [("p_from_bar", "p_from"), ("t_from_k", "temp_from"), - ("mdot_from_kg_per_s", "mf_from")] - res_nodes_to = [("p_to_bar", "p_to"), ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to")] - res_mean = [("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), ("reynolds", "reynolds")] + def extract_results(cls, net, options, branch_results, mode): + res_nodes_from = [("p_from_bar", "p_from", False), ("t_from_k", "temp_from", True), + ("mdot_from_kg_per_s", "mf_from", False)] + res_nodes_to = [("p_to_bar", "p_to", False), ("t_to_k", "temp_to", True), + ("mdot_to_kg_per_s", "mf_to", False)] + res_mean = [("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), + ("reynolds", "reynolds", False)] if get_fluid(net).is_gas: res_nodes_from.extend( - [("v_from_m_per_s", "v_gas_from"), ("normfactor_from", "normfactor_from")]) - res_nodes_to.extend([("v_to_m_per_s", "v_gas_to"), ("normfactor_to", "normfactor_to")]) - res_mean.extend([("v_mean_m_per_s", "v_gas_mean")]) + [("v_from_m_per_s", "v_gas_from", False), + ("normfactor_from", "normfactor_from", False)]) + res_nodes_to.extend([("v_to_m_per_s", "v_gas_to", False), + ("normfactor_to", "normfactor_to", False)]) + res_mean.extend([("v_mean_m_per_s", "v_gas_mean", False)]) else: - res_mean.extend([("v_mean_m_per_s", "v_mps")]) + res_mean.extend([("v_mean_m_per_s", "v_mps", False)]) if np.any(cls.get_internal_pipe_number(net) > 1): extract_branch_results_with_internals( net, branch_results, cls.table_name(), res_nodes_from, res_nodes_to, res_mean, - cls.get_connected_node_type().table_name(), branches_connected) + cls.get_connected_node_type().table_name(), mode) else: required_results = res_nodes_from + res_nodes_to + res_mean extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) @classmethod def get_internal_results(cls, net, pipe): diff --git a/pandapipes/component_models/pressure_control_component.py b/pandapipes/component_models/pressure_control_component.py index abd4b2479..40a530077 100644 --- a/pandapipes/component_models/pressure_control_component.py +++ b/pandapipes/component_models/pressure_control_component.py @@ -95,14 +95,12 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): branch_component_pit[:, TL] = 0 @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: + :param mode: + :type mode: :param branch_results: :type branch_results: :param net: The pandapipes network @@ -112,21 +110,23 @@ def extract_results(cls, net, options, branch_results, nodes_connected, branches :return: No Output. """ required_results = [ - ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("t_from_k", "temp_from"), - ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to"), ("mdot_from_kg_per_s", "mf_from"), - ("vdot_norm_m3_per_s", "vf") + ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to"), + ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), + ("vdot_norm_m3_per_s", "vf", False) ] if get_fluid(net).is_gas: required_results.extend([ - ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), - ("normfactor_from", "normfactor_from"), ("normfactor_to", "normfactor_to") + ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), + ("normfactor_from", "normfactor_from", False), + ("normfactor_to", "normfactor_to", False) ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps")]) + required_results.extend([("v_mean_m_per_s", "v_mps", False)]) extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) res_table = net["res_" + cls.table_name()] f, t = get_lookup(net, "branch", "from_to")[cls.table_name()] diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index 15aab7a3a..dc62112f0 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -111,40 +111,40 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): branch_component_pit[:, TL] = 0 @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): """ Function that extracts certain results. - :param nodes_connected: - :type nodes_connected: - :param branches_connected: - :type branches_connected: :param branch_results: :type branch_results: :param net: The pandapipes network :type net: pandapipesNet :param options: :type options: + :param mode: + :type mode: :return: No Output. """ calc_compr_pow = options['calc_compression_power'] required_results = [ - ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("t_from_k", "temp_from"), - ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to"), ("mdot_from_kg_per_s", "mf_from"), - ("vdot_norm_m3_per_s", "vf"), ("deltap_bar", "pl") + ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), + ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), + ("vdot_norm_m3_per_s", "vf", False), ("deltap_bar", "pl", False) ] if get_fluid(net).is_gas: required_results.extend([ - ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), - ("normfactor_from", "normfactor_from"), ("normfactor_to", "normfactor_to") + ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), + ("normfactor_from", "normfactor_from", False), + ("normfactor_to", "normfactor_to", False) ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps")]) + required_results.extend([("v_mean_m_per_s", "v_mps", False)]) extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) if calc_compr_pow: f, t = get_lookup(net, "branch", "from_to")[cls.table_name()] diff --git a/pandapipes/component_models/valve_component.py b/pandapipes/component_models/valve_component.py index b63173e88..a1a9e8580 100644 --- a/pandapipes/component_models/valve_component.py +++ b/pandapipes/component_models/valve_component.py @@ -82,24 +82,27 @@ def get_component_input(cls): ("type", dtype(object))] @classmethod - def extract_results(cls, net, options, branch_results, nodes_connected, branches_connected): + def extract_results(cls, net, options, branch_results, mode): required_results = [ - ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("t_from_k", "temp_from"), - ("t_to_k", "temp_to"), ("mdot_to_kg_per_s", "mf_to"), ("mdot_from_kg_per_s", "mf_from"), - ("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), ("reynolds", "reynolds") + ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), + ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), + ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), + ("reynolds", "reynolds", False) ] if get_fluid(net).is_gas: required_results.extend([ - ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), - ("v_mean_m_per_s", "v_gas_mean"), ("normfactor_from", "normfactor_from"), - ("normfactor_to", "normfactor_to") + ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), + ("v_mean_m_per_s", "v_gas_mean", False), + ("normfactor_from", "normfactor_from", False), + ("normfactor_to", "normfactor_to", False) ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps")]) + required_results.extend([("v_mean_m_per_s", "v_mps", False)]) extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), branches_connected) + cls.table_name(), mode) @classmethod def get_result_table(cls, net): diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 4dac0133c..7acb36f18 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -9,7 +9,7 @@ from scipy.sparse import coo_matrix, csgraph from pandapipes.idx_branch import FROM_NODE, TO_NODE, branch_cols, \ - ACTIVE as ACTIVE_BR + ACTIVE as ACTIVE_BR, VINIT from pandapipes.idx_node import NODE_TYPE, P, NODE_TYPE_T, node_cols, T, ACTIVE as ACTIVE_ND, \ TABLE_IDX as TABLE_IDX_ND, ELEMENT_IDX as ELEMENT_IDX_ND from pandapipes.properties.fluids import get_fluid @@ -161,8 +161,9 @@ def get_lookup(net, pit_type="node", lookup_type="index"): """ pit_type = pit_type.lower() lookup_type = lookup_type.lower() - all_lookup_types = ["index", "table", "from_to", "active", "length", "from_to_active", - "index_active"] + all_lookup_types = ["index", "table", "from_to", "active_hydraulics", "active_heat_transfer", + "length", "from_to_active_hydraulics", "from_to_active_heat_transfer", + "index_active_hydraulics", "index_active_heat_transfer"] if lookup_type not in all_lookup_types: type_names = "', '".join(all_lookup_types) logger.error("No lookup type '%s' exists. Please choose one of '%s'." @@ -435,7 +436,7 @@ def create_lookups(net): "internal_nodes_lookup": internal_nodes_lookup} -def check_connectivity(net, branch_pit, node_pit, check_heat): +def check_connectivity(net, branch_pit, node_pit): """ Perform a connectivity check which means that network nodes are identified that don't have any connection to an external grid component. Quick overview over the steps of this function: @@ -461,40 +462,41 @@ def check_connectivity(net, branch_pit, node_pit, check_heat): :type branch_pit: np.array :param node_pit: Internal array with node entries :type node_pit: np.array - :param check_heat: Flag which determines whether to also check for connectivity to heat \ - external grids - :type check_heat: bool :return: (nodes_connected_hyd, branches_connected) - Lookups of np.arrays stating which of the internal nodes and branches are reachable from any of the hyd_slacks (np mask). :rtype: tuple(np.array) """ active_branch_lookup = branch_pit[:, ACTIVE_BR].astype(bool) active_node_lookup = node_pit[:, ACTIVE_ND].astype(bool) - from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) - to_nodes = branch_pit[:, TO_NODE].astype(np.int32) hyd_slacks = np.where((node_pit[:, NODE_TYPE] == P) & active_node_lookup)[0] # hyd_slacks = np.where(((node_pit[:, NODE_TYPE] == P) | (node_pit[:, NODE_TYPE] == PC)) # & active_node_lookup)[0] - nodes_connected, branches_connected = perform_connectivity_search( - net, node_pit, hyd_slacks, from_nodes, to_nodes, active_node_lookup, active_branch_lookup, + return perform_connectivity_search( + net, node_pit, branch_pit, hyd_slacks, active_node_lookup, active_branch_lookup, mode="hydraulics") - if not check_heat: - return nodes_connected, branches_connected - heat_slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & nodes_connected)[0] - if len(heat_slacks) == len(hyd_slacks) and np.all(heat_slacks == hyd_slacks): - return nodes_connected, branches_connected - nodes_connected, branches_connected = perform_connectivity_search( - net, node_pit, heat_slacks, from_nodes, to_nodes, nodes_connected, branches_connected, - mode="heat transfer") - return nodes_connected, branches_connected +def connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, branches_connected_hyd): + # TODO: is this formulation correct or could there be any caveats? + branches_connect = ~np.isnan(branch_pit[:, VINIT]) & \ + ~np.isclose(branch_pit[:, VINIT], 0, rtol=1e-10, atol=1e-10) \ + & branches_connected_hyd + active_node_lookup = node_pit[:, ACTIVE_ND].astype(bool) & nodes_connected_hyd + + heat_slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & active_node_lookup)[0] + return perform_connectivity_search( + net, node_pit, branch_pit, heat_slacks, active_node_lookup, branches_connect, + mode="heat transfer" + ) -def perform_connectivity_search(net, node_pit, slack_nodes, from_nodes, to_nodes, + +def perform_connectivity_search(net, node_pit, branch_pit, slack_nodes, active_node_lookup, active_branch_lookup, mode="hydraulics"): len_nodes = len(node_pit) + from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) + to_nodes = branch_pit[:, TO_NODE].astype(np.int32) nobranch = np.sum(active_branch_lookup) active_from_nodes = from_nodes[active_branch_lookup] active_to_nodes = to_nodes[active_branch_lookup] @@ -569,7 +571,7 @@ def get_table_index_list(net, pit_array, pit_indices, pit_type="node"): for tbl in tables] -def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected): +def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, mode="hydraulics"): """ Create an internal ("active") pit with all nodes and branches that are actually in_service. This is also done for different lookups (e.g. the from_to indices for this pit and the node index @@ -594,32 +596,35 @@ def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected): els = dict() reduced_node_lookup = None if np.alltrue(nodes_connected): - net["_lookups"]["node_from_to_active"] = copy.deepcopy(get_lookup(net, "node", "from_to")) - net["_lookups"]["node_index_active"] = copy.deepcopy(get_lookup(net, "node", "index")) + net["_lookups"]["node_from_to_active_" + mode] = copy.deepcopy( + get_lookup(net, "node", "from_to")) + net["_lookups"]["node_index_active_" + mode] = copy.deepcopy( + get_lookup(net, "node", "index")) active_pit["node"] = np.copy(node_pit) else: active_pit["node"] = np.copy(node_pit[nodes_connected, :]) reduced_node_lookup = np.cumsum(nodes_connected) - 1 node_idx_lookup = get_lookup(net, "node", "index") - net["_lookups"]["node_index_active"] = { + net["_lookups"]["node_index_active_" + mode] = { tbl: reduced_node_lookup[idx_lookup[idx_lookup != -1]] for tbl, idx_lookup in node_idx_lookup.items()} els["node"] = nodes_connected if np.alltrue(branches_connected): - net["_lookups"]["branch_from_to_active"] = copy.deepcopy(get_lookup(net, "branch", - "from_to")) + net["_lookups"]["branch_from_to_active_" + mode] = copy.deepcopy( + get_lookup(net, "branch", "from_to")) active_pit["branch"] = np.copy(branch_pit) - net["_lookups"]["branch_index_active"] = copy.deepcopy(get_lookup(net, "branch", "index")) + net["_lookups"]["branch_index_active_" + mode] = copy.deepcopy( + get_lookup(net, "branch", "index")) else: active_pit["branch"] = np.copy(branch_pit[branches_connected, :]) branch_idx_lookup = get_lookup(net, "branch", "index") if len(branch_idx_lookup): reduced_branch_lookup = np.cumsum(branches_connected) - 1 - net["_lookups"]["branch_index_active"] = { + net["_lookups"]["branch_index_active_" + mode] = { tbl: reduced_branch_lookup[idx_lookup[idx_lookup != -1]] for tbl, idx_lookup in branch_idx_lookup.items()} else: - net["_lookups"]["branch_index_active"] = dict() + net["_lookups"]["branch_index_active_" + mode] = dict() els["branch"] = branches_connected if reduced_node_lookup is not None: active_pit["branch"][:, FROM_NODE] = reduced_node_lookup[ @@ -627,8 +632,8 @@ def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected): active_pit["branch"][:, TO_NODE] = reduced_node_lookup[ branch_pit[branches_connected, TO_NODE].astype(np.int32)] net["_active_pit"] = active_pit - net["_lookups"]["node_active"] = nodes_connected - net["_lookups"]["branch_active"] = branches_connected + net["_lookups"]["node_active_" + mode] = nodes_connected + net["_lookups"]["branch_active_" + mode] = branches_connected for el, connected_els in els.items(): ft_lookup = get_lookup(net, el, "from_to") @@ -639,4 +644,4 @@ def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected): for table, (_, _, len_new) in sorted(aux_lookup.items(), key=lambda x: x[1][0]): from_to_active_lookup[table] = (count, count + len_new) count += len_new - net["_lookups"]["%s_from_to_active" % el] = from_to_active_lookup + net["_lookups"]["%s_from_to_active_%s" % (el, mode)] = from_to_active_lookup diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index c453c9f58..bde5145d1 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -2,7 +2,7 @@ from pandapipes.constants import NORMAL_PRESSURE, NORMAL_TEMPERATURE from pandapipes.idx_branch import ELEMENT_IDX, FROM_NODE, TO_NODE, LOAD_VEC_NODES, VINIT, RE, \ - LAMBDA, TINIT, FROM_NODE_T, TO_NODE_T, PL + LAMBDA, TINIT, FROM_NODE_T, TO_NODE_T, PL, T_OUT from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup, get_net_option @@ -49,8 +49,7 @@ def extract_all_results(net, nodes_connected, branches_connected): } branch_results.update(gas_branch_results) for comp in net['component_list']: - comp.extract_results(net, net["_options"], branch_results, nodes_connected, - branches_connected) + comp.extract_results(net, net["_options"], branch_results, "hydraulics") def get_basic_branch_results(net, branch_pit, node_pit): @@ -142,7 +141,7 @@ def get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_a def extract_branch_results_with_internals(net, branch_results, table_name, res_nodes_from, - res_nodes_to, res_mean, node_name, branches_connected): + res_nodes_to, res_mean, node_name, mode): # the result table to write results to res_table = net["res_" + table_name] @@ -155,101 +154,129 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n # respective table), the placement of the indices mus be known to allocate the values correctly placement_table = np.argsort(net[table_name].index.values) idx_pit = branch_pit[f:t, ELEMENT_IDX] - comp_connected = branches_connected[f:t] + comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] + comp_connected_ht = None + if consider_heat(mode): + comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] node_pit = net["_pit"]["node"] # the id of the external node table inside the node_pit (mostly this is "junction": 0) ext_node_tbl_idx = get_table_number(get_lookup(net, "node", "table"), node_name) - if len(res_nodes_from) > 0: - # results that relate to the from_node --> in case of many internal nodes, only the single - # from_node that is the exterior node (e.g. junction vs. internal pipe_node) result has to - # be extracted from the node_pit - from_nodes = branch_results["from_nodes"][f:t] - from_nodes_external = node_pit[from_nodes, TABLE_IDX_NODE] == ext_node_tbl_idx - considered = from_nodes_external & comp_connected - external_active = comp_connected[from_nodes_external] - for res_name, entry in res_nodes_from: - res_table[res_name].values[external_active] = branch_results[entry][f:t][considered] - - if len(res_nodes_to) > 0: - # results that relate to the to_node --> in case of many internal nodes, only the single - # to_node that is the exterior node (e.g. junction vs. internal pipe_node) result has to - # be extracted from the node_pit - to_nodes = branch_results["to_nodes"][f:t] - to_nodes_external = node_pit[to_nodes, TABLE_IDX_NODE] == ext_node_tbl_idx - considered = to_nodes_external & comp_connected - external_active = comp_connected[to_nodes_external] - for res_name, entry in res_nodes_to: - res_table[res_name].values[external_active] = branch_results[entry][f:t][considered] + for (res_ext, node_name) in ((res_nodes_from, "from_nodes"), (res_nodes_to, "to_nodes")): + if len(res_ext) > 0: + # results that relate to the from_node --> in case of many internal nodes, only the + # single from_node that is the exterior node (e.g. junction vs. internal pipe_node) + # result has to be extracted from the node_pit + end_nodes = branch_results[node_name][f:t] + end_nodes_external = node_pit[end_nodes, TABLE_IDX_NODE] == ext_node_tbl_idx + considered_hyd = end_nodes_external & comp_connected_hyd + external_active_hyd = comp_connected_hyd[end_nodes_external] + considered_ht, external_active_ht = None, None + also_heat = consider_heat(mode, res_ext) + if also_heat: + considered_ht = end_nodes_external & comp_connected_ht + external_active_ht = comp_connected_ht[end_nodes_external] + for res_name, entry, use_ht_con in res_ext: + if also_heat and use_ht_con: + res_table[res_name].values[external_active_ht] = \ + branch_results[entry][f:t][considered_ht] + else: + res_table[res_name].values[external_active_hyd] = \ + branch_results[entry][f:t][considered_hyd] if len(res_mean) > 0: # results that relate to the whole branch and shall be averaged (by summing up all values # and dividing by number of internal sections) use_numba = get_net_option(net, "use_numba") - res = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), - comp_connected.astype(np.int32), - *[branch_results[rn[1]][f:t] for rn in res_mean]) - connected_ind = res[2] > 0.99 - num_internals = res[1][connected_ind] + res_hyd = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), + comp_connected_hyd.astype(np.int32), + *[branch_results[rn[1]][f:t] for rn in res_mean if rn[2]]) + connected_ind_hyd = res_hyd[2] > 0.99 + num_internals_hyd = res_hyd[1][connected_ind_hyd] # hint: idx_pit[placement_table] should result in the indices as ordered in the table - placement_table = placement_table[connected_ind] - - for i, (res_name, entry) in enumerate(res_mean): - res_table[res_name].values[placement_table] = res[i + 3][connected_ind] / num_internals + placement_table_hyd = placement_table[connected_ind_hyd] + + also_heat = consider_heat(mode, res_mean) + res_ht, connected_ind_ht, num_internals_ht, placement_table_ht = None, None, None, None + if also_heat: + res_ht = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), + comp_connected_hyd.astype(np.int32), + *[branch_results[rn[1]][f:t] for rn in res_mean if not rn[2]]) + connected_ind_ht = res_ht[2] > 0.99 + num_internals_ht = res_ht[1][connected_ind_ht] + # hint: idx_pit[placement_table] should result in the indices as ordered in the table + placement_table_ht = placement_table[connected_ind_ht] + + for i, (res_name, entry, use_ht_con) in enumerate(res_mean): + if also_heat and use_ht_con: + res_table[res_name].values[placement_table_hyd] = res_hyd[i + 3][connected_ind_hyd]\ + / num_internals_hyd + else: + res_table[res_name].values[placement_table_ht] = res_ht[i + 3][connected_ind_ht] \ + / num_internals_ht def extract_branch_results_without_internals(net, branch_results, required_results, table_name, - branches_connected): + mode): res_table = net["res_" + table_name] f, t = get_lookup(net, "branch", "from_to")[table_name] - comp_connected = branches_connected[f:t] - - for res_name, entry in required_results: - res_table[res_name].values[:][comp_connected] = branch_results[entry][f:t][comp_connected] + comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] + comp_connected_ht = None + if mode in ["heat", "all"]: + comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] + + for res_name, entry, use_ht_con in required_results: + if mode in ["heat", "all"] and use_ht_con: + res_table[res_name].values[:][comp_connected_ht] = \ + branch_results[entry][f:t][comp_connected_ht] + else: + res_table[res_name].values[:][comp_connected_hyd] = \ + branch_results[entry][f:t][comp_connected_hyd] -def extract_results_active_pit(net, node_pit, branch_pit, nodes_connected, branches_connected): +def extract_results_active_pit(net, nodes_connected, branches_connected, mode="hydraulics"): """ Extract the pipeflow results from the internal pit structure ("_active_pit") to the general pit structure. :param net: The pandapipes net that the internal structure belongs to :type net: pandapipesNet - :param node_pit: The internal structure node array - :type node_pit: np.array - :param branch_pit: The internal structure branch array - :type branch_pit: np.array :param nodes_connected: A mask array stating which nodes are actually connected to the rest of\ the net :type nodes_connected: np.array :param branches_connected: A mask array stating which branches are actually connected to the \ rest of the net :type branches_connected: np.array + :param mode: defines whether results from hydraulic or temperature calculation are transferred + :type mode: str, default "hydraulics" :return: No output """ - all_nodes_connected = np.alltrue(nodes_connected) - if not all_nodes_connected: - node_pit[~nodes_connected, PINIT] = np.NaN - node_pit[nodes_connected, :] = net["_active_pit"]["node"] - cols_br = np.array([i for i in range(branch_pit.shape[1]) - if i not in [FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T]]) - else: - net["_pit"]["node"] = np.copy(net["_active_pit"]["node"]) - cols_br = None - - if not np.alltrue(branches_connected): - branch_pit[~branches_connected, VINIT] = np.NaN - rows_active_br = np.where(branches_connected)[0] - if all_nodes_connected: - branch_pit[rows_active_br, :] = net["_active_pit"]["branch"][:, :] - else: - branch_pit[rows_active_br[:, np.newaxis], cols_br[np.newaxis, :]] = \ - net["_active_pit"]["branch"][:, cols_br] - else: - if all_nodes_connected: - net["_pit"]["branch"] = np.copy(net["_active_pit"]["branch"]) - else: - net["_pit"]["branch"][:, cols_br] = net["_active_pit"]["branch"][:, cols_br] + result_node_col = PINIT if mode == "hydraulics" else TINIT_NODE + not_affected_node_col = TINIT_NODE if mode == "hydraulics" else PINIT + copied_node_cols = np.array([i for i in range(net["_pit"]["node"].shape[1]) + if i not in [not_affected_node_col]]) + rows_nodes = np.arange(net["_pit"]["node"].shape[0])[nodes_connected] + + result_branch_col = VINIT if mode == "hydraulics" else T_OUT + not_affected_branch_col = T_OUT if mode == "hydraulics" else VINIT + copied_branch_cols = np.array([i for i in range(net["_pit"]["branch"].shape[1]) + if i not in [FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, + not_affected_branch_col]]) + rows_branches = np.arange(net["_pit"]["branch"].shape[0])[branches_connected] + + net["_pit"]["node"][~nodes_connected, result_node_col] = np.NaN + net["_pit"]["node"][rows_nodes[:, np.newaxis], copied_node_cols[np.newaxis, :]] = \ + net["_active_pit"]["node"][:, copied_node_cols] + net["_pit"]["branch"][~branches_connected, result_branch_col] = np.NaN + net["_pit"]["branch"][rows_branches[:, np.newaxis], copied_branch_cols[np.newaxis, :]] = \ + net["_active_pit"]["branch"][:, copied_branch_cols] + + +def consider_heat(mode, results=None): + consider_ = mode in ["heat", "all"] + if results is None: + return consider_ + return consider_ and any(r[2] for r in results) diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 9f9544aa6..c5bd9f469 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -15,7 +15,7 @@ from pandapipes.pf.pipeflow_setup import get_net_option, get_net_options, set_net_option, \ init_options, create_internal_results, write_internal_results, get_lookup, create_lookups, \ initialize_pit, check_connectivity, reduce_pit, \ - set_user_pf_options, init_all_result_tables + set_user_pf_options, init_all_result_tables, connectivity_check_heat from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit try: @@ -81,34 +81,43 @@ def pipeflow(net, sol_vec=None, **kwargs): if get_net_option(net, "check_connectivity"): nodes_connected, branches_connected = check_connectivity( - net, branch_pit, node_pit, check_heat=calculate_heat) + net, branch_pit, node_pit) else: nodes_connected = node_pit[:, ACTIVE_ND].astype(bool) branches_connected = branch_pit[:, ACTIVE_BR].astype(bool) - reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected) - - if calculation_mode == "heat" and not net.user_pf_options["hyd_flag"]: - raise UserWarning("Converged flag not set. Make sure that hydraulic calculation results " - "are available.") - elif calculation_mode == "heat" and net.user_pf_options["hyd_flag"]: - net["_active_pit"]["node"][:, PINIT] = sol_vec[:len(node_pit)] - net["_active_pit"]["branch"][:, VINIT] = sol_vec[len(node_pit):] + if calculation_mode == "heat": + if not net.user_pf_options["hyd_flag"]: + raise UserWarning("Converged flag not set. Make sure that hydraulic calculation " + "results are available.") + else: + net["_pit"]["node"][:, PINIT] = sol_vec[:len(node_pit)] + net["_pit"]["branch"][:, VINIT] = sol_vec[len(node_pit):] if calculate_hydraulics: + reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, + mode="hydraulics") converged, _ = hydraulics(net) if not converged: raise PipeflowNotConverged("The hydraulic calculation did not converge to a solution.") + extract_results_active_pit(net, nodes_connected, branches_connected, mode="hydraulics") if calculate_heat: + node_pit, branch_pit = net["_pit"]["node"], net["_pit"]["branch"] + nodes_connected, branches_connected = connectivity_check_heat( + net, branch_pit, node_pit, nodes_connected, branches_connected) + # active_node_pit = net["_active_pit"]["node"] + # active_branch_pit = net["_active_pit"]["branch"] + reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, + mode="heat_transfer") converged, _ = heat_transfer(net) if not converged: raise PipeflowNotConverged("The heat transfer calculation did not converge to a " "solution.") + extract_results_active_pit(net, nodes_connected, branches_connected, mode="heat_transfer") elif not calculate_hydraulics: raise UserWarning("No proper calculation mode chosen.") - extract_results_active_pit(net, node_pit, branch_pit, nodes_connected, branches_connected) extract_all_results(net, nodes_connected, branches_connected) @@ -191,7 +200,7 @@ def heat_transfer(net): error_t_out.append(linalg.norm(delta_t_out) / (len(delta_t_out))) finalize_iteration(net, niter, error_t, error_t_out, residual_norm, nonlinear_method, tol_t, - tol_t, tol_res, t_init_old, t_out_old, hyraulic_mode=True) + tol_t, tol_res, t_init_old, t_out_old, hydraulic_mode=False) logger.debug("F: %s" % epsilon.round(4)) logger.debug("T_init_: %s" % t_init.round(4)) logger.debug("T_out_: %s" % t_out.round(4)) @@ -222,7 +231,7 @@ def solve_hydraulics(net): branch_pit = net["_active_pit"]["branch"] node_pit = net["_active_pit"]["node"] - branch_lookups = get_lookup(net, "branch", "from_to_active") + branch_lookups = get_lookup(net, "branch", "from_to_active_hydraulics") for comp in net['component_list']: comp.adaption_before_derivatives_hydraulic( net, branch_pit, node_pit, branch_lookups, options) @@ -258,7 +267,7 @@ def solve_temperature(net): options = net["_options"] branch_pit = net["_active_pit"]["branch"] node_pit = net["_active_pit"]["node"] - branch_lookups = get_lookup(net, "branch", "from_to_active") + branch_lookups = get_lookup(net, "branch", "from_to_active_heat_transfer") # Negative velocity values are turned to positive ones (including exchange of from_node and # to_node for temperature calculation @@ -314,8 +323,8 @@ def set_damping_factor(net, niter, error): def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_method, tol_1, tol_2, - tol_res, vals_1_old, vals_2_old, hyraulic_mode=True): - col1, col2 = (PINIT, VINIT) if hyraulic_mode else (TINIT, T_OUT) + tol_res, vals_1_old, vals_2_old, hydraulic_mode=True): + col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, T_OUT) # Control of damping factor if nonlinear_method == "automatic": @@ -335,7 +344,7 @@ def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_me elif get_net_option(net, "alpha") == 1: set_net_option(net, "converged", True) - if hyraulic_mode: + if hydraulic_mode: logger.debug("errorv: %s" % error_1[niter]) logger.debug("errorp: %s" % error_2[niter]) logger.debug("alpha: %s" % get_net_option(net, "alpha")) From 1eecc9009bf772709158f0b27bcf142f3c1baa55 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 23 May 2023 09:45:51 +0200 Subject: [PATCH 021/126] correction in result extraction for branches with internals --- pandapipes/pf/result_extraction.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index bde5145d1..58bccdd74 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -211,11 +211,11 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n for i, (res_name, entry, use_ht_con) in enumerate(res_mean): if also_heat and use_ht_con: - res_table[res_name].values[placement_table_hyd] = res_hyd[i + 3][connected_ind_hyd]\ - / num_internals_hyd - else: res_table[res_name].values[placement_table_ht] = res_ht[i + 3][connected_ind_ht] \ / num_internals_ht + else: + res_table[res_name].values[placement_table_hyd] = res_hyd[i + 3][connected_ind_hyd]\ + / num_internals_hyd def extract_branch_results_without_internals(net, branch_results, required_results, table_name, From a1710460d91768907762e9947f0809d2497ecc3d Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 23 May 2023 10:48:13 +0200 Subject: [PATCH 022/126] another correction in result extraction for branch components with internal nodes --- pandapipes/pf/result_extraction.py | 32 +++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 58bccdd74..81341a1a3 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -190,32 +190,24 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n # results that relate to the whole branch and shall be averaged (by summing up all values # and dividing by number of internal sections) use_numba = get_net_option(net, "use_numba") - res_hyd = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), - comp_connected_hyd.astype(np.int32), + res = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), + comp_connected_hyd.astype(np.int32), comp_connected_ht.astype(np.int32), *[branch_results[rn[1]][f:t] for rn in res_mean if rn[2]]) - connected_ind_hyd = res_hyd[2] > 0.99 - num_internals_hyd = res_hyd[1][connected_ind_hyd] + connected_ind_hyd = res[2] > 0.99 + num_internals_hyd = res[1][connected_ind_hyd] + connected_ind_ht = res[3] > 0.99 + num_internals_ht = res[1][connected_ind_ht] + # hint: idx_pit[placement_table] should result in the indices as ordered in the table placement_table_hyd = placement_table[connected_ind_hyd] + placement_table_ht = placement_table[connected_ind_ht] also_heat = consider_heat(mode, res_mean) - res_ht, connected_ind_ht, num_internals_ht, placement_table_ht = None, None, None, None - if also_heat: - res_ht = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), - comp_connected_hyd.astype(np.int32), - *[branch_results[rn[1]][f:t] for rn in res_mean if not rn[2]]) - connected_ind_ht = res_ht[2] > 0.99 - num_internals_ht = res_ht[1][connected_ind_ht] - # hint: idx_pit[placement_table] should result in the indices as ordered in the table - placement_table_ht = placement_table[connected_ind_ht] - for i, (res_name, entry, use_ht_con) in enumerate(res_mean): - if also_heat and use_ht_con: - res_table[res_name].values[placement_table_ht] = res_ht[i + 3][connected_ind_ht] \ - / num_internals_ht - else: - res_table[res_name].values[placement_table_hyd] = res_hyd[i + 3][connected_ind_hyd]\ - / num_internals_hyd + connected_ind = connected_ind_ht if also_heat and use_ht_con else connected_ind_hyd + num_internals = num_internals_ht if also_heat and use_ht_con else num_internals_hyd + pt = placement_table_ht if also_heat and use_ht_con else placement_table_hyd + res_table[res_name].values[pt] = res[i + 4][connected_ind] / num_internals def extract_branch_results_without_internals(net, branch_results, required_results, table_name, From 5ed7baf675be059ba5bb77f03f9e8b86a1e3920c Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 23 May 2023 11:21:24 +0200 Subject: [PATCH 023/126] another small correction in result extraction --- pandapipes/pf/result_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 81341a1a3..fbe2d8e82 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -155,7 +155,7 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n placement_table = np.argsort(net[table_name].index.values) idx_pit = branch_pit[f:t, ELEMENT_IDX] comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] - comp_connected_ht = None + comp_connected_ht = comp_connected_hyd if consider_heat(mode): comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] From 9010add7eb9540bfc58bde679f5cc43b2a3c255b Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 23 May 2023 11:41:49 +0200 Subject: [PATCH 024/126] yet another small correction to make many tests pass again --- pandapipes/component_models/pressure_control_component.py | 2 +- pandapipes/pf/result_extraction.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandapipes/component_models/pressure_control_component.py b/pandapipes/component_models/pressure_control_component.py index 40a530077..7cb682342 100644 --- a/pandapipes/component_models/pressure_control_component.py +++ b/pandapipes/component_models/pressure_control_component.py @@ -111,7 +111,7 @@ def extract_results(cls, net, options, branch_results, mode): """ required_results = [ ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to"), + ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), ("vdot_norm_m3_per_s", "vf", False) ] diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index fbe2d8e82..5ea369d40 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -192,7 +192,7 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n use_numba = get_net_option(net, "use_numba") res = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), comp_connected_hyd.astype(np.int32), comp_connected_ht.astype(np.int32), - *[branch_results[rn[1]][f:t] for rn in res_mean if rn[2]]) + *[branch_results[rn[1]][f:t] for rn in res_mean]) connected_ind_hyd = res[2] > 0.99 num_internals_hyd = res[1][connected_ind_hyd] connected_ind_ht = res[3] > 0.99 From b70fd41281db26e3881351453ba76f7763fc4d87 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Tue, 6 Jun 2023 13:51:56 +0200 Subject: [PATCH 025/126] improvement of the heat connectivity check: - the full graph search is only performed if the check_connectivity option is set - if it is not set, a simple sum_by_group only sets nodes oos that don't have a hydraulic connection to other nodes --> more consistent with the idea behind the option and more performant --- pandapipes/pf/pipeflow_setup.py | 39 ++++++++++++++++++++++++++++----- pandapipes/pipeflow.py | 14 +++++------- 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 7acb36f18..11ed91d75 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -12,6 +12,7 @@ ACTIVE as ACTIVE_BR, VINIT from pandapipes.idx_node import NODE_TYPE, P, NODE_TYPE_T, node_cols, T, ACTIVE as ACTIVE_ND, \ TABLE_IDX as TABLE_IDX_ND, ELEMENT_IDX as ELEMENT_IDX_ND +from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.properties.fluids import get_fluid try: @@ -436,6 +437,36 @@ def create_lookups(net): "internal_nodes_lookup": internal_nodes_lookup} +def get_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): + if hydraulic: + if get_net_option(net, "check_connectivity"): + return check_connectivity(net, branch_pit, node_pit) + else: + return node_pit[:, ACTIVE_ND].astype(bool), branch_pit[:, ACTIVE_BR].astype(bool) + branches_with_flow = branches_connected_flow(branch_pit) + nodes_connected_hyd = net["_lookups"]["node_active_hydraulic"] + branches_connected_hyd = net["_lookups"]["branch_active_hydraulic"] + if get_net_option(net, "check_connectivity"): + return connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, + branches_connected_hyd, branches_with_flow) + else: + branches_connected = branches_connected_hyd & branches_with_flow + fn = branch_pit[:, FROM_NODE].astype(np.int32) + tn = branch_pit[:, TO_NODE].astype(np.int32) + fn_tn, flow = _sum_by_group( + get_net_option(net, "use_numba"), np.concatenate([fn, tn]), + np.concatenate([branches_connected, branches_connected]).astype(np.int32) + ) + nodes_connected = np.copy(nodes_connected_hyd) + nodes_connected[fn_tn] = nodes_connected[fn_tn] & flow + + +def branches_connected_flow(branch_pit): + # TODO: is this formulation correct or could there be any caveats? + return ~np.isnan(branch_pit[:, VINIT]) \ + & ~np.isclose(branch_pit[:, VINIT], 0, rtol=1e-10, atol=1e-10) + + def check_connectivity(net, branch_pit, node_pit): """ Perform a connectivity check which means that network nodes are identified that don't have any @@ -477,11 +508,9 @@ def check_connectivity(net, branch_pit, node_pit): mode="hydraulics") -def connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, branches_connected_hyd): - # TODO: is this formulation correct or could there be any caveats? - branches_connect = ~np.isnan(branch_pit[:, VINIT]) & \ - ~np.isclose(branch_pit[:, VINIT], 0, rtol=1e-10, atol=1e-10) \ - & branches_connected_hyd +def connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, branches_connected_hyd, + branches_with_flow): + branches_connect = branches_with_flow & branches_connected_hyd active_node_lookup = node_pit[:, ACTIVE_ND].astype(bool) & nodes_connected_hyd heat_slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & active_node_lookup)[0] diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index c5bd9f469..de8ad3d97 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -15,7 +15,7 @@ from pandapipes.pf.pipeflow_setup import get_net_option, get_net_options, set_net_option, \ init_options, create_internal_results, write_internal_results, get_lookup, create_lookups, \ initialize_pit, check_connectivity, reduce_pit, \ - set_user_pf_options, init_all_result_tables, connectivity_check_heat + set_user_pf_options, init_all_result_tables, connectivity_check_heat, get_active_nodes_branches from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit try: @@ -79,12 +79,7 @@ def pipeflow(net, sol_vec=None, **kwargs): calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - if get_net_option(net, "check_connectivity"): - nodes_connected, branches_connected = check_connectivity( - net, branch_pit, node_pit) - else: - nodes_connected = node_pit[:, ACTIVE_ND].astype(bool) - branches_connected = branch_pit[:, ACTIVE_BR].astype(bool) + nodes_connected, branches_connected = get_active_nodes_branches(net, branch_pit, node_pit) if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: @@ -104,8 +99,9 @@ def pipeflow(net, sol_vec=None, **kwargs): if calculate_heat: node_pit, branch_pit = net["_pit"]["node"], net["_pit"]["branch"] - nodes_connected, branches_connected = connectivity_check_heat( - net, branch_pit, node_pit, nodes_connected, branches_connected) + nodes_connected, branches_connected = get_active_nodes_branches( + net, branch_pit, node_pit, False + ) # active_node_pit = net["_active_pit"]["node"] # active_branch_pit = net["_active_pit"]["branch"] reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, From 424f0d0c924045c6da0239669bbdd9848cc58951 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 7 Jun 2023 16:29:13 +0200 Subject: [PATCH 026/126] small corrections in pipeflow, tests corrected and one added - implementation for connectivity in heat mode without check_connectivity option still had errors that were fixed (no return value, wrong comparison base) - tests for connectivity had to be changed, as now p_bar is not null anymore if hydraulics connectivity is given, but not thermal - added test for thermal connectivity without option connectivity_check, but with node that is disconnected wrt. hydraulics --- pandapipes/pf/pipeflow_setup.py | 18 +++- pandapipes/pipeflow.py | 2 + .../test/pipeflow_internals/test_inservice.py | 86 +++++++++++++------ 3 files changed, 77 insertions(+), 29 deletions(-) diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 11ed91d75..cadcc874a 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -439,17 +439,26 @@ def create_lookups(net): def get_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): if hydraulic: + # connectivity check for hydraulic simulation if get_net_option(net, "check_connectivity"): return check_connectivity(net, branch_pit, node_pit) else: + # if connectivity check is switched off, still consider oos elements return node_pit[:, ACTIVE_ND].astype(bool), branch_pit[:, ACTIVE_BR].astype(bool) + + # connectivity check for heat simulation (needs to consider branches with 0 velocity as well) + # check for branches that are not flown through (for temperature calculation, this means that + # they are "out of service") branches_with_flow = branches_connected_flow(branch_pit) - nodes_connected_hyd = net["_lookups"]["node_active_hydraulic"] - branches_connected_hyd = net["_lookups"]["branch_active_hydraulic"] + nodes_connected_hyd = net["_lookups"]["node_active_hydraulics"] + branches_connected_hyd = net["_lookups"]["branch_active_hydraulics"] if get_net_option(net, "check_connectivity"): + # full connectivity check for hydraulic simulation return connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, branches_connected_hyd, branches_with_flow) else: + # if no full connectivity check is performed, all nodes that are not connected to the rest + # of the network wrt. flow can be identified by a more performant sum_by_group_call branches_connected = branches_connected_hyd & branches_with_flow fn = branch_pit[:, FROM_NODE].astype(np.int32) tn = branch_pit[:, TO_NODE].astype(np.int32) @@ -458,7 +467,10 @@ def get_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): np.concatenate([branches_connected, branches_connected]).astype(np.int32) ) nodes_connected = np.copy(nodes_connected_hyd) - nodes_connected[fn_tn] = nodes_connected[fn_tn] & flow + # set nodes oos that are not connected to any branches with flow > 0 (0.1 is arbitrary + # here, any value between 0 and 1 should work, excluding 0 and 1) + nodes_connected[fn_tn] = nodes_connected[fn_tn] & (flow > 0.1) + return nodes_connected, branches_connected def branches_connected_flow(branch_pit): diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index de8ad3d97..6ab5a9565 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -88,6 +88,8 @@ def pipeflow(net, sol_vec=None, **kwargs): else: net["_pit"]["node"][:, PINIT] = sol_vec[:len(node_pit)] net["_pit"]["branch"][:, VINIT] = sol_vec[len(node_pit):] + reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, + mode="hydraulics") if calculate_hydraulics: reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 56beecf28..706f593ed 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -87,7 +87,7 @@ def complex_heat_connectivity_grid(): pandapipes.create_pipe_from_parameters(net, j3, j5, 0.1, 0.1, alpha_w_per_m2k=5, in_service=False, index=7) pandapipes.create_pipe_from_parameters(net, j6, j7, 0.1, 0.1, alpha_w_per_m2k=5, index=9) - pandapipes.create_pipe_from_parameters(net, j5, 8, 0.1, 0.1, alpha_w_per_m2k=5, + pandapipes.create_pipe_from_parameters(net, j5, j8, 0.1, 0.1, alpha_w_per_m2k=5, in_service=False, index=8) pandapipes.create_pipe_from_parameters(net, j8, j10, 0.1, 0.1, alpha_w_per_m2k=5, index=1) pandapipes.create_pipe_from_parameters(net, j9, j10, 0.1, 0.1, alpha_w_per_m2k=5, index=2) @@ -143,7 +143,7 @@ def test_inservice_gas(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[~net.pipe.in_service, :].values)) assert np.all(np.isnan(net.res_valve.loc[~net.valve.opened, :].values)) - assert np.all(np.isnan(net.res_junction.loc[~net.junction.in_service, :].values)) + assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ | ~net.sink.in_service.values @@ -176,7 +176,7 @@ def test_inservice_water(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[~net.pipe.in_service, :].values)) assert np.all(np.isnan(net.res_valve.loc[~net.valve.opened, :].values)) - assert np.all(np.isnan(net.res_junction.loc[~net.junction.in_service, :].values)) + assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ | ~net.sink.in_service.values @@ -210,7 +210,7 @@ def test_connectivity_hydraulic(create_test_net, use_numba): pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", use_numba=use_numba) - assert np.all(np.isnan(net.res_junction.loc[[2, 5, 6], :].values)) + assert np.all(np.isnan(net.res_junction.p_bar.loc[[2, 5, 6]].values)) assert np.all(np.isnan(net.res_pipe.loc[[1, 2, 3], :].values)) assert not np.any(np.isnan(net.res_junction.loc[[0, 1, 3, 4], :].values)) assert not np.any(np.isnan(net.res_pipe.loc[[0, 4], @@ -222,8 +222,8 @@ def test_connectivity_hydraulic(create_test_net, use_numba): assert np.allclose(net.res_ext_grid.mdot_kg_per_s.sum(), -net.res_sink.mdot_kg_per_s.sum(), rtol=1e-10, atol=0) - active_branches = get_lookup(net, "branch", "active") - active_nodes = get_lookup(net, "node", "active") + active_branches = get_lookup(net, "branch", "active_hydraulics") + active_nodes = get_lookup(net, "node", "active_hydraulics") assert np.all(active_nodes == np.array([True, True, False, True, True, False, False, False, False, True])) @@ -257,14 +257,14 @@ def test_connectivity_hydraulic2(create_test_net, use_numba): pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", use_numba=use_numba) - active_branches = get_lookup(net, "branch", "active") - active_nodes = get_lookup(net, "node", "active") + active_branches = get_lookup(net, "branch", "active_hydraulics") + active_nodes = get_lookup(net, "node", "active_hydraulics") assert np.all(active_nodes == np.array([True, True, True, True, True, True, True, False, False, True, False, False, True, True, True])) assert np.all(active_branches) - assert not np.all(np.isnan(net.res_junction.loc[[0, 1, 2, 3, 4, 5, 9], :].values)) + assert not np.all(np.isnan(net.res_junction.p_bar.loc[[0, 1, 2, 3, 4, 5, 9]].values)) assert not np.all(np.isnan(net.res_pipe.values)) assert np.any(np.isnan(net.res_junction.loc[[7, 8, 10, 11], :].values)) @@ -274,21 +274,27 @@ def test_connectivity_heat1(complex_heat_connectivity_grid, use_numba): net = copy.deepcopy(complex_heat_connectivity_grid) pandapipes.pipeflow(net, mode="all", check_connectivity=True, use_numba=use_numba) - assert set(net.res_junction.loc[net.res_junction.p_bar.notnull()].index) == {8, 9, 10} - assert set(net.res_junction.loc[net.res_junction.p_bar.isnull()].index) \ - == set(net.junction.index) - {8, 9, 10} - assert set(net.res_pipe.loc[net.res_pipe.v_mean_m_per_s.notnull()].index) == {1, 2} - assert set(net.res_pipe.loc[net.res_pipe.v_mean_m_per_s.isnull()].index) \ - == set(net.pipe.index) - {1, 2} + oos_juncs_hyd = {4, 5, 6, 7} + oos_pipe_hyd = {5, 7, 8, 9} + + assert set(net.res_junction.loc[net.res_junction.p_bar.notnull()].index) == \ + set(net.junction.index) - oos_juncs_hyd + assert set(net.res_junction.loc[net.res_junction.p_bar.isnull()].index) == oos_juncs_hyd + + assert set(net.res_pipe.loc[net.res_pipe.v_mean_m_per_s.notnull()].index) == \ + set(net.pipe.index) - oos_pipe_hyd + assert set(net.res_pipe.loc[net.res_pipe.v_mean_m_per_s.isnull()].index) == oos_pipe_hyd + assert set(net.res_valve.loc[net.res_valve.v_mean_m_per_s.notnull()].index) == set() assert set(net.res_valve.loc[net.res_valve.v_mean_m_per_s.isnull()].index) \ == set(net.valve.index) - assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.isnull()].index) == {3, 4, 5} + + assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.isnull()].index) == {4, 5} assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.notnull()].index) == \ - set(net.sink.index) - {3, 4, 5} - assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.isnull()].index) == \ - set(net.source.index) - assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.notnull()].index) == set() + set(net.sink.index) - {4, 5} + + assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.isnull()].index) == {7} + assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.notnull()].index) == {2} assert np.allclose(net.res_ext_grid.mdot_kg_per_s.sum(), -net.res_sink.mdot_kg_per_s.sum() + net.res_source.mdot_kg_per_s.sum(), @@ -352,6 +358,22 @@ def test_connectivity_heat3(complex_heat_connectivity_grid, use_numba): rtol=1e-10, atol=0) +@pytest.mark.parametrize("use_numba", [True, False]) +def test_connectivity_heat4(complex_heat_connectivity_grid, use_numba): + net = copy.deepcopy(complex_heat_connectivity_grid) + + net.pipe.in_service.loc[[7, 8]] = True + j_new = pandapipes.create_junction(net, 1, 320.15) + pandapipes.create_pipe_from_parameters(net, 8, j_new, 0.1, 0.1, alpha_w_per_m2k=5) + + net2 = copy.deepcopy(net) + + pandapipes.pipeflow(net, mode="all", check_connectivity=True, use_numba=use_numba) + pandapipes.pipeflow(net2, mode="all", check_connectivity=False, use_numba=use_numba) + + assert pandapipes.nets_equal(net, net2, check_only_results=True) + + @pytest.mark.parametrize("use_numba", [True, False]) def test_exclude_unconnected_junction(use_numba): """ @@ -390,6 +412,12 @@ def get_oos_branch(net, tbl, oosj=()): return get_oos(net, tbl) | net[tbl].from_junction.isin(oosj) | net[tbl].to_junction.isin(oosj) +def get_col_slice_null(tbl): + if tbl == "junction": + return "p_bar" + return slice(None) + + all_tbls_funcs = {"junction": get_oos, "pipe": get_oos_branch, "sink": get_oos_node_elem, "source": get_oos_node_elem, "ext_grid": get_oos_node_elem, "press_control": get_oos_branch} @@ -440,7 +468,8 @@ def test_mixed_indexing_oos2(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -457,7 +486,8 @@ def test_mixed_indexing_oos3(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -474,7 +504,8 @@ def test_mixed_indexing_oos4(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -491,7 +522,8 @@ def test_mixed_indexing_oos5(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -508,7 +540,8 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -516,7 +549,8 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): pandapipes.pipeflow(net, mode="hydraulics", use_numba=use_numba, check_connectivity=True) assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) - assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs)].isnull()) + assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) From 73b97bd53a7bac15abf9469a273edeb61a7eb3e5 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 7 Jun 2023 22:53:31 +0200 Subject: [PATCH 027/126] small changes for better consistency and hopefully understandability - do not return connected lookup into the pipeflow function, but just leave it inside the lookups - write this lookup in the connectivity function, not in reduce_pit - added some comments and docstrings --- pandapipes/pf/pipeflow_setup.py | 143 +++++++++++++++++------------ pandapipes/pf/result_extraction.py | 12 +-- pandapipes/pipeflow.py | 31 +++---- 3 files changed, 97 insertions(+), 89 deletions(-) diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index cadcc874a..a4e199366 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -189,7 +189,7 @@ def set_user_pf_options(net, reset=False, **kwargs): :type net: pandapipesNet :param reset: Specifies whether the user_pf_options is removed before setting new options :type reset: bool, default False - :param kwargs: pipeflow options that shall be set, e. g. tol_v = 1e-7 + :param kwargs: pipeflow options that shall be set, e.g. tol_v = 1e-7 :return: No output """ if reset or 'user_pf_options' not in net.keys(): @@ -437,49 +437,82 @@ def create_lookups(net): "internal_nodes_lookup": internal_nodes_lookup} -def get_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): +def identify_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): + """ + Function that creates the connectivity lookup for nodes and branches. If the option \ + "check_connectivity" is set, a full connectivity check is performed based on a sparse matrix \ + graph search. Otherwise, only the nodes and branches are identified that are inactive, which \ + means:\ + - in case of hydraulics, just use the "ACTIVE" identifier of the respective components\ + - in case of heat transfer, use the hydraulic result to check which branches are traversed \ + by the fluid and a simple rule to make sure that active nodes are connected to at least one\ + traversed branch\ + The result of this connectivity search is stored in the lookups (e.g. as \ + net["_lookups"]["node_active_hydraulics"]) + + :param net: the pandapipes net for which to identify the connectivity + :type net: pandapipes.pandapipesNet + :param branch_pit: Internal array with branch entries + :type branch_pit: np.array + :param node_pit: Internal array with node entries + :type node_pit: np.array + :param hydraulic: flag for the mode (if True, do the check for the hydraulic simulation, \ + otherwise for the heat transfer simulation with other considerations) + :type hydraulic: bool, default True + :return: No output + """ if hydraulic: # connectivity check for hydraulic simulation if get_net_option(net, "check_connectivity"): - return check_connectivity(net, branch_pit, node_pit) + nodes_connected, branches_connected = check_connectivity(net, branch_pit, node_pit) else: # if connectivity check is switched off, still consider oos elements - return node_pit[:, ACTIVE_ND].astype(bool), branch_pit[:, ACTIVE_BR].astype(bool) - - # connectivity check for heat simulation (needs to consider branches with 0 velocity as well) - # check for branches that are not flown through (for temperature calculation, this means that - # they are "out of service") - branches_with_flow = branches_connected_flow(branch_pit) - nodes_connected_hyd = net["_lookups"]["node_active_hydraulics"] - branches_connected_hyd = net["_lookups"]["branch_active_hydraulics"] - if get_net_option(net, "check_connectivity"): - # full connectivity check for hydraulic simulation - return connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, - branches_connected_hyd, branches_with_flow) + nodes_connected = node_pit[:, ACTIVE_ND].astype(np.bool_) + branches_connected = branch_pit[:, ACTIVE_BR].astype(np.bool_) else: - # if no full connectivity check is performed, all nodes that are not connected to the rest - # of the network wrt. flow can be identified by a more performant sum_by_group_call - branches_connected = branches_connected_hyd & branches_with_flow - fn = branch_pit[:, FROM_NODE].astype(np.int32) - tn = branch_pit[:, TO_NODE].astype(np.int32) - fn_tn, flow = _sum_by_group( - get_net_option(net, "use_numba"), np.concatenate([fn, tn]), - np.concatenate([branches_connected, branches_connected]).astype(np.int32) - ) - nodes_connected = np.copy(nodes_connected_hyd) - # set nodes oos that are not connected to any branches with flow > 0 (0.1 is arbitrary - # here, any value between 0 and 1 should work, excluding 0 and 1) - nodes_connected[fn_tn] = nodes_connected[fn_tn] & (flow > 0.1) - return nodes_connected, branches_connected + # connectivity check for heat simulation (needs to consider branches with 0 velocity as + # well) + if get_net_option(net, "check_connectivity"): + # full connectivity check for hydraulic simulation + nodes_connected, branches_connected = check_connectivity(net, branch_pit, node_pit, + mode="heat_transfer") + else: + # if no full connectivity check is performed, all nodes that are not connected to the + # rest of the network wrt. flow can be identified by a more performant sum_by_group_call + # check for branches that are not traversed (for temperature calculation, this means + # that they are "out of service") + branches_connected = get_lookup(net, "branch", "active_hydraulics") \ + & branches_connected_flow(branch_pit) + fn = branch_pit[:, FROM_NODE].astype(np.int32) + tn = branch_pit[:, TO_NODE].astype(np.int32) + fn_tn, flow = _sum_by_group( + get_net_option(net, "use_numba"), np.concatenate([fn, tn]), + np.concatenate([branches_connected, branches_connected]).astype(np.int32) + ) + nodes_connected = np.copy(get_lookup(net, "node", "active_hydraulics")) + # set nodes oos that are not connected to any branches with flow > 0 (0.1 is arbitrary + # here, any value between 0 and 1 should work, excluding 0 and 1) + nodes_connected[fn_tn] = nodes_connected[fn_tn] & (flow > 0.1) + mode = "hydraulics" if hydraulic else "heat_transfer" + net["_lookups"]["node_active_" + mode] = nodes_connected + net["_lookups"]["branch_active_" + mode] = branches_connected def branches_connected_flow(branch_pit): + """ + Simple function to identify branches with flow based on the calculated velocity. + + :param branch_pit: The pandapipes internal table of the network (including hydraulics results) + :type branch_pit: np.array + :return: branches_connected_flow - lookup array if branch is connected wrt. flow + :rtype: np.array + """ # TODO: is this formulation correct or could there be any caveats? return ~np.isnan(branch_pit[:, VINIT]) \ & ~np.isclose(branch_pit[:, VINIT], 0, rtol=1e-10, atol=1e-10) -def check_connectivity(net, branch_pit, node_pit): +def check_connectivity(net, branch_pit, node_pit, mode="hydraulics"): """ Perform a connectivity check which means that network nodes are identified that don't have any connection to an external grid component. Quick overview over the steps of this function: @@ -505,32 +538,23 @@ def check_connectivity(net, branch_pit, node_pit): :type branch_pit: np.array :param node_pit: Internal array with node entries :type node_pit: np.array - :return: (nodes_connected_hyd, branches_connected) - Lookups of np.arrays stating which of the + :return: (nodes_connected, branches_connected) - Lookups of np.arrays stating which of the internal nodes and branches are reachable from any of the hyd_slacks (np mask). :rtype: tuple(np.array) """ - active_branch_lookup = branch_pit[:, ACTIVE_BR].astype(bool) - active_node_lookup = node_pit[:, ACTIVE_ND].astype(bool) - hyd_slacks = np.where((node_pit[:, NODE_TYPE] == P) & active_node_lookup)[0] - # hyd_slacks = np.where(((node_pit[:, NODE_TYPE] == P) | (node_pit[:, NODE_TYPE] == PC)) - # & active_node_lookup)[0] - - return perform_connectivity_search( - net, node_pit, branch_pit, hyd_slacks, active_node_lookup, active_branch_lookup, - mode="hydraulics") - - -def connectivity_check_heat(net, branch_pit, node_pit, nodes_connected_hyd, branches_connected_hyd, - branches_with_flow): - branches_connect = branches_with_flow & branches_connected_hyd - active_node_lookup = node_pit[:, ACTIVE_ND].astype(bool) & nodes_connected_hyd - - heat_slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & active_node_lookup)[0] + if mode == "hydraulics": + active_branch_lookup = branch_pit[:, ACTIVE_BR].astype(np.bool_) + active_node_lookup = node_pit[:, ACTIVE_ND].astype(np.bool_) + slacks = np.where((node_pit[:, NODE_TYPE] == P) & active_node_lookup)[0] + else: + active_branch_lookup = branches_connected_flow(branch_pit) \ + & get_lookup(net, "branch", "active_hydraulics") + active_node_lookup = node_pit[:, ACTIVE_ND].astype(np.bool_)\ + & get_lookup(net, "node", "active_hydraulics") + slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & active_node_lookup)[0] - return perform_connectivity_search( - net, node_pit, branch_pit, heat_slacks, active_node_lookup, branches_connect, - mode="heat transfer" - ) + return perform_connectivity_search(net, node_pit, branch_pit, slacks, active_node_lookup, + active_branch_lookup, mode=mode) def perform_connectivity_search(net, node_pit, branch_pit, slack_nodes, @@ -612,7 +636,7 @@ def get_table_index_list(net, pit_array, pit_indices, pit_type="node"): for tbl in tables] -def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, mode="hydraulics"): +def reduce_pit(net, node_pit, branch_pit, mode="hydraulics"): """ Create an internal ("active") pit with all nodes and branches that are actually in_service. This is also done for different lookups (e.g. the from_to indices for this pit and the node index @@ -625,17 +649,16 @@ def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, m :type node_pit: np.array :param branch_pit: The internal structure branch array :type branch_pit: np.array - :param nodes_connected: A mask array stating which nodes are actually connected to the rest of\ - the net - :type nodes_connected: np.array - :param branches_connected: A mask array stating which branches are actually connected to the \ - rest of the net - :type branches_connected: np.array + :param mode: the mode of the calculation (either "hydraulics" or "heat_transfer") for storing /\ + retrieving correct lookups + :type mode: str, default "hydraulics" :return: No output """ active_pit = dict() els = dict() reduced_node_lookup = None + nodes_connected = get_lookup(net, "node", "active_" + mode) + branches_connected = get_lookup(net, "branch", "active_" + mode) if np.alltrue(nodes_connected): net["_lookups"]["node_from_to_active_" + mode] = copy.deepcopy( get_lookup(net, "node", "from_to")) @@ -673,8 +696,6 @@ def reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, m active_pit["branch"][:, TO_NODE] = reduced_node_lookup[ branch_pit[branches_connected, TO_NODE].astype(np.int32)] net["_active_pit"] = active_pit - net["_lookups"]["node_active_" + mode] = nodes_connected - net["_lookups"]["branch_active_" + mode] = branches_connected for el, connected_els in els.items(): ft_lookup = get_lookup(net, el, "from_to") diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 5ea369d40..a6171920c 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -14,7 +14,7 @@ from pandapower.pf.no_numba import jit -def extract_all_results(net, nodes_connected, branches_connected): +def extract_all_results(net): """ Extract results from branch pit and node pit and write them to the different tables of the net,\ as defined by the component models. @@ -228,24 +228,20 @@ def extract_branch_results_without_internals(net, branch_results, required_resul branch_results[entry][f:t][comp_connected_hyd] -def extract_results_active_pit(net, nodes_connected, branches_connected, mode="hydraulics"): +def extract_results_active_pit(net, mode="hydraulics"): """ Extract the pipeflow results from the internal pit structure ("_active_pit") to the general pit structure. :param net: The pandapipes net that the internal structure belongs to :type net: pandapipesNet - :param nodes_connected: A mask array stating which nodes are actually connected to the rest of\ - the net - :type nodes_connected: np.array - :param branches_connected: A mask array stating which branches are actually connected to the \ - rest of the net - :type branches_connected: np.array :param mode: defines whether results from hydraulic or temperature calculation are transferred :type mode: str, default "hydraulics" :return: No output """ + nodes_connected = get_lookup(net, "node", "active_" + mode) + branches_connected = get_lookup(net, "branch", "active_" + mode) result_node_col = PINIT if mode == "hydraulics" else TINIT_NODE not_affected_node_col = TINIT_NODE if mode == "hydraulics" else PINIT copied_node_cols = np.array([i for i in range(net["_pit"]["node"].shape[1]) diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 6ab5a9565..36caf60b3 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -7,15 +7,14 @@ from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve -from pandapipes.idx_branch import ACTIVE as ACTIVE_BR, FROM_NODE, TO_NODE, FROM_NODE_T, \ - TO_NODE_T, VINIT, T_OUT, VINIT_T -from pandapipes.idx_node import PINIT, TINIT, ACTIVE as ACTIVE_ND +from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T +from pandapipes.idx_node import PINIT, TINIT from pandapipes.pf.build_system_matrix import build_system_matrix from pandapipes.pf.derivative_calculation import calculate_derivatives_hydraulic from pandapipes.pf.pipeflow_setup import get_net_option, get_net_options, set_net_option, \ init_options, create_internal_results, write_internal_results, get_lookup, create_lookups, \ - initialize_pit, check_connectivity, reduce_pit, \ - set_user_pf_options, init_all_result_tables, connectivity_check_heat, get_active_nodes_branches + initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ + identify_active_nodes_branches from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit try: @@ -79,7 +78,7 @@ def pipeflow(net, sol_vec=None, **kwargs): calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - nodes_connected, branches_connected = get_active_nodes_branches(net, branch_pit, node_pit) + identify_active_nodes_branches(net, branch_pit, node_pit) if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: @@ -88,35 +87,27 @@ def pipeflow(net, sol_vec=None, **kwargs): else: net["_pit"]["node"][:, PINIT] = sol_vec[:len(node_pit)] net["_pit"]["branch"][:, VINIT] = sol_vec[len(node_pit):] - reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, - mode="hydraulics") if calculate_hydraulics: - reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, - mode="hydraulics") + reduce_pit(net, node_pit, branch_pit, mode="hydraulics") converged, _ = hydraulics(net) if not converged: raise PipeflowNotConverged("The hydraulic calculation did not converge to a solution.") - extract_results_active_pit(net, nodes_connected, branches_connected, mode="hydraulics") + extract_results_active_pit(net, mode="hydraulics") if calculate_heat: node_pit, branch_pit = net["_pit"]["node"], net["_pit"]["branch"] - nodes_connected, branches_connected = get_active_nodes_branches( - net, branch_pit, node_pit, False - ) - # active_node_pit = net["_active_pit"]["node"] - # active_branch_pit = net["_active_pit"]["branch"] - reduce_pit(net, node_pit, branch_pit, nodes_connected, branches_connected, - mode="heat_transfer") + identify_active_nodes_branches(net, branch_pit, node_pit, False) + reduce_pit(net, node_pit, branch_pit, mode="heat_transfer") converged, _ = heat_transfer(net) if not converged: raise PipeflowNotConverged("The heat transfer calculation did not converge to a " "solution.") - extract_results_active_pit(net, nodes_connected, branches_connected, mode="heat_transfer") + extract_results_active_pit(net, mode="heat_transfer") elif not calculate_hydraulics: raise UserWarning("No proper calculation mode chosen.") - extract_all_results(net, nodes_connected, branches_connected) + extract_all_results(net) def hydraulics(net): From 2940a87ea828791e73209c98c7c419d0961df5c5 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Fri, 9 Jun 2023 13:11:49 +0200 Subject: [PATCH 028/126] extended changelog --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 903afc7ed..a55d14496 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ Change Log - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) +- [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) [0.8.4] - 2023-02-02 ------------------------------- From 9ad6480185aff5a3bff6bf07704b1d04a74f6a45 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 12 Jun 2023 14:22:36 +0200 Subject: [PATCH 029/126] correction of not hard coding calculation mode in result extraction --- pandapipes/pf/result_extraction.py | 2 +- pandapipes/pipeflow.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index a6171920c..7c89d7416 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -49,7 +49,7 @@ def extract_all_results(net): } branch_results.update(gas_branch_results) for comp in net['component_list']: - comp.extract_results(net, net["_options"], branch_results, "hydraulics") + comp.extract_results(net, net["_options"], branch_results, mode) def get_basic_branch_results(net, branch_pit, node_pit): diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 36caf60b3..1dc89367a 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -107,7 +107,7 @@ def pipeflow(net, sol_vec=None, **kwargs): elif not calculate_hydraulics: raise UserWarning("No proper calculation mode chosen.") - extract_all_results(net) + extract_all_results(net, calculation_mode) def hydraulics(net): From 8f34a99c17137aed59f70a01f967fc725276b7c5 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 12 Jun 2023 14:26:13 +0200 Subject: [PATCH 030/126] small bug fix of missing argument --- pandapipes/pf/result_extraction.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 7c89d7416..619230e02 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -14,13 +14,15 @@ from pandapower.pf.no_numba import jit -def extract_all_results(net): +def extract_all_results(net, calculation_mode): """ Extract results from branch pit and node pit and write them to the different tables of the net,\ as defined by the component models. :param net: pandapipes net for which to extract results into net.res_xy :type net: pandapipesNet + :param net: mode of the simulation (e.g. "hydraulics" or "heat" or "all") + :type net: str :return: No output """ @@ -49,7 +51,7 @@ def extract_all_results(net): } branch_results.update(gas_branch_results) for comp in net['component_list']: - comp.extract_results(net, net["_options"], branch_results, mode) + comp.extract_results(net, net["_options"], branch_results, calculation_mode) def get_basic_branch_results(net, branch_pit, node_pit): From cbe1afb9432d0e9abc67c87ddaef1cc92201bc19 Mon Sep 17 00:00:00 2001 From: Steffen Meinecke Date: Fri, 21 Jul 2023 09:27:58 +0200 Subject: [PATCH 031/126] provide BSD license via link to license file (#549) --- doc/source/about/license.rst | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/doc/source/about/license.rst b/doc/source/about/license.rst index ee323bc74..cc6c655d9 100644 --- a/doc/source/about/license.rst +++ b/doc/source/about/license.rst @@ -7,32 +7,7 @@ License .. highlight:: none -pandapipes is published under the following 3-clause BSD license: :: +pandapipes is published under the following 3-clause BSD license: - - Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics and - Energy System Technology (IEE) Kassel and individual contributors - (see AUTHORS file for details). All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, are permitted - provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, this list of conditions - and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright notice, this list of - conditions and the following disclaimer in the documentation and/or other materials provided - with the distribution. - - 3. Neither the name of the copyright holder nor the names of its contributors may be used to - endorse or promote products derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY - WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + .. literalinclude:: ../../../LICENSE From 5e486e99c1d8d2834e51600be2d43c2a8970a8d2 Mon Sep 17 00:00:00 2001 From: jkisse Date: Wed, 26 Jul 2023 14:42:51 +0200 Subject: [PATCH 032/126] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0bca07405..30a659782 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,7 +85,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest igraph pytest-split numba + python -m pip install pytest igraph pytest-split if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi - name: Install pandapipes from TestPyPI if: ${{ inputs.upload_server == 'testpypi'}} From b2de0314de074e49fe3966f6c86727090a310b30 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Wed, 26 Jul 2023 14:54:55 +0200 Subject: [PATCH 033/126] release preparation * update example nets --- CHANGELOG.rst | 1 + README.rst | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 573837bb7..9f58d4580 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,7 @@ Change Log - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) +- [REMOVED] broken travis badge removed from readme [0.8.5] - 2023-06-19 ------------------------------- diff --git a/README.rst b/README.rst index 361db9b26..6a3886497 100644 --- a/README.rst +++ b/README.rst @@ -18,10 +18,6 @@ :target: http://pandapipes.readthedocs.io/ :alt: docs -.. image:: https://travis-ci.org/e2nIEE/pandapipes.svg?branch=master - :target: https://travis-ci.org/e2nIEE/pandapipes/branches - :alt: travis - .. image:: https://codecov.io/gh/e2nIEE/pandapipes/branch/master/graph/badge.svg :target: https://codecov.io/github/e2nIEE/pandapipes?branch=master :alt: codecov From 8d8a3af79902eff3eec360724a735bc64a6144cc Mon Sep 17 00:00:00 2001 From: Daniel Lohmeier <31214121+dlohmeier@users.noreply.github.com> Date: Tue, 8 Aug 2023 15:26:32 +0200 Subject: [PATCH 034/126] Adaption get_internal_tables_pandas (#539) extend the toolbox function get_internal_tables_pandas such that the overridden indices are derived from the idx_node and idx_branch file directly, so that the lookups don't have to be updated with version changes --- CHANGELOG.rst | 1 + pandapipes/idx_branch.py | 4 ++ pandapipes/idx_node.py | 4 +- pandapipes/toolbox.py | 147 +++++++++++++++------------------------ 4 files changed, 65 insertions(+), 91 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f8fc1c444..fa1614946 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,6 +7,7 @@ Change Log - [ADDED] support Python 3.11 (now included in test pipeline) - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [REMOVED] broken travis badge removed from readme +- [CHANGED] dynamic creation of lookups for getting pit as pandas tables [0.8.5] - 2023-06-19 ------------------------------- diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index a2846aa28..2b59f2360 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -2,6 +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. +# branch types +# no types defined + +# branch indices TABLE_IDX = 0 # number of the table that this branch belongs to ELEMENT_IDX = 1 # index of the element that this branch belongs to (within the given table) FROM_NODE = 2 # f, from bus number diff --git a/pandapipes/idx_node.py b/pandapipes/idx_node.py index 6a4abef2c..0cf71b5a2 100644 --- a/pandapipes/idx_node.py +++ b/pandapipes/idx_node.py @@ -2,14 +2,14 @@ # 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. -# define bus types +# node types P = 1 # Reference node, pressure is fixed L = 2 # All other nodes T = 10 # Reference node with fixed temperature, otherwise 0 PC = 20 # Controlled node with fixed pressure p NONE = 3 # None -# define the indices +# node indices TABLE_IDX = 0 # number of the table that this node belongs to ELEMENT_IDX = 1 # index of the element that this node belongs to (within the given table) NODE_TYPE = 2 # junction type diff --git a/pandapipes/toolbox.py b/pandapipes/toolbox.py index afb78a44c..7f6c1fb53 100644 --- a/pandapipes/toolbox.py +++ b/pandapipes/toolbox.py @@ -2,6 +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. import copy +import os from collections.abc import Iterable import numpy as np @@ -13,27 +14,8 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent from pandapipes.component_models.abstract_models.node_element_models import NodeElementComponent from pandapipes.create import create_empty_network -from pandapipes.idx_branch import TABLE_IDX as TABLE_IDX_BRANCH, ELEMENT_IDX as ELEMENT_IDX_BRANCH, \ - FROM_NODE as FROM_NODE_BRANCH, TO_NODE as TO_NODE_BRANCH, ACTIVE as ACTIVE_BRANCH, \ - LENGTH as LENGTH_BRANCH, D as D_BRANCH, AREA as AREA_BRANCH, RHO as RHO_BRANCH, \ - ETA as ETA_BRANCH, K as K_BRANCH, TINIT as TINIT_BRANCH, VINIT as VINIT_BRANCH, \ - RE as RE_BRANCH, LAMBDA as LAMBDA_BRANCH, JAC_DERIV_DV as JAC_DERIV_DV_BRANCH, \ - JAC_DERIV_DP as JAC_DERIV_DP_BRANCH, JAC_DERIV_DP1 as JAC_DERIV_DP1_BRANCH, \ - LOAD_VEC_BRANCHES as LOAD_VEC_BRANCHES_BRANCH, JAC_DERIV_DV_NODE as JAC_DERIV_DV_NODE_BRANCH, \ - LOAD_VEC_NODES as LOAD_VEC_NODES_BRANCH, LOSS_COEFFICIENT as LOSS_COEFFICIENT_BRANCH, \ - CP as CP_BRANCH, ALPHA as ALPHA_BRANCH, JAC_DERIV_DT as JAC_DERIV_DT_BRANCH, \ - JAC_DERIV_DT1 as JAC_DERIV_DT1_BRANCH, LOAD_VEC_BRANCHES_T as LOAD_VEC_BRANCHES_T_BRANCH, \ - T_OUT as T_OUT_BRANCH, JAC_DERIV_DT_NODE as JAC_DERIV_DT_NODE_BRANCH, \ - LOAD_VEC_NODES_T as LOAD_VEC_NODES_T_BRANCH, VINIT_T as VINIT_T_BRANCH, \ - FROM_NODE_T as FROM_NODE_T_BRANCH, TO_NODE_T as TO_NODE_T_BRANCH, QEXT as QEXT_BRANCH, \ - TEXT as TEXT_BRANCH, STD_TYPE as STD_TYPE_BRANCH, PL as PL_BRANCH, TL as TL_BRANCH, \ - BRANCH_TYPE as BRANCH_TYPE_BRANCH, PRESSURE_RATIO as PRESSURE_RATIO_BRANCH, branch_cols -from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, ELEMENT_IDX as ELEMENT_IDX_NODE, \ - NODE_TYPE as NODE_TYPE_NODE, ACTIVE as ACTIVE_NODE, RHO as RHO_NODE, PINIT as PINIT_NODE, \ - LOAD as LOAD_NODE, HEIGHT as HEIGHT_NODE, TINIT as TINIT_NODE, PAMB as PAMB_NODE, \ - LOAD_T as LOAD_T_NODE, NODE_TYPE_T as NODE_TYPE_T_NODE, \ - EXT_GRID_OCCURENCE as EXT_GRID_OCCURENCE_NODE, \ - EXT_GRID_OCCURENCE_T as EXT_GRID_OCCURENCE_T_NODE, node_cols, \ +from pandapipes.idx_branch import branch_cols +from pandapipes.idx_node import node_cols, \ T as TYPE_T, P as TYPE_P, PC as TYPE_PC, NONE as TYPE_NONE, L as TYPE_L from pandapipes.pandapipes_net import pandapipesNet from pandapipes.topology import create_nxgraph @@ -542,76 +524,48 @@ def check_pressure_controllability(net, to_junction, controlled_junction): # logger.info("dropped %d %s elements with %d switches" % (len(trafos), table, num_switches)) -node_pit_indices = { - TABLE_IDX_NODE: "TABLE_IDX", - ELEMENT_IDX_NODE: "ELEMENT_IDX", - NODE_TYPE_NODE: "NODE_TYPE", - ACTIVE_NODE: "ACTIVE", - RHO_NODE: "RHO", - PINIT_NODE: "PINIT", - LOAD_NODE: "LOAD", - HEIGHT_NODE: "HEIGHT", - TINIT_NODE: "TINIT", - PAMB_NODE: "PAMB", - LOAD_T_NODE: "LOAD_T", - NODE_TYPE_T_NODE: "NODE_TYPE_T", - EXT_GRID_OCCURENCE_NODE: "EXT_GRID_OCCURENCE", - EXT_GRID_OCCURENCE_T_NODE: "EXT_GRID_OCCURENCE_T", -} - -branch_pit_indices = { - TABLE_IDX_BRANCH: "TABLE_IDX", - ELEMENT_IDX_BRANCH: "ELEMENT_IDX", - FROM_NODE_BRANCH: "FROM_NODE", - TO_NODE_BRANCH: "TO_NODE", - ACTIVE_BRANCH: "ACTIVE", - LENGTH_BRANCH: "LENGTH", - D_BRANCH: "D", - AREA_BRANCH: "AREA", - RHO_BRANCH: "RHO", - ETA_BRANCH: "ETA", - K_BRANCH: "K", - TINIT_BRANCH: "TINIT", - VINIT_BRANCH: "VINIT", - RE_BRANCH: "RE", - LAMBDA_BRANCH: "LAMBDA", - JAC_DERIV_DV_BRANCH: "JAC_DERIV_DV", - JAC_DERIV_DP_BRANCH: "JAC_DERIV_DP", - JAC_DERIV_DP1_BRANCH: "JAC_DERIV_DP1", - LOAD_VEC_BRANCHES_BRANCH: "LOAD_VEC_BRANCHES", - JAC_DERIV_DV_NODE_BRANCH: "JAC_DERIV_DV_NODE", - LOAD_VEC_NODES_BRANCH: "LOAD_VEC_NODES", - LOSS_COEFFICIENT_BRANCH: "LOSS_COEFFICIENT", - CP_BRANCH: "CP", - ALPHA_BRANCH: "ALPHA", - JAC_DERIV_DT_BRANCH: "JAC_DERIV_DT", - JAC_DERIV_DT1_BRANCH: "JAC_DERIV_DT1", - LOAD_VEC_BRANCHES_T_BRANCH: "LOAD_VEC_BRANCHES_T", - T_OUT_BRANCH: "T_OUT", - JAC_DERIV_DT_NODE_BRANCH: "JAC_DERIV_DT_NODE", - LOAD_VEC_NODES_T_BRANCH: "LOAD_VEC_NODES_T", - VINIT_T_BRANCH: "VINIT_T", - FROM_NODE_T_BRANCH: "FROM_NODE_T", - TO_NODE_T_BRANCH: "TO_NODE_T", - QEXT_BRANCH: "QEXT", - TEXT_BRANCH: "TEXT", - STD_TYPE_BRANCH: "STD_TYPE", - PL_BRANCH: "PL", - TL_BRANCH: "TL", - BRANCH_TYPE_BRANCH: "BRANCH_TYPE", - PRESSURE_RATIO_BRANCH: "PRESSURE_RATIO", -} +pit_types = {TYPE_P: "P", TYPE_L: "L", TYPE_NONE: "NONE", TYPE_T: "T", TYPE_PC: "PC", 0: "NONE"} +int_cols = ["FROM_NODE", "TO_NODE", "ELEMENT_IDX", "EXT_GRID_OCCURENCE", "EXT_GRID_OCCURENCE_T"] +bool_cols = ["ACTIVE"] -pit_types = {TYPE_P: "P", TYPE_L: "L", TYPE_NONE: "NONE", TYPE_T: "T", TYPE_PC: "PC", 0: "NONE"} +def get_pit_lookup(pit_type="node"): + """ + Retrieve a lookup for "indices" and "types" from the idx_branch or idx_node files. + :param pit_type: the pit for which the lookup is generated ("branch" or "node") + :type pit_type: str, default "node" + :return: idx_lookup: dictionary of structure {column: name} derived from idx_node.py or \ + idx_branch.py to describe the structure of the pit + :rtype: dict + """ + idx_lookup = {"indices": dict(), "types": dict()} + with open(os.path.join(pandapipes.pp_dir, f"idx_{pit_type}.py")) as f: + lookup_type = None + for ln in f.readlines(): + if ln.strip().startswith("#"): + if "indices" in ln: + lookup_type = "indices" + elif "types" in ln: + lookup_type = "types" + if lookup_type is None: + continue + txt = ln.split("#")[0] + if "=" not in txt: + continue + part1, part2 = txt.split("=") + idx_lookup[lookup_type][int(part2.strip())] = part1.strip() + return idx_lookup -def get_internal_tables_pandas(net): + +def get_internal_tables_pandas(net, convert_types=True): """ Convert the internal structure (pit) for nodes and branches into readable pandas DataFrames. :param net: pandapipes network :type net: pandapipesNet + :param convert_types: if True, convert some columns into a more readable form + :type convert_types: bool, default True :return: node_table, branch_table :rtype: pandas.DataFrame """ @@ -632,17 +586,32 @@ def get_internal_tables_pandas(net): logger.warning("%d branch pit entries are missing. Please verify the correctness of the " "table." % missing_branches) + node_lookup = get_pit_lookup("node") + branch_lookup = get_pit_lookup("branch") + node_table_lookup = pandapipes.get_lookup(net, "node", "table") node_table = pd.DataFrame(node_pit) - node_table.rename(columns=node_pit_indices, inplace=True) - node_table["NODE_TYPE"].replace(pit_types, inplace=True) - node_table["NODE_TYPE_T"].replace(pit_types, inplace=True) - node_table["TABLE_IDX"].replace(node_table_lookup["n2t"], inplace=True) + node_table.rename(columns=node_lookup["indices"], inplace=True) branch_table_lookup = pandapipes.get_lookup(net, "branch", "table") branch_table = pd.DataFrame(branch_pit) - branch_table.rename(columns=branch_pit_indices, inplace=True) - branch_table["BRANCH_TYPE"].replace(pit_types, inplace=True) - branch_table["TABLE_IDX"].replace(branch_table_lookup["n2t"], inplace=True) + branch_table.rename(columns=branch_lookup["indices"], inplace=True) + + if convert_types: + # TODO: replace types with a version retrieved from get_pit_lookup, but before, the types + # need to be defined properly inside the files! + node_table["NODE_TYPE"].replace(pit_types, inplace=True) + node_table["NODE_TYPE_T"].replace(pit_types, inplace=True) + node_table["TABLE_IDX"].replace(node_table_lookup["n2t"], inplace=True) + + branch_table["BRANCH_TYPE"].replace(pit_types, inplace=True) + branch_table["TABLE_IDX"].replace(branch_table_lookup["n2t"], inplace=True) + + for col in int_cols + bool_cols: + for tbl in (node_table, branch_table): + if col in tbl.columns: + tbl[col] = tbl[col].astype(np.int32) + if col in bool_cols: + tbl[col] = tbl[col].astype(np.bool_) return node_table, branch_table From 7d6b3eb91f845c2e86ad4fb231842773d4a79811 Mon Sep 17 00:00:00 2001 From: Daniel Lohmeier <31214121+dlohmeier@users.noreply.github.com> Date: Wed, 9 Aug 2023 15:20:01 +0200 Subject: [PATCH 035/126] adapted the heat exchanger creation in the stanet converter (#538) * adapted the heat exchanger creation in the stanet converter - if required by user, the flow through heat exchangers is stored in the pandapipes net - added qext_w from stanet - no filtering for connections in heat exchangers (not clear what that was supposed to do, but created errors) - additionally save temperature results for stanet nodes * added heat transfer coefficient to pipes in stanet converter * added external temperature to pipe creation functions * renamed function to create heat exchangers within stanet converter * made TU argument optional in pipe creation of stanet converter (only if available in stanet table) * added changelog entry --- CHANGELOG.rst | 3 +- .../converter/stanet/stanet2pandapipes.py | 5 ++- pandapipes/converter/stanet/table_creation.py | 40 ++++++++++++++----- 3 files changed, 35 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fa1614946..fb2e99371 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,8 +6,9 @@ Change Log - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) -- [REMOVED] broken travis badge removed from readme - [CHANGED] dynamic creation of lookups for getting pit as pandas tables +- [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added +- [REMOVED] broken travis badge removed from readme [0.8.5] - 2023-06-19 ------------------------------- diff --git a/pandapipes/converter/stanet/stanet2pandapipes.py b/pandapipes/converter/stanet/stanet2pandapipes.py index 3ff7d8376..a0a4f6875 100644 --- a/pandapipes/converter/stanet/stanet2pandapipes.py +++ b/pandapipes/converter/stanet/stanet2pandapipes.py @@ -9,7 +9,7 @@ connection_pipe_section_table, get_stanet_raw_data, create_meter_table, create_house_table from pandapipes.converter.stanet.table_creation import create_junctions_from_nodes, \ create_valve_and_pipe, create_pumps, create_junctions_from_connections, \ - create_pipes_from_connections, create_heat_exchangers, create_slider_valves, \ + create_pipes_from_connections, create_heat_exchangers_stanet, create_slider_valves, \ create_pipes_from_remaining_pipe_table, create_nodes_house_connections, \ create_sinks_meters, create_sinks_from_nodes, create_control_components, \ create_sinks_from_customers, create_pipes_house_connections @@ -92,7 +92,8 @@ def stanet_to_pandapipes(stanet_path, name="net", remove_unused_household_connec create_pipes_from_remaining_pipe_table(net, stored_data, connections, index_mapping, pipe_geodata, add_layers) - create_heat_exchangers(net, stored_data, connections, index_mapping, add_layers) + create_heat_exchangers_stanet(net, stored_data, index_mapping, add_layers, + add_flow=kwargs.pop("add_heat_exchanger_flow", False)) # valves always have a length in STANET, therefore, they are created as valve with pipe in # pandapipes diff --git a/pandapipes/converter/stanet/table_creation.py b/pandapipes/converter/stanet/table_creation.py index 4c02c80ee..553a0c3f4 100644 --- a/pandapipes/converter/stanet/table_creation.py +++ b/pandapipes/converter/stanet/table_creation.py @@ -65,7 +65,8 @@ def create_junctions_from_nodes(net, stored_data, net_params, index_mapping, add add_info = {"stanet_id": node_table.STANETID.astype(str).values if "STANETID" in node_table.columns else knams, "p_stanet": node_table.PRECH.values.astype(np.float64), - "stanet_valid": ~node_table.CALCBAD.values.astype(np.bool_)} + "stanet_valid": ~node_table.CALCBAD.values.astype(np.bool_), + "t_stanet": node_table.TEMP.values.astype(np.float64)} if hasattr(node_table, "KFAK"): add_info["K_stanet"] = node_table.KFAK.values.astype(np.float64) if add_layers: @@ -152,11 +153,14 @@ def create_valve_and_pipe(net, stored_data, index_mapping, net_params, stanet_li stanet_nr=-999, stanet_id='aux_' + j_ref['stanet_id'], p_stanet=np.NaN, stanet_active=bool(row.ISACTIVE), **add_info ) + text_k = 293 + if hasattr(row, "TU"): + text_k = row.TU + 273.15 pandapipes.create_pipe_from_parameters( net, node_mapping[from_stanet_nr], j_aux, length_km=row.RORL / 1000, diameter_m=float(row.DM / 1000), k_mm=row.RAU, loss_coefficient=row.ZETA, name="pipe_%s_%s" % (str(row.ANFNAM), 'aux_' + str(row.ENDNAM)), - in_service=bool(row.ISACTIVE), stanet_nr=-999, + text_k=text_k, in_service=bool(row.ISACTIVE), stanet_nr=-999, stanet_id='pipe_valve_' + str(row.STANETID), v_stanet=row.VM, stanet_active=bool(row.ISACTIVE), stanet_valid=False, **add_info ) @@ -559,10 +563,14 @@ def create_geodata_sections(row): if add_layers: add_info["stanet_layer"] = pipes.LAYER.values.astype(str) # TODO: v_stanet might have to be extended by house connections VMA and VMB + text_k = 293 + if "TU" in pipes.columns: + text_k = pipes.TU.values.astype(np.float64) + 273.15 pandapipes.create_pipes_from_parameters( net, pipe_sections.fj.values, pipe_sections.tj.values, pipe_sections.length.values / 1000, pipes.DM.values / 1000, pipes.RAU.values, pipes.ZETA.values, type="main_pipe", - stanet_std_type=pipes.ROHRTYP.values, in_service=pipes.ISACTIVE.values, + stanet_std_type=pipes.ROHRTYP.values, in_service=pipes.ISACTIVE.values, text_k=text_k, + alpha_w_per_m2k=pipes.WDZAHL.values.astype(np.float64), name=["pipe_%s_%s_%s" % (nf, nt, sec) for nf, nt, sec in zip( pipes.ANFNAM.values, pipes.ENDNAM.values, pipe_sections.section_no.values)], stanet_nr=pipes.RECNO.values, stanet_id=pipes.STANETID.values, @@ -574,27 +582,26 @@ def create_geodata_sections(row): ) -def create_heat_exchangers(net, stored_data, connection_table, index_mapping, add_layers): +def create_heat_exchangers_stanet(net, stored_data, index_mapping, add_layers, add_flow=False): """ Creates pandapipes heat exchangers from STANET connections. :param net: :type net: :param stored_data: :type stored_data: - :param connection_table: - :type connection_table: :param index_mapping: :type index_mapping: :param add_layers: :type add_layers: + :param add_flow: + :type add_flow: :return: :rtype: """ if "heat_exchangers" not in stored_data: return - heat_ex_table = stored_data["heat_exchangers"] + heat_exchanger = stored_data["heat_exchangers"] logger.info("Creating all heat exchangers.") - heat_exchanger = heat_ex_table.loc[~heat_ex_table.RECNO.isin(connection_table.SNUM.values)] node_mapping = index_mapping["nodes"] for row in heat_exchanger.itertuples(): @@ -616,9 +623,14 @@ def create_heat_exchangers(net, stored_data, connection_table, index_mapping, ad add_info = dict() if add_layers: add_info["stanet_layer"] = str(row.LAYER) + if add_flow: + add_info["flow_stanet"] = row.FLUSS + qext = 0 + if hasattr(row, "WAERMECALC"): + qext = getattr(row, "WAERMECALC") * (-1000) # TODO: there is no qext given!!! pandapipes.create_heat_exchanger( - net, node_mapping[from_stanet_nr], node_mapping[to_stanet_nr], qext_w=0, + net, node_mapping[from_stanet_nr], node_mapping[to_stanet_nr], qext_w=qext, diameter_m=float(row.DM / 1000), loss_coefficient=row.ZETA, std_type=row.ROHRTYP, in_service=bool(row.ISACTIVE), name="heat_exchanger_%s_%s" % (row.ANFNAM, row.ENDNAM), stanet_nr=int(row.RECNO), stanet_id=str(row.STANETID), v_stanet=row.VM, @@ -679,11 +691,15 @@ def create_pipes_from_remaining_pipe_table(net, stored_data, connection_table, i add_info = dict() if add_layers: add_info["stanet_layer"] = p_tbl.LAYER.values.astype(str) + text_k = 293 + if "TU" in p_tbl.columns: + text_k = p_tbl.TU.values.astype(np.float64) + 273.15 pandapipes.create_pipes_from_parameters( net, from_junctions, to_junctions, length_km=p_tbl.RORL.values.astype(np.float64) / 1000, type="main_pipe", diameter_m=p_tbl.DM.values.astype(np.float64) / 1000, loss_coefficient=p_tbl.ZETA.values, stanet_std_type=p_tbl.ROHRTYP.values, k_mm=p_tbl.RAU.values, in_service=p_tbl.ISACTIVE.values.astype(np.bool_), + alpha_w_per_m2k=p_tbl.WDZAHL.values.astype(np.float64), text_k=text_k, name=["pipe_%s_%s" % (anf, end) for anf, end in zip(from_names[valid], to_names[valid])], stanet_nr=p_tbl.RECNO.values.astype(np.int32), stanet_id=p_tbl.STANETID.values.astype(str), v_stanet=p_tbl.VM.values, geodata=geodata, @@ -990,11 +1006,15 @@ def create_geodata_sections(row): if add_layers: add_info["stanet_layer"] = hp_data.LAYER.values.astype(str) # TODO: v_stanet might have to be extended by house connections VMA and VMB + text_k = 293 + if "TU" in hp_data.columns: + text_k = hp_data.TU.values.astype(np.float64) + 273.15 pandapipes.create_pipes_from_parameters( net, hp_data.fj.values, hp_data.tj.values, hp_data.length.values / 1000, hp_data.DM.values / 1000, hp_data.RAU.values, hp_data.ZETA.values, type="house_pipe", stanet_std_type=hp_data.ROHRTYP.values, - in_service=hp_data.ISACTIVE.values if houses_in_calculation else False, + in_service=hp_data.ISACTIVE.values if houses_in_calculation else False, text_k=text_k, + alpha_w_per_m2k=hp_data.WDZAHL.values.astype(np.float64), name=["pipe_%s_%s_%s" % (nf, nt, sec) for nf, nt, sec in zip( hp_data.CLIENTID.values, hp_data.CLIENT2ID.values, hp_data.section_no.values)], stanet_nr=hp_data.RECNO.values, stanet_id=hp_data.STANETID.values, From f87207d4032bdef8fbc42c8968fb112293622a64 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Thu, 10 Aug 2023 11:46:17 +0200 Subject: [PATCH 036/126] small adaption of T_OUT in pipe component to be derived from nodes --- pandapipes/component_models/pipe_component.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index f8f38aa18..c81a41eb3 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -151,7 +151,9 @@ def create_pit_branch_entries(cls, net, branch_pit): set_entry_check_repeat( pipe_pit, LC, net[tbl].loss_coefficient.values, internal_pipe_number, has_internals) - pipe_pit[:, T_OUT] = 293 + node_pit = net["_pit"]["node"] + to_nodes = pipe_pit[:, TO_NODE].astype(np.int32) + pipe_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] pipe_pit[:, AREA] = pipe_pit[:, D] ** 2 * np.pi / 4 @classmethod From 2779ef84bb718f501f10739aeb374d7b16cf8da5 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Wed, 16 Aug 2023 21:50:34 +0200 Subject: [PATCH 037/126] Update .readthedocs.yml (#558) According to their blogpost https://blog.readthedocs.com/use-build-os-config/ --- .readthedocs.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 9fcbb7ac8..cc8a6ca6b 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,9 +1,8 @@ version: 2 -python: - version: 3.7 - install: - - method: pip - path: . - extra_requirements: - - docs +build: + os: ubuntu-22.04 + tools: + python: "3.10" + commands: + - pip install .["docs"] From 98d8cdff103346a29ddb2a4a42794bffd474b950 Mon Sep 17 00:00:00 2001 From: Jolando Kisse Date: Fri, 18 Aug 2023 10:20:43 +0200 Subject: [PATCH 038/126] Revert "Update .readthedocs.yml (#558)" (#559) This reverts commit 2779ef84bb718f501f10739aeb374d7b16cf8da5. --- .readthedocs.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index cc8a6ca6b..9fcbb7ac8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,8 +1,9 @@ version: 2 -build: - os: ubuntu-22.04 - tools: - python: "3.10" - commands: - - pip install .["docs"] +python: + version: 3.7 + install: + - method: pip + path: . + extra_requirements: + - docs From a77504219a545be72ca3ba3b4e64f3d27b8a1168 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 30 Aug 2023 08:38:47 +0200 Subject: [PATCH 039/126] added test to make sure that pipeflow fails for disconnected nets without connectivity check --- .../test/pipeflow_internals/test_inservice.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 706f593ed..586fe7c11 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -268,6 +268,10 @@ def test_connectivity_hydraulic2(create_test_net, use_numba): assert not np.all(np.isnan(net.res_pipe.values)) assert np.any(np.isnan(net.res_junction.loc[[7, 8, 10, 11], :].values)) + with pytest.raises(PipeflowNotConverged): + pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", + use_numba=use_numba, check_connectivity=False) + @pytest.mark.parametrize("use_numba", [True, False]) def test_connectivity_heat1(complex_heat_connectivity_grid, use_numba): @@ -374,6 +378,26 @@ def test_connectivity_heat4(complex_heat_connectivity_grid, use_numba): assert pandapipes.nets_equal(net, net2, check_only_results=True) +@pytest.mark.parametrize("use_numba", [True, False]) +def test_connectivity_heat5(complex_heat_connectivity_grid, use_numba): + net = copy.deepcopy(complex_heat_connectivity_grid) + net.pipe.in_service.loc[[7, 8]] = True + + j_from, j_to = pandapipes.create_junctions(net, 2, 1, 320.15) + + pandapipes.create_pipe_from_parameters(net, j_from, j_to, 0.1, 0.1, alpha_w_per_m2k=5) + pandapipes.create_sink(net, j_to, 0.1) + pandapipes.create_ext_grid(net, j_from, 1, 320.15) + + net.ext_grid.loc[2, 'in_service'] = False + net.ext_grid.loc[1, 'type'] = 'p' + + pandapipes.pipeflow(net, check_connectivity=True, mode='all', use_numba=use_numba) + + with pytest.raises(PipeflowNotConverged): + pandapipes.pipeflow(net, check_connectivity=False, mode='all', use_numba=use_numba) + + @pytest.mark.parametrize("use_numba", [True, False]) def test_exclude_unconnected_junction(use_numba): """ From 4d7286c065dfc786becc147beb278252ad79ae3d Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 30 Aug 2023 08:53:12 +0200 Subject: [PATCH 040/126] slight improvement in test --- .../test/pipeflow_internals/test_inservice.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 586fe7c11..1db306804 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -266,7 +266,7 @@ def test_connectivity_hydraulic2(create_test_net, use_numba): assert not np.all(np.isnan(net.res_junction.p_bar.loc[[0, 1, 2, 3, 4, 5, 9]].values)) assert not np.all(np.isnan(net.res_pipe.values)) - assert np.any(np.isnan(net.res_junction.loc[[7, 8, 10, 11], :].values)) + assert np.all(np.isnan(net.res_junction.p_bar.loc[[7, 8, 10, 11]].values)) with pytest.raises(PipeflowNotConverged): pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", @@ -280,6 +280,8 @@ def test_connectivity_heat1(complex_heat_connectivity_grid, use_numba): oos_juncs_hyd = {4, 5, 6, 7} oos_pipe_hyd = {5, 7, 8, 9} + oos_sink_hyd = {4, 5} + oos_source_hyd = {7} assert set(net.res_junction.loc[net.res_junction.p_bar.notnull()].index) == \ set(net.junction.index) - oos_juncs_hyd @@ -293,12 +295,13 @@ def test_connectivity_heat1(complex_heat_connectivity_grid, use_numba): assert set(net.res_valve.loc[net.res_valve.v_mean_m_per_s.isnull()].index) \ == set(net.valve.index) - assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.isnull()].index) == {4, 5} + assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.isnull()].index) == oos_sink_hyd assert set(net.res_sink.loc[net.res_sink.mdot_kg_per_s.notnull()].index) == \ - set(net.sink.index) - {4, 5} + set(net.sink.index) - oos_sink_hyd - assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.isnull()].index) == {7} - assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.notnull()].index) == {2} + assert set(net.res_source.loc[net.res_source.mdot_kg_per_s.isnull()].index) == oos_source_hyd + assert (set(net.res_source.loc[net.res_source.mdot_kg_per_s.notnull()].index) == + set(net.source.index) - oos_source_hyd) assert np.allclose(net.res_ext_grid.mdot_kg_per_s.sum(), -net.res_sink.mdot_kg_per_s.sum() + net.res_source.mdot_kg_per_s.sum(), From a0a0fe351d4d79352a3bf3c9184fa4b31f00b490 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 30 Aug 2023 11:52:20 +0200 Subject: [PATCH 041/126] rearrangement of result extraction: - pass required result list from each component for hydraulics and heat transfer separately (instead of adding True/False to entries) - improved distinction when to extract which results with which lookup: extract hydraulic results with hydraulic connectivity in case of "hydraulics" or "all" simulation mode (not "heat"), extract heat results with hydraulic connectivity in case of "hydraulics" simulation mode and with heat_transfer connectivity in case of "heat" or "all" simulation mode --- .../component_models/component_toolbox.py | 21 +++ .../flow_control_component.py | 24 +-- .../heat_exchanger_component.py | 36 +++-- pandapipes/component_models/pipe_component.py | 37 ++--- .../pressure_control_component.py | 22 ++- pandapipes/component_models/pump_component.py | 22 ++- .../component_models/valve_component.py | 23 +-- pandapipes/pf/pipeflow_setup.py | 2 +- pandapipes/pf/result_extraction.py | 139 ++++++++++-------- 9 files changed, 168 insertions(+), 158 deletions(-) diff --git a/pandapipes/component_models/component_toolbox.py b/pandapipes/component_models/component_toolbox.py index 04f357b39..2db03d127 100644 --- a/pandapipes/component_models/component_toolbox.py +++ b/pandapipes/component_models/component_toolbox.py @@ -5,6 +5,7 @@ import numpy as np import pandas as pd +from pandapipes import get_fluid from pandapipes.constants import NORMAL_PRESSURE, TEMP_GRADIENT_KPM, AVG_TEMPERATURE_K, \ HEIGHT_EXPONENT from pandapipes.idx_branch import LOAD_VEC_NODES, FROM_NODE, TO_NODE @@ -177,3 +178,23 @@ def get_mass_flow_at_nodes(net, node_pit, branch_pit, eg_nodes, comp): raise UserWarning("In component %s: Something went wrong with the mass flow balance. " "Please report this error at github." % comp.__name__) return sum_mass_flows, inverse_nodes, counts + + +def standard_branch_wo_internals_result_lookup(net): + required_results_hyd = [ + ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("mdot_to_kg_per_s", "mf_to"), + ("mdot_from_kg_per_s", "mf_from"), ("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), + ("reynolds", "reynolds") + ] + required_results_ht = [("t_from_k", "temp_from"), ("t_to_k", "temp_to")] + + if get_fluid(net).is_gas: + required_results_hyd.extend([ + ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), + ("v_mean_m_per_s", "v_gas_mean"), ("normfactor_from", "normfactor_from"), + ("normfactor_to", "normfactor_to") + ]) + else: + required_results_hyd.extend([("v_mean_m_per_s", "v_mps")]) + + return required_results_hyd, required_results_ht \ No newline at end of file diff --git a/pandapipes/component_models/flow_control_component.py b/pandapipes/component_models/flow_control_component.py index 2e08137f2..739e5ada2 100644 --- a/pandapipes/component_models/flow_control_component.py +++ b/pandapipes/component_models/flow_control_component.py @@ -6,6 +6,7 @@ from numpy import dtype from pandapipes.component_models.abstract_models import BranchWZeroLengthComponent, get_fluid +from pandapipes.component_models.component_toolbox import standard_branch_wo_internals_result_lookup from pandapipes.component_models.junction_component import Junction from pandapipes.idx_branch import D, AREA, TL, JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, VINIT, \ RHO, LOAD_VEC_BRANCHES, ELEMENT_IDX @@ -84,27 +85,10 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): @classmethod def extract_results(cls, net, options, branch_results, mode): - required_results = [ - ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), - ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), - ("reynolds", "reynolds", False) - ] + required_results_hyd, required_results_ht = standard_branch_wo_internals_result_lookup(net) - if get_fluid(net).is_gas: - required_results.extend([ - ("v_from_m_per_s", "v_gas_from", False), - ("v_to_m_per_s", "v_gas_to", False), - ("v_mean_m_per_s", "v_gas_mean", False), - ("normfactor_from", "normfactor_from", False), - ("normfactor_to", "normfactor_to", False) - ]) - else: - required_results.extend([("v_mean_m_per_s", "v_mps", False)]) - - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + extract_branch_results_without_internals(net, branch_results, required_results_hyd, + required_results_ht, cls.table_name(), mode) @classmethod def get_component_input(cls): diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index 6bed45017..6304bb4dd 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -5,6 +5,7 @@ import numpy as np from numpy import dtype +from pandapipes.component_models import standard_branch_wo_internals_result_lookup from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction @@ -61,27 +62,24 @@ def create_pit_branch_entries(cls, net, branch_pit): @classmethod def extract_results(cls, net, options, branch_results, mode): - required_results = [ - ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), - ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), - ("reynolds", "reynolds", False) - ] + """ + Class method to extract pipeflow results from the internal structure into the results table. - if get_fluid(net).is_gas: - required_results.extend([ - ("v_from_m_per_s", "v_gas_from", False), - ("v_to_m_per_s", "v_gas_to", False), - ("v_mean_m_per_s", "v_gas_mean", False), - ("normfactor_from", "normfactor_from", False), - ("normfactor_to", "normfactor_to", False) - ]) - else: - required_results.extend([("v_mean_m_per_s", "v_mps", False)]) + :param net: The pandapipes network + :type net: pandapipesNet + :param options: pipeflow options + :type options: dict + :param branch_results: important branch results + :type branch_results: dict + :param mode: simulation mode + :type mode: str + :return: No Output. + :rtype: None + """ + required_results_hyd, required_results_ht = standard_branch_wo_internals_result_lookup(net) - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + extract_branch_results_without_internals(net, branch_results, required_results_hyd, + required_results_ht, cls.table_name(), mode) @classmethod def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index f9555af27..3bb9bdf57 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -171,31 +171,34 @@ def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): @classmethod def extract_results(cls, net, options, branch_results, mode): - res_nodes_from = [("p_from_bar", "p_from", False), ("t_from_k", "temp_from", True), - ("mdot_from_kg_per_s", "mf_from", False)] - res_nodes_to = [("p_to_bar", "p_to", False), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False)] - res_mean = [("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), - ("reynolds", "reynolds", False)] + res_nodes_from_hyd = [("p_from_bar", "p_from"), ("mdot_from_kg_per_s", "mf_from")] + res_nodes_from_ht = [("t_from_k", "temp_from")] + res_nodes_to_hyd = [("p_to_bar", "p_to"), ("mdot_to_kg_per_s", "mf_to")] + res_nodes_to_ht = [("t_to_k", "temp_to")] + res_mean_hyd = [("vdot_norm_m3_per_s", "vf"), ("lambda", "lambda"), + ("reynolds", "reynolds")] if get_fluid(net).is_gas: - res_nodes_from.extend( - [("v_from_m_per_s", "v_gas_from", False), - ("normfactor_from", "normfactor_from", False)]) - res_nodes_to.extend([("v_to_m_per_s", "v_gas_to", False), - ("normfactor_to", "normfactor_to", False)]) - res_mean.extend([("v_mean_m_per_s", "v_gas_mean", False)]) + res_nodes_from_hyd.extend([("v_from_m_per_s", "v_gas_from"), + ("normfactor_from", "normfactor_from")]) + res_nodes_to_hyd.extend([("v_to_m_per_s", "v_gas_to"), + ("normfactor_to", "normfactor_to")]) + res_mean_hyd.extend([("v_mean_m_per_s", "v_gas_mean")]) else: - res_mean.extend([("v_mean_m_per_s", "v_mps", False)]) + res_mean_hyd.extend([("v_mean_m_per_s", "v_mps")]) if np.any(cls.get_internal_pipe_number(net) > 1): extract_branch_results_with_internals( - net, branch_results, cls.table_name(), res_nodes_from, res_nodes_to, res_mean, + net, branch_results, cls.table_name(), res_nodes_from_hyd, res_nodes_from_ht, + res_nodes_to_hyd, res_nodes_to_ht, res_mean_hyd, [], cls.get_connected_node_type().table_name(), mode) else: - required_results = res_nodes_from + res_nodes_to + res_mean - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + required_results_hyd = res_nodes_from_hyd + res_nodes_to_hyd + res_mean_hyd + required_results_ht = res_nodes_from_ht + res_nodes_to_ht + extract_branch_results_without_internals( + net, branch_results, required_results_hyd, required_results_ht, cls.table_name(), + mode + ) @classmethod def get_internal_results(cls, net, pipe): diff --git a/pandapipes/component_models/pressure_control_component.py b/pandapipes/component_models/pressure_control_component.py index 7cb682342..89d2f220f 100644 --- a/pandapipes/component_models/pressure_control_component.py +++ b/pandapipes/component_models/pressure_control_component.py @@ -109,24 +109,22 @@ def extract_results(cls, net, options, branch_results, mode): :type options: :return: No Output. """ - required_results = [ - ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), - ("vdot_norm_m3_per_s", "vf", False) + required_results_hyd = [ + ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("mdot_from_kg_per_s", "mf_from"), + ("mdot_to_kg_per_s", "mf_to"), ("vdot_norm_m3_per_s", "vf") ] + required_results_ht = [("t_from_k", "temp_from"), ("t_to_k", "temp_to")] if get_fluid(net).is_gas: - required_results.extend([ - ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), - ("normfactor_from", "normfactor_from", False), - ("normfactor_to", "normfactor_to", False) + required_results_hyd.extend([ + ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), + ("normfactor_from", "normfactor_from"), ("normfactor_to", "normfactor_to") ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps", False)]) + required_results_hyd.extend([("v_mean_m_per_s", "v_mps")]) - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + extract_branch_results_without_internals(net, branch_results, required_results_hyd, + required_results_ht, cls.table_name(), mode) res_table = net["res_" + cls.table_name()] f, t = get_lookup(net, "branch", "from_to")[cls.table_name()] diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index e2516b70d..3de660002 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -127,24 +127,22 @@ def extract_results(cls, net, options, branch_results, mode): """ calc_compr_pow = options['calc_compression_power'] - required_results = [ - ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), - ("vdot_norm_m3_per_s", "vf", False), ("deltap_bar", "pl", False) + required_results_hyd = [ + ("p_from_bar", "p_from"), ("p_to_bar", "p_to"), ("mdot_to_kg_per_s", "mf_to"), + ("mdot_from_kg_per_s", "mf_from"), ("vdot_norm_m3_per_s", "vf"), ("deltap_bar", "pl"), ] + required_results_ht = [("t_from_k", "temp_from"), ("t_to_k", "temp_to")] if get_fluid(net).is_gas: - required_results.extend([ - ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), - ("normfactor_from", "normfactor_from", False), - ("normfactor_to", "normfactor_to", False) + required_results_hyd.extend([ + ("v_from_m_per_s", "v_gas_from"), ("v_to_m_per_s", "v_gas_to"), + ("normfactor_from", "normfactor_from"), ("normfactor_to", "normfactor_to") ]) else: - required_results.extend([("v_mean_m_per_s", "v_mps", False)]) + required_results_hyd.extend([("v_mean_m_per_s", "v_mps")]) - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + extract_branch_results_without_internals(net, branch_results, required_results_hyd, + required_results_ht, cls.table_name(), mode) if calc_compr_pow: f, t = get_lookup(net, "branch", "from_to")[cls.table_name()] diff --git a/pandapipes/component_models/valve_component.py b/pandapipes/component_models/valve_component.py index a1a9e8580..6c32676c0 100644 --- a/pandapipes/component_models/valve_component.py +++ b/pandapipes/component_models/valve_component.py @@ -5,6 +5,7 @@ import numpy as np from numpy import dtype +from pandapipes.component_models.component_toolbox import standard_branch_wo_internals_result_lookup from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction @@ -83,26 +84,10 @@ def get_component_input(cls): @classmethod def extract_results(cls, net, options, branch_results, mode): - required_results = [ - ("p_from_bar", "p_from", False), ("p_to_bar", "p_to", False), - ("t_from_k", "temp_from", True), ("t_to_k", "temp_to", True), - ("mdot_to_kg_per_s", "mf_to", False), ("mdot_from_kg_per_s", "mf_from", False), - ("vdot_norm_m3_per_s", "vf", False), ("lambda", "lambda", False), - ("reynolds", "reynolds", False) - ] + required_results_hyd, required_results_ht = standard_branch_wo_internals_result_lookup(net) - if get_fluid(net).is_gas: - required_results.extend([ - ("v_from_m_per_s", "v_gas_from", False), ("v_to_m_per_s", "v_gas_to", False), - ("v_mean_m_per_s", "v_gas_mean", False), - ("normfactor_from", "normfactor_from", False), - ("normfactor_to", "normfactor_to", False) - ]) - else: - required_results.extend([("v_mean_m_per_s", "v_mps", False)]) - - extract_branch_results_without_internals(net, branch_results, required_results, - cls.table_name(), mode) + extract_branch_results_without_internals(net, branch_results, required_results_hyd, + required_results_ht, cls.table_name(), mode) @classmethod def get_result_table(cls, net): diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index a4e199366..51a71952b 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -241,7 +241,7 @@ def init_options(net, local_parameters): automatically with respect to the convergence behaviour. - **mode** (str): "hydraulics" - Define the calculation mode: what shall be calculated - \ - solely hydraulics ('hydraulic'), solely heat transfer('heat') or both combined \ + solely hydraulics ('hydraulics'), solely heat transfer('heat') or both combined \ ('all'). - **only_update_hydraulic_matrix** (bool): False - If True, the system matrix is not \ diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 619230e02..9420c1fff 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -142,8 +142,11 @@ def get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_a return v_gas_from, v_gas_to, v_gas_mean, normfactor_from, normfactor_to, normfactor_mean -def extract_branch_results_with_internals(net, branch_results, table_name, res_nodes_from, - res_nodes_to, res_mean, node_name, mode): +def extract_branch_results_with_internals(net, branch_results, table_name, + res_nodes_from_hydraulics, res_nodes_from_heat, + res_nodes_to_hydraulics, res_nodes_to_heat, + res_mean_hydraulics, res_mean_heat, node_name, + simulation_mode): # the result table to write results to res_table = net["res_" + table_name] @@ -156,78 +159,98 @@ def extract_branch_results_with_internals(net, branch_results, table_name, res_n # respective table), the placement of the indices mus be known to allocate the values correctly placement_table = np.argsort(net[table_name].index.values) idx_pit = branch_pit[f:t, ELEMENT_IDX] - comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] - comp_connected_ht = comp_connected_hyd - if consider_heat(mode): - comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] node_pit = net["_pit"]["node"] # the id of the external node table inside the node_pit (mostly this is "junction": 0) ext_node_tbl_idx = get_table_number(get_lookup(net, "node", "table"), node_name) - for (res_ext, node_name) in ((res_nodes_from, "from_nodes"), (res_nodes_to, "to_nodes")): - if len(res_ext) > 0: + for (result_mode, res_nodes_from, res_nodes_to, res_mean) in [ + ("hydraulics", res_nodes_from_hydraulics, res_nodes_to_hydraulics, res_mean_hydraulics), + ("heat", res_nodes_from_heat, res_nodes_to_heat, res_mean_heat) + ]: + if simulation_mode == "heat" and result_mode == "hydraulics": + continue + lookup_name = "hydraulics" + if result_mode == "heat" and simulation_mode in ["heat", "all"]: + lookup_name = "heat_transfer" + comp_connected = get_lookup(net, "branch", "active_" + lookup_name)[f:t] + for (res_ext, node_name) in ((res_nodes_from, "from_nodes"), (res_nodes_to, "to_nodes")): + if len(res_ext) == 0: + continue # results that relate to the from_node --> in case of many internal nodes, only the # single from_node that is the exterior node (e.g. junction vs. internal pipe_node) # result has to be extracted from the node_pit end_nodes = branch_results[node_name][f:t] end_nodes_external = node_pit[end_nodes, TABLE_IDX_NODE] == ext_node_tbl_idx - considered_hyd = end_nodes_external & comp_connected_hyd - external_active_hyd = comp_connected_hyd[end_nodes_external] - considered_ht, external_active_ht = None, None - also_heat = consider_heat(mode, res_ext) - if also_heat: - considered_ht = end_nodes_external & comp_connected_ht - external_active_ht = comp_connected_ht[end_nodes_external] - for res_name, entry, use_ht_con in res_ext: - if also_heat and use_ht_con: - res_table[res_name].values[external_active_ht] = \ - branch_results[entry][f:t][considered_ht] - else: - res_table[res_name].values[external_active_hyd] = \ - branch_results[entry][f:t][considered_hyd] - - if len(res_mean) > 0: - # results that relate to the whole branch and shall be averaged (by summing up all values - # and dividing by number of internal sections) - use_numba = get_net_option(net, "use_numba") - res = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), - comp_connected_hyd.astype(np.int32), comp_connected_ht.astype(np.int32), - *[branch_results[rn[1]][f:t] for rn in res_mean]) - connected_ind_hyd = res[2] > 0.99 - num_internals_hyd = res[1][connected_ind_hyd] - connected_ind_ht = res[3] > 0.99 - num_internals_ht = res[1][connected_ind_ht] - - # hint: idx_pit[placement_table] should result in the indices as ordered in the table - placement_table_hyd = placement_table[connected_ind_hyd] - placement_table_ht = placement_table[connected_ind_ht] - - also_heat = consider_heat(mode, res_mean) - for i, (res_name, entry, use_ht_con) in enumerate(res_mean): - connected_ind = connected_ind_ht if also_heat and use_ht_con else connected_ind_hyd - num_internals = num_internals_ht if also_heat and use_ht_con else num_internals_hyd - pt = placement_table_ht if also_heat and use_ht_con else placement_table_hyd - res_table[res_name].values[pt] = res[i + 4][connected_ind] / num_internals - - -def extract_branch_results_without_internals(net, branch_results, required_results, table_name, - mode): + considered = end_nodes_external & comp_connected + external_active = comp_connected[end_nodes_external] + for res_name, entry in res_ext: + res_table[res_name].values[external_active] = branch_results[entry][f:t][considered] + if len(res_mean) > 0: + # results that relate to the whole branch and shall be averaged (by summing up all + # values and dividing by number of internal sections) + use_numba = get_net_option(net, "use_numba") + res = _sum_by_group(use_numba, idx_pit, np.ones_like(idx_pit), + comp_connected.astype(np.int32), + *[branch_results[rn[1]][f:t] for rn in res_mean]) + connected_ind = res[2] > 0.99 + num_internals = res[1][connected_ind] + + # hint: idx_pit[placement_table] should result in the indices as ordered in the table + pt = placement_table[connected_ind] + + for i, (res_name, entry) in enumerate(res_mean_hydraulics): + res_table[res_name].values[pt] = res[i + 3][connected_ind] / num_internals + + +def extract_branch_results_without_internals(net, branch_results, required_results_hydraulic, + required_results_heat, table_name, simulation_mode): + """ + Extract the results from the branch result array derived from the pit to the result table of the + net (only for branch components without internal nodes). Here, we need to consider which results + exist for hydraulic calculation and for heat transfer calculation (wrt. connectivity). + + :param net: The pandapipes net that the internal structure belongs to + :type net: pandapipesNet + :param branch_results: Important branch results from the internal pit structure + :type branch_results: dict[np.ndarray] + :param required_results_hydraulic: The entries that should be extracted for the respective \ + component for hydraulic calculation + :type required_results_hydraulic: list[tuple] + :param required_results_heat: The entries that should be extracted for the respective \ + component for heat transfer calculation + :type required_results_heat: list[tuple] + :param table_name: The name of the table that the results should be written to + :type table_name: str + :param simulation_mode: simulation mode (e.g. "hydraulics", "heat", "all"); defines whether results from \ + hydraulic or temperature calculation are transferred + :type simulation_mode: str + :return: No output + :rtype: None + """ res_table = net["res_" + table_name] f, t = get_lookup(net, "branch", "from_to")[table_name] - comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] - comp_connected_ht = None - if mode in ["heat", "all"]: - comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] - for res_name, entry, use_ht_con in required_results: - if mode in ["heat", "all"] and use_ht_con: - res_table[res_name].values[:][comp_connected_ht] = \ - branch_results[entry][f:t][comp_connected_ht] - else: + # extract hydraulic results + if simulation_mode in ["hydraulics", "all"]: + # lookup for connected branch elements (hydraulic results) + comp_connected_hyd = get_lookup(net, "branch", "active_hydraulics")[f:t] + for res_name, entry in required_results_hydraulic: res_table[res_name].values[:][comp_connected_hyd] = \ branch_results[entry][f:t][comp_connected_hyd] + if simulation_mode == "hydraulics": + for res_name, entry in required_results_heat: + res_table[res_name].values[:][comp_connected_hyd] = \ + branch_results[entry][f:t][comp_connected_hyd] + + # extract heat transfer results + if simulation_mode in ["heat", "all"]: + # lookup for connected branch elements (heat transfer results) + comp_connected_ht = get_lookup(net, "branch", "active_heat_transfer")[f:t] + for res_name, entry in required_results_heat: + res_table[res_name].values[:][comp_connected_ht] = \ + branch_results[entry][f:t][comp_connected_ht] def extract_results_active_pit(net, mode="hydraulics"): From 926bc324376b6aed09d845d117dae60925331f0a Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Fri, 1 Sep 2023 10:05:11 +0200 Subject: [PATCH 042/126] slight correction --- pandapipes/pf/result_extraction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 9420c1fff..1782a9f4c 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -169,7 +169,7 @@ def extract_branch_results_with_internals(net, branch_results, table_name, ("hydraulics", res_nodes_from_hydraulics, res_nodes_to_hydraulics, res_mean_hydraulics), ("heat", res_nodes_from_heat, res_nodes_to_heat, res_mean_heat) ]: - if simulation_mode == "heat" and result_mode == "hydraulics": + if result_mode == "hydraulics" and simulation_mode == "heat": continue lookup_name = "hydraulics" if result_mode == "heat" and simulation_mode in ["heat", "all"]: From 523015b3f4458913d63b2eed1bb3e117fcc84fea Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Wed, 6 Sep 2023 09:28:46 +0200 Subject: [PATCH 043/126] internal component arrays - added "components" dict of arrays to pit - every component can create its own internal array if needed (create_component_array in base_component.py) - moved PRESSURE_RATIO and STD_TYPE from branch_idx.py to internal arrays of pumps and compressors, as they are only needed right there --- CHANGELOG.rst | 1 + .../abstract_models/base_component.py | 15 +++++ .../component_models/component_toolbox.py | 22 ++++++- .../component_models/compressor_component.py | 38 +++++++++--- .../flow_control_component.py | 51 +++++++++++----- pandapipes/component_models/pump_component.py | 59 ++++++++++++++----- pandapipes/idx_branch.py | 10 ++-- pandapipes/pf/pipeflow_setup.py | 4 +- 8 files changed, 153 insertions(+), 47 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 20a3f60fb..fa3f0f197 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,6 +8,7 @@ Change Log - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables +- [CHANGED] components can have their own internal arrays for specific calculations (e.g. for compressor pressure ratio), so that the pit does not need to include such component specific entries - [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added - [REMOVED] broken travis badge removed from readme diff --git a/pandapipes/component_models/abstract_models/base_component.py b/pandapipes/component_models/abstract_models/base_component.py index b5ce3a601..fa5c0fd64 100644 --- a/pandapipes/component_models/abstract_models/base_component.py +++ b/pandapipes/component_models/abstract_models/base_component.py @@ -125,6 +125,21 @@ def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, curre """ return current_start, current_table + @classmethod + def create_component_array(cls, net, component_pits): + """ + Function which creates an internal array of the component in analogy to the pit, but with + component specific entries, that are not needed in the pit. + + :param net: The pandapipes network + :type net: pandapipesNet + :param component_pits: dictionary of component specific arrays + :type component_pits: dict + :return: + :rtype: + """ + pass + @classmethod def create_pit_node_entries(cls, net, node_pit): """ diff --git a/pandapipes/component_models/component_toolbox.py b/pandapipes/component_models/component_toolbox.py index 2db03d127..a1cc75975 100644 --- a/pandapipes/component_models/component_toolbox.py +++ b/pandapipes/component_models/component_toolbox.py @@ -197,4 +197,24 @@ def standard_branch_wo_internals_result_lookup(net): else: required_results_hyd.extend([("v_mean_m_per_s", "v_mps")]) - return required_results_hyd, required_results_ht \ No newline at end of file + return required_results_hyd, required_results_ht + + +def get_component_array(net, component_name, internal=True): + """ + Returns the internal array of a component. + + :param net: The pandapipes network + :type net: pandapipesNet + :param component_name: Table name of the component for which to extract internal array + :type component_name: str + :param internal: If True, only return entries of active elements (included in _active_pit) + :type internal: bool + :return: component_array - internal array of the component + :rtype: numpy.ndarray + """ + f_all, t_all = get_lookup(net, "branch", "from_to")[component_name] + if not internal: + return net["_pit"]["components"][component_name] + in_service_elm = get_lookup(net, "branch", "active_hydraulics")[f_all:t_all] + return net["_pit"]["components"][component_name][in_service_elm] diff --git a/pandapipes/component_models/compressor_component.py b/pandapipes/component_models/compressor_component.py index 7c09300ae..d9d5e8113 100644 --- a/pandapipes/component_models/compressor_component.py +++ b/pandapipes/component_models/compressor_component.py @@ -5,10 +5,10 @@ import numpy as np from numpy import dtype +from pandapipes.component_models.component_toolbox import get_component_array from pandapipes.component_models.junction_component import Junction from pandapipes.component_models.pump_component import Pump -from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, PL,\ - PRESSURE_RATIO +from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, PL from pandapipes.idx_node import PINIT, PAMB @@ -16,6 +16,9 @@ class Compressor(Pump): """ """ + PRESSURE_RATIO = 0 + + internal_cols = 1 @classmethod def table_name(cls): @@ -41,23 +44,42 @@ def create_pit_branch_entries(cls, net, branch_pit): compressor_pit[:, D] = 0.1 compressor_pit[:, AREA] = compressor_pit[:, D] ** 2 * np.pi / 4 compressor_pit[:, LC] = 0 - compressor_pit[:, PRESSURE_RATIO] = net[cls.table_name()].pressure_ratio.values + + @classmethod + def create_component_array(cls, net, component_pits): + """ + Function which creates an internal array of the component in analogy to the pit, but with + component specific entries, that are not needed in the pit. + + :param net: The pandapipes network + :type net: pandapipesNet + :param component_pits: dictionary of component specific arrays + :type component_pits: dict + :return: + :rtype: + """ + tbl = net[cls.table_name()] + compr_array = np.zeros(shape=(len(tbl), cls.internal_cols), dtype=np.float64) + compr_array[:, cls.PRESSURE_RATIO] = net[cls.table_name()].pressure_ratio.values + component_pits[cls.table_name()] = compr_array @classmethod def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): # calculation of pressure lift f, t = idx_lookups[cls.table_name()] - compressor_pit = branch_pit[f:t, :] + compressor_branch_pit = branch_pit[f:t, :] + compressor_array = get_component_array(net, cls.table_name()) - from_nodes = compressor_pit[:, FROM_NODE].astype(np.int32) + from_nodes = compressor_branch_pit[:, FROM_NODE].astype(np.int32) p_from = node_pit[from_nodes, PAMB] + node_pit[from_nodes, PINIT] - p_to_calc = p_from * compressor_pit[:, PRESSURE_RATIO] + + p_to_calc = p_from * compressor_array[:, cls.PRESSURE_RATIO] pl_abs = p_to_calc - p_from - v_mps = compressor_pit[:, VINIT] + v_mps = compressor_branch_pit[:, VINIT] pl_abs[v_mps < 0] = 0 # force pressure lift = 0 for reverse flow - compressor_pit[:, PL] = pl_abs + compressor_branch_pit[:, PL] = pl_abs @classmethod def get_component_input(cls): diff --git a/pandapipes/component_models/flow_control_component.py b/pandapipes/component_models/flow_control_component.py index 739e5ada2..0627a8ab0 100644 --- a/pandapipes/component_models/flow_control_component.py +++ b/pandapipes/component_models/flow_control_component.py @@ -6,10 +6,11 @@ from numpy import dtype from pandapipes.component_models.abstract_models import BranchWZeroLengthComponent, get_fluid -from pandapipes.component_models.component_toolbox import standard_branch_wo_internals_result_lookup +from pandapipes.component_models.component_toolbox import \ + standard_branch_wo_internals_result_lookup, get_component_array from pandapipes.component_models.junction_component import Junction from pandapipes.idx_branch import D, AREA, TL, JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, VINIT, \ - RHO, LOAD_VEC_BRANCHES, ELEMENT_IDX + RHO, LOAD_VEC_BRANCHES from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -17,6 +18,9 @@ class FlowControlComponent(BranchWZeroLengthComponent): """ """ + CONTROL_ACTIVE = 0 + + internal_cols = 1 @classmethod def table_name(cls): @@ -44,11 +48,29 @@ def create_pit_branch_entries(cls, net, branch_pit): :type branch_pit: :return: No Output. """ - fc_pit = super().create_pit_branch_entries(net, branch_pit) - fc_pit[:, D] = net[cls.table_name()].diameter_m.values - fc_pit[:, AREA] = fc_pit[:, D] ** 2 * np.pi / 4 - fc_pit[:, VINIT] = net[cls.table_name()].controlled_mdot_kg_per_s.values / \ - (fc_pit[:, AREA] * fc_pit[:, RHO]) + fc_branch_pit = super().create_pit_branch_entries(net, branch_pit) + fc_branch_pit[:, D] = net[cls.table_name()].diameter_m.values + fc_branch_pit[:, AREA] = fc_branch_pit[:, D] ** 2 * np.pi / 4 + fc_branch_pit[:, VINIT] = net[cls.table_name()].controlled_mdot_kg_per_s.values / \ + (fc_branch_pit[:, AREA] * fc_branch_pit[:, RHO]) + + @classmethod + def create_component_array(cls, net, component_pits): + """ + Function which creates an internal array of the component in analogy to the pit, but with + component specific entries, that are not needed in the pit. + + :param net: The pandapipes network + :type net: pandapipesNet + :param component_pits: dictionary of component specific arrays + :type component_pits: dict + :return: + :rtype: + """ + tbl = net[cls.table_name()] + fc_pit = np.zeros(shape=(len(tbl), cls.internal_cols), dtype=np.float64) + fc_pit[:, cls.CONTROL_ACTIVE] = tbl.control_active.values + component_pits[cls.table_name()] = fc_pit @classmethod def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): @@ -59,14 +81,13 @@ def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_loo # set all pressure derivatives to 0 and velocity to 1; load vector must be 0, as no change # of velocity is allowed during the pipeflow iteration f, t = idx_lookups[cls.table_name()] - fc_pit = branch_pit[f:t, :] - in_service_elm = np.isin(net[cls.table_name()].index.values, - fc_pit[:, ELEMENT_IDX].astype(np.int32)) - active = net[cls.table_name()].control_active.values[in_service_elm] - fc_pit[active, JAC_DERIV_DP] = 0 - fc_pit[active, JAC_DERIV_DP1] = 0 - fc_pit[active, JAC_DERIV_DV] = 1 - fc_pit[active, LOAD_VEC_BRANCHES] = 0 + fc_branch_pit = branch_pit[f:t, :] + fc_array = get_component_array(net, cls.table_name()) + active = fc_array[:, cls.CONTROL_ACTIVE].astype(np.bool_) + fc_branch_pit[active, JAC_DERIV_DP] = 0 + fc_branch_pit[active, JAC_DERIV_DP1] = 0 + fc_branch_pit[active, JAC_DERIV_DV] = 1 + fc_branch_pit[active, LOAD_VEC_BRANCHES] = 0 @classmethod def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index 3de660002..d7a75822f 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -7,12 +7,12 @@ import numpy as np from numpy import dtype -from pandapipes.component_models.junction_component import Junction from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent +from pandapipes.component_models.component_toolbox import get_component_array +from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE, R_UNIVERSAL, P_CONVERSION -from pandapipes.idx_branch import STD_TYPE, VINIT, D, AREA, TL, LOSS_COEFFICIENT as LC, FROM_NODE, \ - TINIT, PL +from pandapipes.idx_branch import VINIT, D, AREA, TL, LOSS_COEFFICIENT as LC, FROM_NODE, TINIT, PL from pandapipes.idx_node import PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import get_fluid, get_net_option, get_lookup from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -29,6 +29,9 @@ class Pump(BranchWZeroLengthComponent): """ """ + STD_TYPE = 0 + + internal_cols = 1 @classmethod def from_to_node_cols(cls): @@ -58,29 +61,49 @@ def create_pit_branch_entries(cls, net, branch_pit): :return: No Output. """ pump_pit = super().create_pit_branch_entries(net, branch_pit) - std_types_lookup = np.array(list(net.std_types[cls.table_name()].keys())) - std_type, pos = np.where(net[cls.table_name()]['std_type'].values - == std_types_lookup[:, np.newaxis]) - pump_pit[pos, STD_TYPE] = std_type pump_pit[:, D] = 0.1 pump_pit[:, AREA] = pump_pit[:, D] ** 2 * np.pi / 4 pump_pit[:, LC] = 0 + @classmethod + def create_component_array(cls, net, component_pits): + """ + Function which creates an internal array of the component in analogy to the pit, but with + component specific entries, that are not needed in the pit. + + :param net: The pandapipes network + :type net: pandapipesNet + :param component_pits: dictionary of component specific arrays + :type component_pits: dict + :return: + :rtype: + """ + tbl = net[cls.table_name()] + pump_array = np.zeros(shape=(len(tbl), cls.internal_cols), dtype=np.float64) + std_types_lookup = get_std_type_lookup(net, cls.table_name()) + std_type, pos = np.where(net[cls.table_name()]['std_type'].values + == std_types_lookup[:, np.newaxis]) + pump_array[pos, cls.STD_TYPE] = std_type + component_pits[cls.table_name()] = pump_array + @classmethod def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): # calculation of pressure lift f, t = idx_lookups[cls.table_name()] - pump_pit = branch_pit[f:t, :] - area = pump_pit[:, AREA] - idx = pump_pit[:, STD_TYPE].astype(int) - std_types = np.array(list(net.std_types['pump'].keys()))[idx] - from_nodes = pump_pit[:, FROM_NODE].astype(np.int32) - # to_nodes = pump_pit[:, TO_NODE].astype(np.int32) + pump_branch_pit = branch_pit[f:t, :] + area = pump_branch_pit[:, AREA] + + pump_array = get_component_array(net, cls.table_name()) + idx = pump_array[:, cls.STD_TYPE].astype(np.int32) + std_types = get_std_type_lookup(net, cls.table_name())[idx] + + from_nodes = pump_branch_pit[:, FROM_NODE].astype(np.int32) + # to_nodes = pump_branch_pit[:, TO_NODE].astype(np.int32) fluid = get_fluid(net) p_from = node_pit[from_nodes, PAMB] + node_pit[from_nodes, PINIT] # p_to = node_pit[to_nodes, PAMB] + node_pit[to_nodes, PINIT] - numerator = NORMAL_PRESSURE * pump_pit[:, TINIT] - v_mps = pump_pit[:, VINIT] + numerator = NORMAL_PRESSURE * pump_branch_pit[:, TINIT] + v_mps = pump_branch_pit[:, VINIT] if fluid.is_gas: # consider volume flow at inlet normfactor_from = numerator * fluid.get_property("compressibility", p_from) \ @@ -93,7 +116,7 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo 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 + pump_branch_pit[:, PL] = pl @classmethod def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): @@ -220,3 +243,7 @@ def get_result_table(cls, net): output += ["compr_power_mw"] return output, True + + +def get_std_type_lookup(net, table_name): + return np.array(list(net.std_types[table_name].keys())) diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index 2b59f2360..0f40fbd61 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -41,10 +41,8 @@ TO_NODE_T = 32 QEXT = 33 # heat input in [W] TEXT = 34 -STD_TYPE = 35 -PL = 36 -TL = 37 # Temperature lift [K] -BRANCH_TYPE = 38 # branch type relevant for the pressure controller -PRESSURE_RATIO = 39 # boost ratio for compressors with proportional pressure lift +PL = 35 +TL = 36 # Temperature lift [K] +BRANCH_TYPE = 37 # branch type relevant for the pressure controller -branch_cols = 40 +branch_cols = 38 diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 51a71952b..713f05be8 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -352,6 +352,7 @@ def initialize_pit(net): for comp in net['component_list']: comp.create_pit_node_entries(net, pit["node"]) comp.create_pit_branch_entries(net, pit["branch"]) + comp.create_component_array(net, pit["components"]) return pit["node"], pit["branch"] @@ -375,7 +376,8 @@ def create_empty_pit(net): branch_length = get_lookup(net, "branch", "length") # init empty pit pit = {"node": np.empty((node_length, node_cols), dtype=np.float64), - "branch": np.empty((branch_length, branch_cols), dtype=np.float64)} + "branch": np.empty((branch_length, branch_cols), dtype=np.float64), + "components": {}} net["_pit"] = pit return pit From e983e90a7815c506d70eeff8a4d495443ccdb0ac Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Fri, 8 Sep 2023 11:48:25 +0200 Subject: [PATCH 044/126] slight adjustment of helper function get_component_array - rename internal to only_active - made component_type interchangeable ("brach" / "node") --- pandapipes/component_models/component_toolbox.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pandapipes/component_models/component_toolbox.py b/pandapipes/component_models/component_toolbox.py index a1cc75975..305261437 100644 --- a/pandapipes/component_models/component_toolbox.py +++ b/pandapipes/component_models/component_toolbox.py @@ -200,7 +200,7 @@ def standard_branch_wo_internals_result_lookup(net): return required_results_hyd, required_results_ht -def get_component_array(net, component_name, internal=True): +def get_component_array(net, component_name, component_type="branch", only_active=True): """ Returns the internal array of a component. @@ -208,13 +208,15 @@ def get_component_array(net, component_name, internal=True): :type net: pandapipesNet :param component_name: Table name of the component for which to extract internal array :type component_name: str - :param internal: If True, only return entries of active elements (included in _active_pit) - :type internal: bool + :param component_type: Type of component that is considered ("branch" or "node") + :type component_type: str, default "branch" + :param only_active: If True, only return entries of active elements (included in _active_pit) + :type only_active: bool :return: component_array - internal array of the component :rtype: numpy.ndarray """ - f_all, t_all = get_lookup(net, "branch", "from_to")[component_name] - if not internal: + f_all, t_all = get_lookup(net, component_type, "from_to")[component_name] + if not only_active: return net["_pit"]["components"][component_name] - in_service_elm = get_lookup(net, "branch", "active_hydraulics")[f_all:t_all] + in_service_elm = get_lookup(net, component_type, "active_hydraulics")[f_all:t_all] return net["_pit"]["components"][component_name][in_service_elm] From ebd60a3e7cd2096ad2dbc43678187591c4fc261f Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 8 Sep 2023 13:45:59 +0200 Subject: [PATCH 045/126] - define calculate_thermal_derivative more gobally - rename TINIT in TINIT_IN and T_OUT in TINIT_OUT in Branch --- .../abstract_models/base_component.py | 46 +++---------- .../abstract_models/branch_models.py | 69 +------------------ .../branch_w_internals_models.py | 10 +-- .../branch_wo_internals_models.py | 10 +-- .../abstract_models/circulation_pump.py | 4 -- .../circulation_pump_mass_component.py | 3 - .../circulation_pump_pressure_component.py | 4 -- .../flow_control_component.py | 20 +----- .../heat_exchanger_component.py | 17 +---- pandapipes/component_models/pipe_component.py | 27 ++------ .../pressure_control_component.py | 17 +---- pandapipes/component_models/pump_component.py | 21 +----- .../component_models/valve_component.py | 17 +---- pandapipes/idx_branch.py | 4 +- pandapipes/pf/derivative_calculation.py | 43 ++++++++++-- pandapipes/pf/derivative_toolbox.py | 6 +- pandapipes/pf/derivative_toolbox_numba.py | 6 +- pandapipes/pf/result_extraction.py | 10 +-- pandapipes/pipeflow.py | 19 +++-- .../pipeflow_openmodelica_comparison.py | 2 +- .../test_pipeflow_analytic_comparison.py | 4 +- tutorials/temperature_calculation.ipynb | 2 +- 22 files changed, 98 insertions(+), 263 deletions(-) diff --git a/pandapipes/component_models/abstract_models/base_component.py b/pandapipes/component_models/abstract_models/base_component.py index b5ce3a601..350755c37 100644 --- a/pandapipes/component_models/abstract_models/base_component.py +++ b/pandapipes/component_models/abstract_models/base_component.py @@ -78,6 +78,15 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): pass + @classmethod + def adaption_before_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): + pass + + @classmethod + def adaption_after_derivatives_thermal(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): @@ -151,40 +160,3 @@ def create_pit_branch_entries(cls, net, branch_pit): """ pass - @classmethod - def calculate_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): - """ - Function which creates derivatives. - - :param net: The pandapipes network - :type net: pandapipesNet - :param branch_pit: - :type branch_pit: - :param node_pit: - :type node_pit: - :param idx_lookups: - :type idx_lookups: - :param options: - :type options: - :return: No Output. - """ - pass - - @classmethod - def calculate_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): - """ - Function which creates derivatives. - - :param net: The pandapipes network - :type net: pandapipesNet - :param branch_pit: - :type branch_pit: - :param node_pit: - :type node_pit: - :param idx_lookups: - :type idx_lookups: - :param options: - :type options: - :return: No Output. - """ - pass diff --git a/pandapipes/component_models/abstract_models/branch_models.py b/pandapipes/component_models/abstract_models/branch_models.py index 4eeac9cc6..f9d98d6e8 100644 --- a/pandapipes/component_models/abstract_models/branch_models.py +++ b/pandapipes/component_models/abstract_models/branch_models.py @@ -5,10 +5,7 @@ import numpy as np from pandapipes.component_models.abstract_models.base_component import Component -from pandapipes.idx_branch import LENGTH, D, AREA, RHO, VINIT, ALPHA, QEXT, TEXT, branch_cols, \ - T_OUT, CP, VINIT_T, FROM_NODE_T, TL, \ - JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE, LOAD_VEC_BRANCHES_T, LOAD_VEC_NODES_T -from pandapipes.idx_node import TINIT as TINIT_NODE +from pandapipes.idx_branch import VINIT, branch_cols from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup try: @@ -94,70 +91,6 @@ def create_pit_branch_entries(cls, net, branch_pit): branch_component_pit[:, VINIT] = 0.1 return branch_component_pit, node_pit, from_nodes, to_nodes - @classmethod - def calculate_derivatives_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): - """ - Function which creates derivatives of the temperature. - - :param net: - :type net: - :param branch_pit: - :type branch_pit: - :param node_pit: - :type node_pit: - :param idx_lookups: - :type idx_lookups: - :param options: - :type options: - :return: No Output. - """ - f, t = idx_lookups[cls.table_name()] - branch_component_pit = branch_pit[f:t, :] - cp = branch_component_pit[:, CP] - rho = branch_component_pit[:, RHO] - v_init = branch_component_pit[:, VINIT_T] - from_nodes = branch_component_pit[:, FROM_NODE_T].astype(np.int32) - t_init_i = node_pit[from_nodes, TINIT_NODE] - t_init_i1 = branch_component_pit[:, T_OUT] - t_amb = branch_component_pit[:, TEXT] - area = branch_component_pit[:, AREA] - length = branch_component_pit[:, LENGTH] - alpha = branch_component_pit[:, ALPHA] * np.pi * branch_component_pit[:, D] - cls.calculate_temperature_lift(net, branch_component_pit, node_pit) - tl = branch_component_pit[:, TL] - qext = branch_component_pit[:, QEXT] - t_m = (t_init_i1 + t_init_i) / 2 - - branch_component_pit[:, LOAD_VEC_BRANCHES_T] = \ - -(rho * area * cp * v_init * (-t_init_i + t_init_i1 - tl) - - alpha * (t_amb - t_m) * length + qext) - - branch_component_pit[:, JAC_DERIV_DT] = - rho * area * cp * v_init + alpha / 2 * length - branch_component_pit[:, JAC_DERIV_DT1] = rho * area * cp * v_init + alpha / 2 * length - - branch_component_pit[:, JAC_DERIV_DT_NODE] = rho * v_init * branch_component_pit[:, AREA] - branch_component_pit[:, LOAD_VEC_NODES_T] = rho * v_init * branch_component_pit[:, AREA] \ - * t_init_i1 - - @classmethod - def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lookups, options): - pass - - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - raise NotImplementedError - @classmethod def extract_results(cls, net, options, branch_results, mode): raise NotImplementedError diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/pandapipes/component_models/abstract_models/branch_w_internals_models.py index 1b88f0eac..fa7a579e4 100644 --- a/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -6,7 +6,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent from pandapipes.component_models.component_toolbox import set_entry_check_repeat -from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, TINIT, RHO, ETA, CP, ELEMENT_IDX +from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, TINIT_IN, RHO, ETA, CP, ELEMENT_IDX from pandapipes.idx_node import L, node_cols, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup, get_lookup, get_table_number from pandapipes.properties.fluids import get_fluid @@ -196,12 +196,12 @@ def create_pit_branch_entries(cls, net, branch_pit): internal_pipe_number, has_internals) branch_w_internals_pit[:, FROM_NODE] = from_nodes branch_w_internals_pit[:, TO_NODE] = to_nodes - branch_w_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] + node_pit[ + branch_w_internals_pit[:, TINIT_IN] = (node_pit[from_nodes, TINIT_NODE] + node_pit[ to_nodes, TINIT_NODE]) / 2 fluid = get_fluid(net) - branch_w_internals_pit[:, RHO] = fluid.get_density(branch_w_internals_pit[:, TINIT]) - branch_w_internals_pit[:, ETA] = fluid.get_viscosity(branch_w_internals_pit[:, TINIT]) - branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(branch_w_internals_pit[:, TINIT]) + branch_w_internals_pit[:, RHO] = fluid.get_density(branch_w_internals_pit[:, TINIT_IN]) + branch_w_internals_pit[:, ETA] = fluid.get_viscosity(branch_w_internals_pit[:, TINIT_IN]) + branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(branch_w_internals_pit[:, TINIT_IN]) return branch_w_internals_pit, internal_pipe_number diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index 106895d50..6872e6df2 100644 --- a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -4,7 +4,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent -from pandapipes.idx_branch import FROM_NODE, TO_NODE, TINIT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE +from pandapipes.idx_branch import FROM_NODE, TO_NODE, TINIT_IN, ELEMENT_IDX, RHO, ETA, CP, ACTIVE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup @@ -82,12 +82,12 @@ def create_pit_branch_entries(cls, net, branch_pit): branch_wo_internals_pit[:, ELEMENT_IDX] = net[cls.table_name()].index.values branch_wo_internals_pit[:, FROM_NODE] = from_nodes branch_wo_internals_pit[:, TO_NODE] = to_nodes - branch_wo_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] + branch_wo_internals_pit[:, TINIT_IN] = (node_pit[from_nodes, TINIT_NODE] + node_pit[to_nodes, TINIT_NODE]) / 2 fluid = get_fluid(net) - branch_wo_internals_pit[:, RHO] = fluid.get_density(branch_wo_internals_pit[:, TINIT]) - branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(branch_wo_internals_pit[:, TINIT]) - branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(branch_wo_internals_pit[:, TINIT]) + branch_wo_internals_pit[:, RHO] = fluid.get_density(branch_wo_internals_pit[:, TINIT_IN]) + branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(branch_wo_internals_pit[:, TINIT_IN]) + branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(branch_wo_internals_pit[:, TINIT_IN]) branch_wo_internals_pit[:, ACTIVE] = net[cls.table_name()][cls.active_identifier()].values return branch_wo_internals_pit diff --git a/pandapipes/component_models/abstract_models/circulation_pump.py b/pandapipes/component_models/abstract_models/circulation_pump.py index 767dc3368..3c3e338de 100644 --- a/pandapipes/component_models/abstract_models/circulation_pump.py +++ b/pandapipes/component_models/abstract_models/circulation_pump.py @@ -92,10 +92,6 @@ def create_pit_branch_entries(cls, net, branch_pit): circ_pump_pit[:, AREA] = circ_pump_pit[:, D] ** 2 * np.pi / 4 circ_pump_pit[:, ACTIVE] = False - @classmethod - def calculate_temperature_lift(cls, net, pipe_pit, node_pit): - raise NotImplementedError - @classmethod def extract_results(cls, net, options, branch_results, mode): """ diff --git a/pandapipes/component_models/circulation_pump_mass_component.py b/pandapipes/component_models/circulation_pump_mass_component.py index d18e299d3..699d1e416 100644 --- a/pandapipes/component_models/circulation_pump_mass_component.py +++ b/pandapipes/component_models/circulation_pump_mass_component.py @@ -72,6 +72,3 @@ def create_pit_node_entries(cls, net, node_pit): index = junction_idx_lookups[juncts] node_pit[index, LOAD] += loads_sum - @classmethod - def calculate_temperature_lift(cls, net, pipe_pit, node_pit): - pass diff --git a/pandapipes/component_models/circulation_pump_pressure_component.py b/pandapipes/component_models/circulation_pump_pressure_component.py index c1ef5abd3..6cfbf2eb9 100644 --- a/pandapipes/component_models/circulation_pump_pressure_component.py +++ b/pandapipes/component_models/circulation_pump_pressure_component.py @@ -63,7 +63,3 @@ def create_pit_node_entries(cls, net, node_pit): p_in = press - circ_pump.plift_bar.values set_fixed_node_entries(net, node_pit, junction, circ_pump.type.values, p_in, None, cls.get_connected_node_type(), "p") - - @classmethod - def calculate_temperature_lift(cls, net, pipe_pit, node_pit): - pass diff --git a/pandapipes/component_models/flow_control_component.py b/pandapipes/component_models/flow_control_component.py index 739e5ada2..33b2d3714 100644 --- a/pandapipes/component_models/flow_control_component.py +++ b/pandapipes/component_models/flow_control_component.py @@ -8,7 +8,7 @@ from pandapipes.component_models.abstract_models import BranchWZeroLengthComponent, get_fluid from pandapipes.component_models.component_toolbox import standard_branch_wo_internals_result_lookup from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import D, AREA, TL, JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, VINIT, \ +from pandapipes.idx_branch import D, AREA, JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, VINIT, \ RHO, LOAD_VEC_BRANCHES, ELEMENT_IDX from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -50,9 +50,6 @@ def create_pit_branch_entries(cls, net, branch_pit): fc_pit[:, VINIT] = net[cls.table_name()].controlled_mdot_kg_per_s.values / \ (fc_pit[:, AREA] * fc_pit[:, RHO]) - @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): @@ -68,21 +65,6 @@ def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_loo fc_pit[active, JAC_DERIV_DV] = 1 fc_pit[active, LOAD_VEC_BRANCHES] = 0 - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 - @classmethod def extract_results(cls, net, options, branch_results, mode): required_results_hyd, required_results_ht = standard_branch_wo_internals_result_lookup(net) diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index 6304bb4dd..5bc6dae3c 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -9,7 +9,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import TL, ALPHA, TEXT, QEXT, T_OUT, D, AREA, LOSS_COEFFICIENT as LC +from pandapipes.idx_branch import TL, ALPHA, TEXT, QEXT, TINIT_OUT, D, AREA, LOSS_COEFFICIENT as LC from pandapipes.pf.pipeflow_setup import get_fluid from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -58,7 +58,6 @@ def create_pit_branch_entries(cls, net, branch_pit): heat_exchanger_pit[:, ALPHA] = 0 heat_exchanger_pit[:, QEXT] = net[cls.table_name()].qext_w.values heat_exchanger_pit[:, TEXT] = 293.15 - heat_exchanger_pit[:, T_OUT] = 307 @classmethod def extract_results(cls, net, options, branch_results, mode): @@ -81,20 +80,6 @@ def extract_results(cls, net, options, branch_results, mode): extract_branch_results_without_internals(net, branch_results, required_results_hyd, required_results_ht, cls.table_name(), mode) - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 @classmethod def get_component_input(cls): diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index af399f15c..600f06726 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -11,7 +11,7 @@ from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE from pandapipes.idx_branch import FROM_NODE, TO_NODE, LENGTH, D, AREA, K, \ - VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, T_OUT, TL + VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, TINIT_OUT from pandapipes.idx_node import PINIT, HEIGHT, TINIT as TINIT_NODE, \ RHO as RHO_NODES, PAMB, ACTIVE as ACTIVE_ND from pandapipes.pf.pipeflow_setup import get_fluid, get_lookup @@ -153,24 +153,9 @@ def create_pit_branch_entries(cls, net, branch_pit): node_pit = net["_pit"]["node"] to_nodes = pipe_pit[:, TO_NODE].astype(np.int32) - pipe_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] + pipe_pit[:, TINIT_OUT] = node_pit[to_nodes, TINIT_NODE] pipe_pit[:, AREA] = pipe_pit[:, D] ** 2 * np.pi / 4 - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 - @classmethod def extract_results(cls, net, options, branch_results, mode): res_nodes_from_hyd = [("p_from_bar", "p_from"), ("mdot_from_kg_per_s", "mf_from")] @@ -221,7 +206,7 @@ def get_internal_results(cls, net, pipe): v_pipe_idx = np.repeat(pipe, internal_sections[pipe]) pipe_results = dict() pipe_results["PINIT"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) - pipe_results["TINIT"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) + pipe_results["TINIT_IN"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) pipe_results["VINIT_FROM"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) pipe_results["VINIT_TO"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) pipe_results["VINIT_MEAN"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) @@ -287,8 +272,8 @@ def get_internal_results(cls, net, pipe): pipe_results["PINIT"][:, 0] = p_node_idx pipe_results["PINIT"][:, 1] = p_node_data - pipe_results["TINIT"][:, 0] = p_node_idx - pipe_results["TINIT"][:, 1] = t_node_data + pipe_results["TINIT_IN"][:, 0] = p_node_idx + pipe_results["TINIT_IN"][:, 1] = t_node_data else: logger.warning("For at least one pipe no internal data is available.") @@ -362,7 +347,7 @@ def plot_pipe(cls, net, pipe, pipe_results): pipe_p_data_idx = np.where(pipe_results["PINIT"][:, 0] == pipe) pipe_v_data_idx = np.where(pipe_results["VINIT_MEAN"][:, 0] == pipe) pipe_p_data = pipe_results["PINIT"][pipe_p_data_idx, 1] - pipe_t_data = pipe_results["TINIT"][pipe_p_data_idx, 1] + pipe_t_data = pipe_results["TINIT_IN"][pipe_p_data_idx, 1] pipe_v_data = pipe_results["VINIT_MEAN"][pipe_v_data_idx, 1] node_pit = net["_pit"]["node"] diff --git a/pandapipes/component_models/pressure_control_component.py b/pandapipes/component_models/pressure_control_component.py index 89d2f220f..e582925bb 100644 --- a/pandapipes/component_models/pressure_control_component.py +++ b/pandapipes/component_models/pressure_control_component.py @@ -8,7 +8,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import D, AREA, TL, \ +from pandapipes.idx_branch import D, AREA, \ JAC_DERIV_DP, JAC_DERIV_DP1, JAC_DERIV_DV, BRANCH_TYPE, LOSS_COEFFICIENT as LC from pandapipes.idx_node import PINIT, NODE_TYPE, PC from pandapipes.pf.pipeflow_setup import get_lookup @@ -79,21 +79,6 @@ def adaption_after_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_loo press_pit[pc_branch, JAC_DERIV_DP1] = 0 press_pit[pc_branch, JAC_DERIV_DV] = 0 - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 - @classmethod def extract_results(cls, net, options, branch_results, mode): """ diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index 3de660002..5a3b23606 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -11,8 +11,8 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE, R_UNIVERSAL, P_CONVERSION -from pandapipes.idx_branch import STD_TYPE, VINIT, D, AREA, TL, LOSS_COEFFICIENT as LC, FROM_NODE, \ - TINIT, PL +from pandapipes.idx_branch import STD_TYPE, VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, \ + TINIT_IN, PL from pandapipes.idx_node import PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import get_fluid, get_net_option, get_lookup from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -79,7 +79,7 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo fluid = get_fluid(net) p_from = node_pit[from_nodes, PAMB] + node_pit[from_nodes, PINIT] # p_to = node_pit[to_nodes, PAMB] + node_pit[to_nodes, PINIT] - numerator = NORMAL_PRESSURE * pump_pit[:, TINIT] + numerator = NORMAL_PRESSURE * pump_pit[:, TINIT_IN] v_mps = pump_pit[:, VINIT] if fluid.is_gas: # consider volume flow at inlet @@ -95,21 +95,6 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo 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): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 - @classmethod def extract_results(cls, net, options, branch_results, mode): """ diff --git a/pandapipes/component_models/valve_component.py b/pandapipes/component_models/valve_component.py index 6c32676c0..ff2b9451e 100644 --- a/pandapipes/component_models/valve_component.py +++ b/pandapipes/component_models/valve_component.py @@ -9,7 +9,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import D, AREA, LOSS_COEFFICIENT as LC, TL +from pandapipes.idx_branch import D, AREA, LOSS_COEFFICIENT as LC from pandapipes.pf.result_extraction import extract_branch_results_without_internals from pandapipes.properties.fluids import get_fluid @@ -52,21 +52,6 @@ def create_pit_branch_entries(cls, net, branch_pit): valve_pit[:, AREA] = valve_pit[:, D] ** 2 * np.pi / 4 valve_pit[:, LC] = net[cls.table_name()].loss_coefficient.values - @classmethod - def calculate_temperature_lift(cls, net, branch_component_pit, node_pit): - """ - - :param net: - :type net: - :param branch_component_pit: - :type branch_component_pit: - :param node_pit: - :type node_pit: - :return: - :rtype: - """ - branch_component_pit[:, TL] = 0 - @classmethod def get_component_input(cls): """ diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index 2b59f2360..0db7397e0 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -17,7 +17,7 @@ RHO = 8 # Density in [kg/m^3 ETA = 9 # Dynamic viscosity in [Pas] K = 10 # Pipe roughness in [m] -TINIT = 11 # Temperature in [K] +TINIT_IN = 11 # Temperature in [K] VINIT = 12 # velocity in [m/s] RE = 13 # Reynolds number LAMBDA = 14 # Lambda @@ -33,7 +33,7 @@ JAC_DERIV_DT = 24 JAC_DERIV_DT1 = 25 LOAD_VEC_BRANCHES_T = 26 -T_OUT = 27 # Internal slot for outlet pipe temperature +TINIT_OUT = 27 # Internal slot for outlet pipe temperature JAC_DERIV_DT_NODE = 28 # Slot for the derivative fpr T for the nodes connected to branch LOAD_VEC_NODES_T = 29 VINIT_T = 30 diff --git a/pandapipes/pf/derivative_calculation.py b/pandapipes/pf/derivative_calculation.py index 800834370..95f051771 100644 --- a/pandapipes/pf/derivative_calculation.py +++ b/pandapipes/pf/derivative_calculation.py @@ -1,8 +1,10 @@ import numpy as np -from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT, LOAD_VEC_BRANCHES, \ +from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT_IN, LOAD_VEC_BRANCHES, \ JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \ - FROM_NODE, TO_NODE + FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, TINIT_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ + LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE +from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.properties.fluids import get_fluid @@ -35,7 +37,7 @@ def calculate_derivatives_hydraulic(net, branch_pit, node_pit, options): to_nodes = branch_pit[:, TO_NODE].astype(np.int32) tinit_branch, height_difference, p_init_i_abs, p_init_i1_abs = \ get_derived_values(node_pit, from_nodes, to_nodes, options["use_numba"]) - branch_pit[:, TINIT] = tinit_branch + branch_pit[:, TINIT_IN] = tinit_branch if not gas_mode: if options["use_numba"]: @@ -73,6 +75,33 @@ def calculate_derivatives_hydraulic(net, branch_pit, node_pit, options): branch_pit[:, JAC_DERIV_DV_NODE] = df_dv_nodes +def calculate_derivatives_thermal(net, branch_pit, node_pit, options): + cp = branch_pit[:, CP] + rho = branch_pit[:, RHO] + v_init = branch_pit[:, VINIT_T] + from_nodes = branch_pit[:, FROM_NODE_T].astype(np.int32) + t_init_i = node_pit[from_nodes, TINIT_NODE] + t_init_i1 = branch_pit[:, TINIT_OUT] + t_amb = branch_pit[:, TEXT] + area = branch_pit[:, AREA] + length = branch_pit[:, LENGTH] + alpha = branch_pit[:, ALPHA] * np.pi * branch_pit[:, D] + tl = branch_pit[:, TL] + qext = branch_pit[:, QEXT] + t_m = (t_init_i1 + t_init_i) / 2 + + branch_pit[:, LOAD_VEC_BRANCHES_T] = \ + -(rho * area * cp * v_init * (-t_init_i + t_init_i1 - tl) + - alpha * (t_amb - t_m) * length + qext) + + branch_pit[:, JAC_DERIV_DT] = - rho * area * cp * v_init + alpha / 2 * length + branch_pit[:, JAC_DERIV_DT1] = rho * area * cp * v_init + alpha / 2 * length + + branch_pit[:, JAC_DERIV_DT_NODE] = rho * v_init * branch_pit[:, AREA] + branch_pit[:, LOAD_VEC_NODES_T] = rho * v_init * branch_pit[:, AREA] \ + * t_init_i1 + + def get_derived_values(node_pit, from_nodes, to_nodes, use_numba): if use_numba: from pandapipes.pf.derivative_toolbox_numba import calc_derived_values_numba @@ -110,11 +139,11 @@ def calc_lambda(v, eta, rho, d, k, gas_mode, friction_model, lengths, options): """ if options["use_numba"]: from pandapipes.pf.derivative_toolbox_numba import calc_lambda_nikuradse_incomp_numba as \ - calc_lambda_nikuradse_incomp, colebrook_numba as colebrook,\ + calc_lambda_nikuradse_incomp, colebrook_numba as colebrook, \ calc_lambda_nikuradse_comp_numba as calc_lambda_nikuradse_comp else: from pandapipes.pf.derivative_toolbox import calc_lambda_nikuradse_incomp_np as \ - calc_lambda_nikuradse_incomp, colebrook_np as colebrook,\ + calc_lambda_nikuradse_incomp, colebrook_np as colebrook, \ calc_lambda_nikuradse_comp_np as calc_lambda_nikuradse_comp if gas_mode: re, lambda_laminar, lambda_nikuradse = calc_lambda_nikuradse_comp(v, d, k, eta, rho) @@ -134,7 +163,7 @@ def calc_lambda(v, eta, rho, d, k, gas_mode, friction_model, lengths, options): "argument to the pipeflow.") return lambda_colebrook, re elif friction_model == "swamee-jain": - lambda_swamee_jain = 0.25 / ((np.log10(k/(3.7*d) + 5.74/(re**0.9)))**2) + lambda_swamee_jain = 0.25 / ((np.log10(k / (3.7 * d) + 5.74 / (re ** 0.9))) ** 2) return lambda_swamee_jain, re else: # lambda_tot = np.where(re > 2300, lambda_laminar + lambda_nikuradse, lambda_laminar) @@ -182,7 +211,7 @@ def calc_der_lambda(v, eta, rho, d, k, friction_model, lambda_pipe): return lambda_colebrook_der elif friction_model == "swamee-jain": - param = k/(3.7*d) + 5.74 * (np.abs(eta))**0.9 / ((np.abs(rho*v_corr*d))**0.9) + param = k / (3.7 * d) + 5.74 * (np.abs(eta)) ** 0.9 / ((np.abs(rho * v_corr * d)) ** 0.9) # 0.5 / (log(10) * log(param)^3 * param) * 5.166 * abs(eta)^0.9 / (abs(rho * d)^0.9 # * abs(v_corr)^1.9) lambda_swamee_jain_der = 0.5 / np.log(10) / (np.log(param) ** 3) / param * 5.166 \ diff --git a/pandapipes/pf/derivative_toolbox.py b/pandapipes/pf/derivative_toolbox.py index e681c71fa..fd26b06f3 100644 --- a/pandapipes/pf/derivative_toolbox.py +++ b/pandapipes/pf/derivative_toolbox.py @@ -7,7 +7,7 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT_IN, \ VINIT from pandapipes.idx_node import HEIGHT, PINIT, PAMB, TINIT as TINIT_NODE @@ -41,11 +41,11 @@ def derivatives_hydraulic_comp_np(branch_pit, lambda_, der_lambda, p_init_i_abs, p_sum = p_init_i_abs + p_init_i1_abs p_sum_div = np.divide(1, p_sum) - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * branch_pit[:, TINIT], + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * branch_pit[:, TINIT_IN], NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[:, RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference, - 2 * NORMAL_PRESSURE * branch_pit[:, TINIT] * P_CONVERSION) + 2 * NORMAL_PRESSURE * branch_pit[:, TINIT_IN] * P_CONVERSION) friction_term = np.divide(lambda_ * branch_pit[:, LENGTH], branch_pit[:, D]) + branch_pit[:, LC] load_vec = p_diff + branch_pit[:, PL] + const_height * p_sum \ diff --git a/pandapipes/pf/derivative_toolbox_numba.py b/pandapipes/pf/derivative_toolbox_numba.py index a3b7f3eb8..1cd990a00 100644 --- a/pandapipes/pf/derivative_toolbox_numba.py +++ b/pandapipes/pf/derivative_toolbox_numba.py @@ -3,7 +3,7 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT_IN, \ VINIT from pandapipes.idx_node import HEIGHT, PAMB, PINIT, TINIT as TINIT_NODE @@ -64,11 +64,11 @@ def derivatives_hydraulic_comp_numba(branch_pit, lambda_, der_lambda, p_init_i_a p_sum = p_init_i_abs[i] + p_init_i1_abs[i] p_sum_div = np.divide(1, p_sum) - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * branch_pit[i][TINIT], + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * branch_pit[i][TINIT_IN], NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[i][RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference[i], - 2 * NORMAL_PRESSURE * branch_pit[i][TINIT] * P_CONVERSION) + 2 * NORMAL_PRESSURE * branch_pit[i][TINIT_IN] * P_CONVERSION) friction_term = np.divide(lambda_[i] * branch_pit[i][LENGTH], branch_pit[i][D]) + branch_pit[i][LC] diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 1782a9f4c..e58e6ea59 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -2,7 +2,7 @@ from pandapipes.constants import NORMAL_PRESSURE, NORMAL_TEMPERATURE from pandapipes.idx_branch import ELEMENT_IDX, FROM_NODE, TO_NODE, LOAD_VEC_NODES, VINIT, RE, \ - LAMBDA, TINIT, FROM_NODE_T, TO_NODE_T, PL, T_OUT + LAMBDA, TINIT_IN, FROM_NODE_T, TO_NODE_T, PL, TINIT_OUT from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup, get_net_option @@ -77,7 +77,7 @@ def get_branch_results_gas(net, branch_pit, node_pit, from_nodes, to_nodes, v_mp / (p_abs_from[mask] ** 2 - p_abs_to[mask] ** 2) fluid = get_fluid(net) - numerator = NORMAL_PRESSURE * branch_pit[:, TINIT] / NORMAL_TEMPERATURE + numerator = NORMAL_PRESSURE * branch_pit[:, TINIT_IN] / NORMAL_TEMPERATURE normfactor_from = numerator * fluid.get_property("compressibility", p_abs_from) / p_abs_from normfactor_to = numerator * fluid.get_property("compressibility", p_abs_to) / p_abs_to normfactor_mean = numerator * fluid.get_property("compressibility", p_abs_mean) / p_abs_mean @@ -131,7 +131,7 @@ def get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_a [np.empty_like(v_mps) for _ in range(6)] for i in range(len(v_mps)): - numerator = np.divide(NORMAL_PRESSURE * branch_pit[i, TINIT], NORMAL_TEMPERATURE) + numerator = np.divide(NORMAL_PRESSURE * branch_pit[i, TINIT_IN], NORMAL_TEMPERATURE) normfactor_from[i] = np.divide(numerator * comp_from[i], p_abs_from[i]) normfactor_to[i] = np.divide(numerator * comp_to[i], p_abs_to[i]) normfactor_mean[i] = np.divide(numerator * comp_mean[i], p_abs_mean[i]) @@ -273,8 +273,8 @@ def extract_results_active_pit(net, mode="hydraulics"): if i not in [not_affected_node_col]]) rows_nodes = np.arange(net["_pit"]["node"].shape[0])[nodes_connected] - result_branch_col = VINIT if mode == "hydraulics" else T_OUT - not_affected_branch_col = T_OUT if mode == "hydraulics" else VINIT + result_branch_col = VINIT if mode == "hydraulics" else TINIT_OUT + not_affected_branch_col = TINIT_OUT if mode == "hydraulics" else VINIT copied_branch_cols = np.array([i for i in range(net["_pit"]["branch"].shape[1]) if i not in [FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, not_affected_branch_col]]) diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 1dc89367a..f26c63663 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -7,10 +7,10 @@ from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve -from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T +from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, TINIT_OUT, VINIT_T from pandapipes.idx_node import PINIT, TINIT from pandapipes.pf.build_system_matrix import build_system_matrix -from pandapipes.pf.derivative_calculation import calculate_derivatives_hydraulic +from pandapipes.pf.derivative_calculation import calculate_derivatives_hydraulic, calculate_derivatives_thermal from pandapipes.pf.pipeflow_setup import get_net_option, get_net_options, set_net_option, \ init_options, create_internal_results, write_internal_results, get_lookup, create_lookups, \ initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ @@ -269,17 +269,22 @@ def solve_temperature(net): branch_pit[mask, TO_NODE_T] = branch_pit[mask, FROM_NODE] for comp in net['component_list']: - comp.calculate_derivatives_thermal(net, branch_pit, node_pit, branch_lookups, options) + comp.adaption_before_derivatives_thermal( + net, branch_pit, node_pit, branch_lookups, options) + calculate_derivatives_thermal(net, branch_pit, node_pit, options) + for comp in net['component_list']: + comp.adaption_after_derivatives_thermal( + net, branch_pit, node_pit, branch_lookups, options) jacobian, epsilon = build_system_matrix(net, branch_pit, node_pit, True) t_init_old = node_pit[:, TINIT].copy() - t_out_old = branch_pit[:, T_OUT].copy() + t_out_old = branch_pit[:, TINIT_OUT].copy() x = spsolve(jacobian, epsilon) node_pit[:, TINIT] += x[:len(node_pit)] * options["alpha"] - branch_pit[:, T_OUT] += x[len(node_pit):] + branch_pit[:, TINIT_OUT] += x[len(node_pit):] - return branch_pit[:, T_OUT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon + return branch_pit[:, TINIT_OUT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon def set_damping_factor(net, niter, error): @@ -313,7 +318,7 @@ def set_damping_factor(net, niter, error): def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_method, tol_1, tol_2, tol_res, vals_1_old, vals_2_old, hydraulic_mode=True): - col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, T_OUT) + col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, TINIT_OUT) # Control of damping factor if nonlinear_method == "automatic": diff --git a/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py b/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py index 28c021296..25d6db078 100644 --- a/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py +++ b/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py @@ -254,7 +254,7 @@ def retrieve_temperature_liquid(net): for j in range(num_of_pipes): pipe_res = Pipe.get_internal_results(net, [j]) - T_mean_pandapipes[j] = st.mean(pipe_res["TINIT"][:, 1]) + T_mean_pandapipes[j] = st.mean(pipe_res["TINIT_IN"][:, 1]) T_diff_mean = np.abs(1 - T_mean_pandapipes / T_mean_om) T_diff_abs = np.abs(T_mean_om - T_mean_pandapipes) diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py b/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py index 3ad196701..2e0045c08 100644 --- a/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py +++ b/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py @@ -99,8 +99,8 @@ def test_temperature_internal_nodes_single_pipe(use_numba): header=0, keep_default_na=False) temp_an = data["T"] - pipe_temp_data_idx = np.where(pipe_results["TINIT"][:, 0] == 0) - pipe_temp_data = pipe_results["TINIT"][pipe_temp_data_idx, 1] + pipe_temp_data_idx = np.where(pipe_results["TINIT_IN"][:, 0] == 0) + pipe_temp_data = pipe_results["TINIT_IN"][pipe_temp_data_idx, 1] node_pit = net["_pit"]["node"] diff --git a/tutorials/temperature_calculation.ipynb b/tutorials/temperature_calculation.ipynb index f5e24e463..03526ceb9 100644 --- a/tutorials/temperature_calculation.ipynb +++ b/tutorials/temperature_calculation.ipynb @@ -201,7 +201,7 @@ "metadata": {}, "outputs": [], "source": [ - "pipe_1_results[\"TINIT\"]" + "pipe_1_results[\"TINIT_IN\"]" ] }, { From 219ea372c49df0ef6af36a6a3d741dc6a649cb9f Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 16:50:27 +0200 Subject: [PATCH 046/126] pipeflow cancellation if all nodes are out-of-service after the connectivity check --- CHANGELOG.rst | 1 + pandapipes/multinet/create_multinet.py | 2 - .../timeseries/run_time_series_multinet.py | 1 - pandapipes/pf/pipeflow_setup.py | 1 + pandapipes/pipeflow.py | 17 ++++-- .../test/pipeflow_internals/test_inservice.py | 57 +++++++++++++++---- 6 files changed, 60 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fa3f0f197..aaeff51ef 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Change Log ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) +- [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables diff --git a/pandapipes/multinet/create_multinet.py b/pandapipes/multinet/create_multinet.py index 4a5352a5c..cd74dce9f 100644 --- a/pandapipes/multinet/create_multinet.py +++ b/pandapipes/multinet/create_multinet.py @@ -12,8 +12,6 @@ import logging logger = logging.getLogger(__name__) -logger.setLevel(level=logging.WARNING) - def create_empty_multinet(name=""): """ diff --git a/pandapipes/multinet/timeseries/run_time_series_multinet.py b/pandapipes/multinet/timeseries/run_time_series_multinet.py index 7394a7780..1d829c75d 100644 --- a/pandapipes/multinet/timeseries/run_time_series_multinet.py +++ b/pandapipes/multinet/timeseries/run_time_series_multinet.py @@ -19,7 +19,6 @@ import logging as pplog logger = pplog.getLogger(__name__) -logger.setLevel(level=pplog.WARNING) def _call_output_writer(multinet, time_step, pf_converged, ctrl_converged, ts_variables): diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 713f05be8..eb63f5f6d 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -498,6 +498,7 @@ def identify_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): mode = "hydraulics" if hydraulic else "heat_transfer" net["_lookups"]["node_active_" + mode] = nodes_connected net["_lookups"]["branch_active_" + mode] = branches_connected + return node_pit[nodes_connected], branch_pit[branches_connected] def branches_connected_flow(branch_pit): diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 1dc89367a..e31674d3b 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -4,7 +4,6 @@ import numpy as np from numpy import linalg -from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T @@ -16,6 +15,7 @@ initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ identify_active_nodes_branches from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit +from pandapower.auxiliary import ppException try: import pandaplan.core.pplog as logging @@ -70,15 +70,22 @@ def pipeflow(net, sol_vec=None, **kwargs): create_lookups(net) node_pit, branch_pit = initialize_pit(net) - if (len(node_pit) == 0) & (len(branch_pit) == 0): - logger.warning("There are no node and branch entries defined. This might mean that your net" - " is empty") + if len(node_pit) == 0: + logger.warning("There are no nodes defined. " + "You need at least one node! " + "Without any nodes, you are not able to conduct a pipeflow!") return + calculation_mode = get_net_option(net, "mode") calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - identify_active_nodes_branches(net, branch_pit, node_pit) + active_node_pit, active_branch_pit = identify_active_nodes_branches(net, branch_pit, node_pit) + + if (len(active_node_pit) == 0): + logger.warning(" All nodes are out of service. Probably they are not supplied." + " Have you forgotten to define an external grid?") + return if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 1db306804..73274da70 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -9,8 +9,8 @@ import pandapipes from pandapipes.pf.pipeflow_setup import get_lookup -from pandapipes.pipeflow import logger as pf_logger from pandapipes.pipeflow import PipeflowNotConverged +from pandapipes.pipeflow import logger as pf_logger try: import pandaplan.core.pplog as logging @@ -125,6 +125,29 @@ def create_mixed_indexing_grid(): return net +@pytest.fixture +def create_net_wo_external_hydraulic_grid(): + net = pp.create_empty_network("net", add_stdtypes=False) + pandapipes.create_fluid_from_lib(net, "hgas", overwrite=True) + pandapipes.create_junction(net, index=3, pn_bar=16, tfluid_k=283, height_m=0, + name="Junction 3", in_service=True, + type="junction", geodata=(0, 0)) + pandapipes.create_junction(net, index=9, pn_bar=16, tfluid_k=283, height_m=0, + name="Junction 9", in_service=True, + type="junction", geodata=(1, 0)) + pandapipes.create_junction(net, index=10, pn_bar=16, tfluid_k=283, height_m=0, + name="Junction 10", in_service=True, + type="junction", geodata=(2, 0)) + pandapipes.create_pipe_from_parameters(net, 9, 10, length_km=1, diameter_m=0.03, k_mm=.1, sections=10, + alpha_w_per_m2k=1, name="Pipe 6") + pandapipes.create_sink(net, 9, mdot_kg_per_s=0.01, name="Sink 3") + pandapipes.create_source(net, junction=10, mdot_kg_per_s=0.04, name="Source 3") + pandapipes.create_compressor(net, from_junction=9, to_junction=3, pressure_ratio=1.1, + name="Compressor 0", index=None, in_service=True) + pandapipes.create_ext_grid(net, junction=3, t_k=300) + return net + + @pytest.mark.parametrize("use_numba", [True, False]) def test_inservice_gas(create_test_net, use_numba): """ @@ -146,7 +169,7 @@ def test_inservice_gas(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not np.any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -179,7 +202,7 @@ def test_inservice_water(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -214,8 +237,8 @@ def test_connectivity_hydraulic(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[[1, 2, 3], :].values)) assert not np.any(np.isnan(net.res_junction.loc[[0, 1, 3, 4], :].values)) assert not np.any(np.isnan(net.res_pipe.loc[[0, 4], - ["v_mean_m_per_s", "p_from_bar", - "p_to_bar"]].values)) + ["v_mean_m_per_s", "p_from_bar", + "p_to_bar"]].values)) assert not np.any(np.isnan(net.res_sink.loc[[0, 2], "mdot_kg_per_s"].values)) assert np.all(np.isnan(net.res_sink.loc[[1, 3, 4], "mdot_kg_per_s"].values)) @@ -496,7 +519,7 @@ def test_mixed_indexing_oos2(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -514,7 +537,7 @@ def test_mixed_indexing_oos3(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -532,7 +555,7 @@ def test_mixed_indexing_oos4(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -550,7 +573,7 @@ def test_mixed_indexing_oos5(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -568,7 +591,7 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -577,10 +600,22 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) +@pytest.mark.parametrize("use_numba", [True, False]) +def test_pipeflow_cancellation(create_net_wo_external_hydraulic_grid, use_numba): + net = create_net_wo_external_hydraulic_grid + pandapipes.pipeflow(net) + assert np.all(np.isnan(net.res_junction)) + assert np.all(np.isnan(net.res_pipe)) + assert np.all(np.isnan(net.res_ext_grid)) + assert np.all(np.isnan(net.res_sink)) + assert np.all(np.isnan(net.res_source)) + assert np.all(np.isnan(net.res_compressor)) + + if __name__ == "__main__": pytest.main([r'pandapipes/test/pipeflow_internals/test_inservice.py']) From 9c86f1e62d4cd498c9cf87b87837aae041d65c15 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 17:12:44 +0200 Subject: [PATCH 047/126] readthedocs.yml deprecation --- .readthedocs.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 9fcbb7ac8..c07ac7cae 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,7 +1,11 @@ version: 2 +build: + os: ubuntu-22.04 + tools: + python: 3.9 + python: - version: 3.7 install: - method: pip path: . From 5aaa69934e0552b79ea0685bf31580350a37e22b Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 17:16:06 +0200 Subject: [PATCH 048/126] pp instead of pandapipes called --- pandapipes/test/pipeflow_internals/test_inservice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 73274da70..bec68b475 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -127,7 +127,7 @@ def create_mixed_indexing_grid(): @pytest.fixture def create_net_wo_external_hydraulic_grid(): - net = pp.create_empty_network("net", add_stdtypes=False) + net = pandapipes.create_empty_network("net", add_stdtypes=False) pandapipes.create_fluid_from_lib(net, "hgas", overwrite=True) pandapipes.create_junction(net, index=3, pn_bar=16, tfluid_k=283, height_m=0, name="Junction 3", in_service=True, From 93b96f84b10e5da98037254c67235e424d45740c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 17:39:28 +0200 Subject: [PATCH 049/126] adapted CHANGELOG.rst --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fa3f0f197..58ff9bc6f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,7 @@ Change Log - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables - [CHANGED] components can have their own internal arrays for specific calculations (e.g. for compressor pressure ratio), so that the pit does not need to include such component specific entries +- [CHANGED] .readthedocs.yml due to deprecation - [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added - [REMOVED] broken travis badge removed from readme From d4cbd9003b05dc979543ec68acaada4a73373e0f Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 17:41:13 +0200 Subject: [PATCH 050/126] bugfix in yml --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index c07ac7cae..56218e8d0 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,7 +3,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: 3.9 + python: "3.9" python: install: From 6a05602b3af9114032727b499b2d1480df736e45 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 19:42:50 +0200 Subject: [PATCH 051/126] bugfix in yml --- .readthedocs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index 56218e8d0..ac3999024 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -10,4 +10,4 @@ python: - method: pip path: . extra_requirements: - - docs + - doc From 3f648a887ab9dc41484f4afb55e552cd38108c72 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Sep 2023 19:48:04 +0200 Subject: [PATCH 052/126] bugfix in yml --- .readthedocs.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index ac3999024..b6911a40a 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -7,7 +7,4 @@ build: python: install: - - method: pip - path: . - extra_requirements: - - doc + - requirements: doc/requirements.txt \ No newline at end of file From 4a6528f9a1d2fb2dadc6caf5a2b24d76ce150d3b Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Sep 2023 20:39:53 +0200 Subject: [PATCH 053/126] change the names TINIT and T_OUT back --- .../abstract_models/branch_w_internals_models.py | 10 +++++----- .../abstract_models/branch_wo_internals_models.py | 10 +++++----- .../component_models/heat_exchanger_component.py | 2 +- pandapipes/component_models/pipe_component.py | 12 ++++++------ pandapipes/component_models/pump_component.py | 4 ++-- pandapipes/idx_branch.py | 4 ++-- pandapipes/pf/derivative_calculation.py | 4 ++-- pandapipes/pf/derivative_toolbox.py | 6 +++--- pandapipes/pf/derivative_toolbox_numba.py | 6 +++--- pandapipes/pf/result_extraction.py | 10 +++++----- pandapipes/pipeflow.py | 10 +++++----- .../pipeflow_openmodelica_comparison.py | 2 +- .../test_pipeflow_analytic_comparison.py | 4 ++-- tutorials/temperature_calculation.ipynb | 2 +- 14 files changed, 43 insertions(+), 43 deletions(-) diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/pandapipes/component_models/abstract_models/branch_w_internals_models.py index fa7a579e4..1b88f0eac 100644 --- a/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -6,7 +6,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent from pandapipes.component_models.component_toolbox import set_entry_check_repeat -from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, TINIT_IN, RHO, ETA, CP, ELEMENT_IDX +from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, TINIT, RHO, ETA, CP, ELEMENT_IDX from pandapipes.idx_node import L, node_cols, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup, get_lookup, get_table_number from pandapipes.properties.fluids import get_fluid @@ -196,12 +196,12 @@ def create_pit_branch_entries(cls, net, branch_pit): internal_pipe_number, has_internals) branch_w_internals_pit[:, FROM_NODE] = from_nodes branch_w_internals_pit[:, TO_NODE] = to_nodes - branch_w_internals_pit[:, TINIT_IN] = (node_pit[from_nodes, TINIT_NODE] + node_pit[ + branch_w_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] + node_pit[ to_nodes, TINIT_NODE]) / 2 fluid = get_fluid(net) - branch_w_internals_pit[:, RHO] = fluid.get_density(branch_w_internals_pit[:, TINIT_IN]) - branch_w_internals_pit[:, ETA] = fluid.get_viscosity(branch_w_internals_pit[:, TINIT_IN]) - branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(branch_w_internals_pit[:, TINIT_IN]) + branch_w_internals_pit[:, RHO] = fluid.get_density(branch_w_internals_pit[:, TINIT]) + branch_w_internals_pit[:, ETA] = fluid.get_viscosity(branch_w_internals_pit[:, TINIT]) + branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(branch_w_internals_pit[:, TINIT]) return branch_w_internals_pit, internal_pipe_number diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index 6872e6df2..106895d50 100644 --- a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -4,7 +4,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent -from pandapipes.idx_branch import FROM_NODE, TO_NODE, TINIT_IN, ELEMENT_IDX, RHO, ETA, CP, ACTIVE +from pandapipes.idx_branch import FROM_NODE, TO_NODE, TINIT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup @@ -82,12 +82,12 @@ def create_pit_branch_entries(cls, net, branch_pit): branch_wo_internals_pit[:, ELEMENT_IDX] = net[cls.table_name()].index.values branch_wo_internals_pit[:, FROM_NODE] = from_nodes branch_wo_internals_pit[:, TO_NODE] = to_nodes - branch_wo_internals_pit[:, TINIT_IN] = (node_pit[from_nodes, TINIT_NODE] + branch_wo_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] + node_pit[to_nodes, TINIT_NODE]) / 2 fluid = get_fluid(net) - branch_wo_internals_pit[:, RHO] = fluid.get_density(branch_wo_internals_pit[:, TINIT_IN]) - branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(branch_wo_internals_pit[:, TINIT_IN]) - branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(branch_wo_internals_pit[:, TINIT_IN]) + branch_wo_internals_pit[:, RHO] = fluid.get_density(branch_wo_internals_pit[:, TINIT]) + branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(branch_wo_internals_pit[:, TINIT]) + branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(branch_wo_internals_pit[:, TINIT]) branch_wo_internals_pit[:, ACTIVE] = net[cls.table_name()][cls.active_identifier()].values return branch_wo_internals_pit diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index 5bc6dae3c..55f15e86e 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -9,7 +9,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import TL, ALPHA, TEXT, QEXT, TINIT_OUT, D, AREA, LOSS_COEFFICIENT as LC +from pandapipes.idx_branch import TL, ALPHA, TEXT, QEXT, T_OUT, D, AREA, LOSS_COEFFICIENT as LC from pandapipes.pf.pipeflow_setup import get_fluid from pandapipes.pf.result_extraction import extract_branch_results_without_internals diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index 600f06726..6d93d1b80 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -11,7 +11,7 @@ from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE from pandapipes.idx_branch import FROM_NODE, TO_NODE, LENGTH, D, AREA, K, \ - VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, TINIT_OUT + VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, T_OUT, from pandapipes.idx_node import PINIT, HEIGHT, TINIT as TINIT_NODE, \ RHO as RHO_NODES, PAMB, ACTIVE as ACTIVE_ND from pandapipes.pf.pipeflow_setup import get_fluid, get_lookup @@ -153,7 +153,7 @@ def create_pit_branch_entries(cls, net, branch_pit): node_pit = net["_pit"]["node"] to_nodes = pipe_pit[:, TO_NODE].astype(np.int32) - pipe_pit[:, TINIT_OUT] = node_pit[to_nodes, TINIT_NODE] + pipe_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] pipe_pit[:, AREA] = pipe_pit[:, D] ** 2 * np.pi / 4 @classmethod @@ -206,7 +206,7 @@ def get_internal_results(cls, net, pipe): v_pipe_idx = np.repeat(pipe, internal_sections[pipe]) pipe_results = dict() pipe_results["PINIT"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) - pipe_results["TINIT_IN"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) + pipe_results["TINIT"] = np.zeros((len(p_node_idx), 2), dtype=np.float64) pipe_results["VINIT_FROM"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) pipe_results["VINIT_TO"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) pipe_results["VINIT_MEAN"] = np.zeros((len(v_pipe_idx), 2), dtype=np.float64) @@ -272,8 +272,8 @@ def get_internal_results(cls, net, pipe): pipe_results["PINIT"][:, 0] = p_node_idx pipe_results["PINIT"][:, 1] = p_node_data - pipe_results["TINIT_IN"][:, 0] = p_node_idx - pipe_results["TINIT_IN"][:, 1] = t_node_data + pipe_results["TINIT"][:, 0] = p_node_idx + pipe_results["TINIT"][:, 1] = t_node_data else: logger.warning("For at least one pipe no internal data is available.") @@ -347,7 +347,7 @@ def plot_pipe(cls, net, pipe, pipe_results): pipe_p_data_idx = np.where(pipe_results["PINIT"][:, 0] == pipe) pipe_v_data_idx = np.where(pipe_results["VINIT_MEAN"][:, 0] == pipe) pipe_p_data = pipe_results["PINIT"][pipe_p_data_idx, 1] - pipe_t_data = pipe_results["TINIT_IN"][pipe_p_data_idx, 1] + pipe_t_data = pipe_results["TINIT"][pipe_p_data_idx, 1] pipe_v_data = pipe_results["VINIT_MEAN"][pipe_v_data_idx, 1] node_pit = net["_pit"]["node"] diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index 5a3b23606..3f4b69ff2 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -12,7 +12,7 @@ BranchWZeroLengthComponent from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE, R_UNIVERSAL, P_CONVERSION from pandapipes.idx_branch import STD_TYPE, VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, \ - TINIT_IN, PL + TINIT, PL from pandapipes.idx_node import PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import get_fluid, get_net_option, get_lookup from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -79,7 +79,7 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo fluid = get_fluid(net) p_from = node_pit[from_nodes, PAMB] + node_pit[from_nodes, PINIT] # p_to = node_pit[to_nodes, PAMB] + node_pit[to_nodes, PINIT] - numerator = NORMAL_PRESSURE * pump_pit[:, TINIT_IN] + numerator = NORMAL_PRESSURE * pump_pit[:, TINIT] v_mps = pump_pit[:, VINIT] if fluid.is_gas: # consider volume flow at inlet diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index 0db7397e0..2b59f2360 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -17,7 +17,7 @@ RHO = 8 # Density in [kg/m^3 ETA = 9 # Dynamic viscosity in [Pas] K = 10 # Pipe roughness in [m] -TINIT_IN = 11 # Temperature in [K] +TINIT = 11 # Temperature in [K] VINIT = 12 # velocity in [m/s] RE = 13 # Reynolds number LAMBDA = 14 # Lambda @@ -33,7 +33,7 @@ JAC_DERIV_DT = 24 JAC_DERIV_DT1 = 25 LOAD_VEC_BRANCHES_T = 26 -TINIT_OUT = 27 # Internal slot for outlet pipe temperature +T_OUT = 27 # Internal slot for outlet pipe temperature JAC_DERIV_DT_NODE = 28 # Slot for the derivative fpr T for the nodes connected to branch LOAD_VEC_NODES_T = 29 VINIT_T = 30 diff --git a/pandapipes/pf/derivative_calculation.py b/pandapipes/pf/derivative_calculation.py index 95f051771..12463db7a 100644 --- a/pandapipes/pf/derivative_calculation.py +++ b/pandapipes/pf/derivative_calculation.py @@ -1,6 +1,6 @@ import numpy as np -from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT_IN, LOAD_VEC_BRANCHES, \ +from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT, LOAD_VEC_BRANCHES, \ JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \ FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, TINIT_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE @@ -37,7 +37,7 @@ def calculate_derivatives_hydraulic(net, branch_pit, node_pit, options): to_nodes = branch_pit[:, TO_NODE].astype(np.int32) tinit_branch, height_difference, p_init_i_abs, p_init_i1_abs = \ get_derived_values(node_pit, from_nodes, to_nodes, options["use_numba"]) - branch_pit[:, TINIT_IN] = tinit_branch + branch_pit[:, TINIT] = tinit_branch if not gas_mode: if options["use_numba"]: diff --git a/pandapipes/pf/derivative_toolbox.py b/pandapipes/pf/derivative_toolbox.py index fd26b06f3..e681c71fa 100644 --- a/pandapipes/pf/derivative_toolbox.py +++ b/pandapipes/pf/derivative_toolbox.py @@ -7,7 +7,7 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT_IN, \ +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ VINIT from pandapipes.idx_node import HEIGHT, PINIT, PAMB, TINIT as TINIT_NODE @@ -41,11 +41,11 @@ def derivatives_hydraulic_comp_np(branch_pit, lambda_, der_lambda, p_init_i_abs, p_sum = p_init_i_abs + p_init_i1_abs p_sum_div = np.divide(1, p_sum) - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * branch_pit[:, TINIT_IN], + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * branch_pit[:, TINIT], NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[:, RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference, - 2 * NORMAL_PRESSURE * branch_pit[:, TINIT_IN] * P_CONVERSION) + 2 * NORMAL_PRESSURE * branch_pit[:, TINIT] * P_CONVERSION) friction_term = np.divide(lambda_ * branch_pit[:, LENGTH], branch_pit[:, D]) + branch_pit[:, LC] load_vec = p_diff + branch_pit[:, PL] + const_height * p_sum \ diff --git a/pandapipes/pf/derivative_toolbox_numba.py b/pandapipes/pf/derivative_toolbox_numba.py index 1cd990a00..a3b7f3eb8 100644 --- a/pandapipes/pf/derivative_toolbox_numba.py +++ b/pandapipes/pf/derivative_toolbox_numba.py @@ -3,7 +3,7 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT_IN, \ +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ VINIT from pandapipes.idx_node import HEIGHT, PAMB, PINIT, TINIT as TINIT_NODE @@ -64,11 +64,11 @@ def derivatives_hydraulic_comp_numba(branch_pit, lambda_, der_lambda, p_init_i_a p_sum = p_init_i_abs[i] + p_init_i1_abs[i] p_sum_div = np.divide(1, p_sum) - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * branch_pit[i][TINIT_IN], + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * branch_pit[i][TINIT], NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[i][RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference[i], - 2 * NORMAL_PRESSURE * branch_pit[i][TINIT_IN] * P_CONVERSION) + 2 * NORMAL_PRESSURE * branch_pit[i][TINIT] * P_CONVERSION) friction_term = np.divide(lambda_[i] * branch_pit[i][LENGTH], branch_pit[i][D]) + branch_pit[i][LC] diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index e58e6ea59..1782a9f4c 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -2,7 +2,7 @@ from pandapipes.constants import NORMAL_PRESSURE, NORMAL_TEMPERATURE from pandapipes.idx_branch import ELEMENT_IDX, FROM_NODE, TO_NODE, LOAD_VEC_NODES, VINIT, RE, \ - LAMBDA, TINIT_IN, FROM_NODE_T, TO_NODE_T, PL, TINIT_OUT + LAMBDA, TINIT, FROM_NODE_T, TO_NODE_T, PL, T_OUT from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup, get_net_option @@ -77,7 +77,7 @@ def get_branch_results_gas(net, branch_pit, node_pit, from_nodes, to_nodes, v_mp / (p_abs_from[mask] ** 2 - p_abs_to[mask] ** 2) fluid = get_fluid(net) - numerator = NORMAL_PRESSURE * branch_pit[:, TINIT_IN] / NORMAL_TEMPERATURE + numerator = NORMAL_PRESSURE * branch_pit[:, TINIT] / NORMAL_TEMPERATURE normfactor_from = numerator * fluid.get_property("compressibility", p_abs_from) / p_abs_from normfactor_to = numerator * fluid.get_property("compressibility", p_abs_to) / p_abs_to normfactor_mean = numerator * fluid.get_property("compressibility", p_abs_mean) / p_abs_mean @@ -131,7 +131,7 @@ def get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_a [np.empty_like(v_mps) for _ in range(6)] for i in range(len(v_mps)): - numerator = np.divide(NORMAL_PRESSURE * branch_pit[i, TINIT_IN], NORMAL_TEMPERATURE) + numerator = np.divide(NORMAL_PRESSURE * branch_pit[i, TINIT], NORMAL_TEMPERATURE) normfactor_from[i] = np.divide(numerator * comp_from[i], p_abs_from[i]) normfactor_to[i] = np.divide(numerator * comp_to[i], p_abs_to[i]) normfactor_mean[i] = np.divide(numerator * comp_mean[i], p_abs_mean[i]) @@ -273,8 +273,8 @@ def extract_results_active_pit(net, mode="hydraulics"): if i not in [not_affected_node_col]]) rows_nodes = np.arange(net["_pit"]["node"].shape[0])[nodes_connected] - result_branch_col = VINIT if mode == "hydraulics" else TINIT_OUT - not_affected_branch_col = TINIT_OUT if mode == "hydraulics" else VINIT + result_branch_col = VINIT if mode == "hydraulics" else T_OUT + not_affected_branch_col = T_OUT if mode == "hydraulics" else VINIT copied_branch_cols = np.array([i for i in range(net["_pit"]["branch"].shape[1]) if i not in [FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, not_affected_branch_col]]) diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index f26c63663..710764ef4 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -7,7 +7,7 @@ from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve -from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, TINIT_OUT, VINIT_T +from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T from pandapipes.idx_node import PINIT, TINIT from pandapipes.pf.build_system_matrix import build_system_matrix from pandapipes.pf.derivative_calculation import calculate_derivatives_hydraulic, calculate_derivatives_thermal @@ -278,13 +278,13 @@ def solve_temperature(net): jacobian, epsilon = build_system_matrix(net, branch_pit, node_pit, True) t_init_old = node_pit[:, TINIT].copy() - t_out_old = branch_pit[:, TINIT_OUT].copy() + t_out_old = branch_pit[:, T_OUT].copy() x = spsolve(jacobian, epsilon) node_pit[:, TINIT] += x[:len(node_pit)] * options["alpha"] - branch_pit[:, TINIT_OUT] += x[len(node_pit):] + branch_pit[:, T_OUT] += x[len(node_pit):] - return branch_pit[:, TINIT_OUT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon + return branch_pit[:, T_OUT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon def set_damping_factor(net, niter, error): @@ -318,7 +318,7 @@ def set_damping_factor(net, niter, error): def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_method, tol_1, tol_2, tol_res, vals_1_old, vals_2_old, hydraulic_mode=True): - col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, TINIT_OUT) + col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, T_OUT) # Control of damping factor if nonlinear_method == "automatic": diff --git a/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py b/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py index 25d6db078..28c021296 100644 --- a/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py +++ b/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py @@ -254,7 +254,7 @@ def retrieve_temperature_liquid(net): for j in range(num_of_pipes): pipe_res = Pipe.get_internal_results(net, [j]) - T_mean_pandapipes[j] = st.mean(pipe_res["TINIT_IN"][:, 1]) + T_mean_pandapipes[j] = st.mean(pipe_res["TINIT"][:, 1]) T_diff_mean = np.abs(1 - T_mean_pandapipes / T_mean_om) T_diff_abs = np.abs(T_mean_om - T_mean_pandapipes) diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py b/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py index 2e0045c08..3ad196701 100644 --- a/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py +++ b/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py @@ -99,8 +99,8 @@ def test_temperature_internal_nodes_single_pipe(use_numba): header=0, keep_default_na=False) temp_an = data["T"] - pipe_temp_data_idx = np.where(pipe_results["TINIT_IN"][:, 0] == 0) - pipe_temp_data = pipe_results["TINIT_IN"][pipe_temp_data_idx, 1] + pipe_temp_data_idx = np.where(pipe_results["TINIT"][:, 0] == 0) + pipe_temp_data = pipe_results["TINIT"][pipe_temp_data_idx, 1] node_pit = net["_pit"]["node"] diff --git a/tutorials/temperature_calculation.ipynb b/tutorials/temperature_calculation.ipynb index 03526ceb9..f5e24e463 100644 --- a/tutorials/temperature_calculation.ipynb +++ b/tutorials/temperature_calculation.ipynb @@ -201,7 +201,7 @@ "metadata": {}, "outputs": [], "source": [ - "pipe_1_results[\"TINIT_IN\"]" + "pipe_1_results[\"TINIT\"]" ] }, { From 214a98778aa3ae5dca86f7d699f4671a76e471ba Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Sep 2023 20:55:03 +0200 Subject: [PATCH 054/126] bugfix --- pandapipes/component_models/pipe_component.py | 2 +- pandapipes/pf/derivative_calculation.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index 6d93d1b80..c2671c524 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -11,7 +11,7 @@ from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE from pandapipes.idx_branch import FROM_NODE, TO_NODE, LENGTH, D, AREA, K, \ - VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, T_OUT, + VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, T_OUT from pandapipes.idx_node import PINIT, HEIGHT, TINIT as TINIT_NODE, \ RHO as RHO_NODES, PAMB, ACTIVE as ACTIVE_ND from pandapipes.pf.pipeflow_setup import get_fluid, get_lookup diff --git a/pandapipes/pf/derivative_calculation.py b/pandapipes/pf/derivative_calculation.py index 12463db7a..baa47c34f 100644 --- a/pandapipes/pf/derivative_calculation.py +++ b/pandapipes/pf/derivative_calculation.py @@ -2,7 +2,7 @@ from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT, LOAD_VEC_BRANCHES, \ JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \ - FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, TINIT_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ + FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, T_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.properties.fluids import get_fluid @@ -81,7 +81,7 @@ def calculate_derivatives_thermal(net, branch_pit, node_pit, options): v_init = branch_pit[:, VINIT_T] from_nodes = branch_pit[:, FROM_NODE_T].astype(np.int32) t_init_i = node_pit[from_nodes, TINIT_NODE] - t_init_i1 = branch_pit[:, TINIT_OUT] + t_init_i1 = branch_pit[:, T_OUT] t_amb = branch_pit[:, TEXT] area = branch_pit[:, AREA] length = branch_pit[:, LENGTH] From 1f040ee3cceb65cf6b86d09cc2f46fcf5a645cc9 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 15 Sep 2023 17:36:51 +0200 Subject: [PATCH 055/126] removing TINIT from branch variable as it is no solver variable --- .../branch_w_internals_models.py | 13 ++--- .../branch_wo_internals_models.py | 12 ++-- .../heat_exchanger_component.py | 2 +- pandapipes/component_models/pipe_component.py | 5 +- pandapipes/component_models/pump_component.py | 7 ++- pandapipes/idx_branch.py | 55 +++++++++---------- pandapipes/pf/derivative_calculation.py | 5 +- pandapipes/pf/derivative_toolbox.py | 13 +++-- pandapipes/pf/derivative_toolbox_numba.py | 17 ++++-- pandapipes/pf/result_extraction.py | 32 +++++++---- .../pipeflow_internals/test_pipeflow_modes.py | 2 +- 11 files changed, 87 insertions(+), 76 deletions(-) diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/pandapipes/component_models/abstract_models/branch_w_internals_models.py index 1b88f0eac..c7d5c2b5c 100644 --- a/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -6,7 +6,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent from pandapipes.component_models.component_toolbox import set_entry_check_repeat -from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, TINIT, RHO, ETA, CP, ELEMENT_IDX +from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, RHO, ETA, CP, ELEMENT_IDX, T_OUT from pandapipes.idx_node import L, node_cols, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup, get_lookup, get_table_number from pandapipes.properties.fluids import get_fluid @@ -196,13 +196,12 @@ def create_pit_branch_entries(cls, net, branch_pit): internal_pipe_number, has_internals) branch_w_internals_pit[:, FROM_NODE] = from_nodes branch_w_internals_pit[:, TO_NODE] = to_nodes - branch_w_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] + node_pit[ - to_nodes, TINIT_NODE]) / 2 + branch_w_internals_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] + tm = (node_pit[from_nodes, TINIT_NODE] + branch_w_internals_pit[:, T_OUT]) / 2 fluid = get_fluid(net) - branch_w_internals_pit[:, RHO] = fluid.get_density(branch_w_internals_pit[:, TINIT]) - branch_w_internals_pit[:, ETA] = fluid.get_viscosity(branch_w_internals_pit[:, TINIT]) - branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(branch_w_internals_pit[:, TINIT]) - + branch_w_internals_pit[:, RHO] = fluid.get_density(tm) + branch_w_internals_pit[:, ETA] = fluid.get_viscosity(tm) + branch_w_internals_pit[:, CP] = fluid.get_heat_capacity(tm) return branch_w_internals_pit, internal_pipe_number @classmethod diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index 106895d50..b66d01567 100644 --- a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -4,7 +4,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent -from pandapipes.idx_branch import FROM_NODE, TO_NODE, TINIT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE +from pandapipes.idx_branch import FROM_NODE, TO_NODE, T_OUT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup @@ -82,12 +82,12 @@ def create_pit_branch_entries(cls, net, branch_pit): branch_wo_internals_pit[:, ELEMENT_IDX] = net[cls.table_name()].index.values branch_wo_internals_pit[:, FROM_NODE] = from_nodes branch_wo_internals_pit[:, TO_NODE] = to_nodes - branch_wo_internals_pit[:, TINIT] = (node_pit[from_nodes, TINIT_NODE] - + node_pit[to_nodes, TINIT_NODE]) / 2 + branch_wo_internals_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] + tm = (node_pit[from_nodes, TINIT_NODE] + branch_wo_internals_pit[:, T_OUT]) / 2 fluid = get_fluid(net) - branch_wo_internals_pit[:, RHO] = fluid.get_density(branch_wo_internals_pit[:, TINIT]) - branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(branch_wo_internals_pit[:, TINIT]) - branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(branch_wo_internals_pit[:, TINIT]) + branch_wo_internals_pit[:, RHO] = fluid.get_density(tm) + branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(tm) + branch_wo_internals_pit[:, CP] = fluid.get_heat_capacity(tm) branch_wo_internals_pit[:, ACTIVE] = net[cls.table_name()][cls.active_identifier()].values return branch_wo_internals_pit diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index 55f15e86e..3270d9db1 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -9,7 +9,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import TL, ALPHA, TEXT, QEXT, T_OUT, D, AREA, LOSS_COEFFICIENT as LC +from pandapipes.idx_branch import ALPHA, TEXT, QEXT, D, AREA, LOSS_COEFFICIENT as LC from pandapipes.pf.pipeflow_setup import get_fluid from pandapipes.pf.result_extraction import extract_branch_results_without_internals diff --git a/pandapipes/component_models/pipe_component.py b/pandapipes/component_models/pipe_component.py index c2671c524..99b2f098a 100644 --- a/pandapipes/component_models/pipe_component.py +++ b/pandapipes/component_models/pipe_component.py @@ -11,7 +11,7 @@ from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE from pandapipes.idx_branch import FROM_NODE, TO_NODE, LENGTH, D, AREA, K, \ - VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC, T_OUT + VINIT, ALPHA, QEXT, TEXT, LOSS_COEFFICIENT as LC from pandapipes.idx_node import PINIT, HEIGHT, TINIT as TINIT_NODE, \ RHO as RHO_NODES, PAMB, ACTIVE as ACTIVE_ND from pandapipes.pf.pipeflow_setup import get_fluid, get_lookup @@ -151,9 +151,6 @@ def create_pit_branch_entries(cls, net, branch_pit): set_entry_check_repeat( pipe_pit, LC, net[tbl].loss_coefficient.values, internal_pipe_number, has_internals) - node_pit = net["_pit"]["node"] - to_nodes = pipe_pit[:, TO_NODE].astype(np.int32) - pipe_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] pipe_pit[:, AREA] = pipe_pit[:, D] ** 2 * np.pi / 4 @classmethod diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index b24b83669..aa7f6a34c 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -12,7 +12,7 @@ from pandapipes.component_models.component_toolbox import get_component_array from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE, R_UNIVERSAL, P_CONVERSION -from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, TINIT, PL +from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, T_OUT, PL from pandapipes.idx_node import PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import get_fluid, get_net_option, get_lookup from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -102,11 +102,12 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo fluid = get_fluid(net) p_from = node_pit[from_nodes, PAMB] + node_pit[from_nodes, PINIT] # p_to = node_pit[to_nodes, PAMB] + node_pit[to_nodes, PINIT] - numerator = NORMAL_PRESSURE * pump_branch_pit[:, TINIT] + t_from = node_pit[from_nodes, TINIT_NODE] + numerator_from = NORMAL_PRESSURE * t_from v_mps = pump_branch_pit[:, VINIT] if fluid.is_gas: # consider volume flow at inlet - normfactor_from = numerator * fluid.get_property("compressibility", p_from) \ + normfactor_from = numerator_from * fluid.get_property("compressibility", p_from) \ / (p_from * NORMAL_TEMPERATURE) v_mean = v_mps * normfactor_from else: diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index 0f40fbd61..57a08ce6c 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -17,32 +17,31 @@ RHO = 8 # Density in [kg/m^3 ETA = 9 # Dynamic viscosity in [Pas] K = 10 # Pipe roughness in [m] -TINIT = 11 # Temperature in [K] -VINIT = 12 # velocity in [m/s] -RE = 13 # Reynolds number -LAMBDA = 14 # Lambda -JAC_DERIV_DV = 15 # Slot for the derivative by velocity -JAC_DERIV_DP = 16 # Slot for the derivative by pressure from_node -JAC_DERIV_DP1 = 17 # Slot for the derivative by pressure to_node -LOAD_VEC_BRANCHES = 18 # Slot for the load vector for the branches -JAC_DERIV_DV_NODE = 19 # Slot for the derivative by velocity for the nodes connected to branch -LOAD_VEC_NODES = 20 # Slot for the load vector of the nodes connected to branch -LOSS_COEFFICIENT = 21 -CP = 22 # Slot for fluid heat capacity values -ALPHA = 23 # Slot for heat transfer coefficient -JAC_DERIV_DT = 24 -JAC_DERIV_DT1 = 25 -LOAD_VEC_BRANCHES_T = 26 -T_OUT = 27 # Internal slot for outlet pipe temperature -JAC_DERIV_DT_NODE = 28 # Slot for the derivative fpr T for the nodes connected to branch -LOAD_VEC_NODES_T = 29 -VINIT_T = 30 -FROM_NODE_T = 31 -TO_NODE_T = 32 -QEXT = 33 # heat input in [W] -TEXT = 34 -PL = 35 -TL = 36 # Temperature lift [K] -BRANCH_TYPE = 37 # branch type relevant for the pressure controller +VINIT = 11 # velocity in [m/s] +RE = 12 # Reynolds number +LAMBDA = 13 # Lambda +JAC_DERIV_DV = 14 # Slot for the derivative by velocity +JAC_DERIV_DP = 15 # Slot for the derivative by pressure from_node +JAC_DERIV_DP1 = 16 # Slot for the derivative by pressure to_node +LOAD_VEC_BRANCHES = 17 # Slot for the load vector for the branches +JAC_DERIV_DV_NODE = 18 # Slot for the derivative by velocity for the nodes connected to branch +LOAD_VEC_NODES = 19 # Slot for the load vector of the nodes connected to branch +LOSS_COEFFICIENT = 20 +CP = 21 # Slot for fluid heat capacity values +ALPHA = 22 # Slot for heat transfer coefficient +JAC_DERIV_DT = 23 +JAC_DERIV_DT1 = 24 +LOAD_VEC_BRANCHES_T = 25 +T_OUT = 26 # Internal slot for outlet pipe temperature +JAC_DERIV_DT_NODE = 27 # Slot for the derivative fpr T for the nodes connected to branch +LOAD_VEC_NODES_T = 28 +VINIT_T = 29 +FROM_NODE_T = 30 +TO_NODE_T = 31 +QEXT = 32 # heat input in [W] +TEXT = 33 +PL = 34 +TL = 35 # Temperature lift [K] +BRANCH_TYPE = 36 # branch type relevant for the pressure controller -branch_cols = 38 +branch_cols = 37 diff --git a/pandapipes/pf/derivative_calculation.py b/pandapipes/pf/derivative_calculation.py index baa47c34f..79f148194 100644 --- a/pandapipes/pf/derivative_calculation.py +++ b/pandapipes/pf/derivative_calculation.py @@ -1,6 +1,6 @@ import numpy as np -from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, TINIT, LOAD_VEC_BRANCHES, \ +from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, LOAD_VEC_BRANCHES, \ JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \ FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, T_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE @@ -37,7 +37,6 @@ def calculate_derivatives_hydraulic(net, branch_pit, node_pit, options): to_nodes = branch_pit[:, TO_NODE].astype(np.int32) tinit_branch, height_difference, p_init_i_abs, p_init_i1_abs = \ get_derived_values(node_pit, from_nodes, to_nodes, options["use_numba"]) - branch_pit[:, TINIT] = tinit_branch if not gas_mode: if options["use_numba"]: @@ -64,7 +63,7 @@ def calculate_derivatives_hydraulic(net, branch_pit, node_pit, options): der_comp = fluid.get_der_compressibility() * der_p_m der_comp1 = fluid.get_der_compressibility() * der_p_m1 load_vec, load_vec_nodes, df_dv, df_dv_nodes, df_dp, df_dp1 = derivatives_hydraulic_comp( - branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, height_difference, + node_pit, branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, height_difference, comp_fact, der_comp, der_comp1) branch_pit[:, LOAD_VEC_BRANCHES] = load_vec diff --git a/pandapipes/pf/derivative_toolbox.py b/pandapipes/pf/derivative_toolbox.py index e681c71fa..605064639 100644 --- a/pandapipes/pf/derivative_toolbox.py +++ b/pandapipes/pf/derivative_toolbox.py @@ -7,8 +7,8 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ - VINIT +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, \ + VINIT, T_OUT, FROM_NODE from pandapipes.idx_node import HEIGHT, PINIT, PAMB, TINIT as TINIT_NODE @@ -32,7 +32,7 @@ def derivatives_hydraulic_incomp_np(branch_pit, der_lambda, p_init_i_abs, p_init return load_vec, load_vec_nodes, df_dv, df_dv_nodes, df_dp, df_dp1 -def derivatives_hydraulic_comp_np(branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, +def derivatives_hydraulic_comp_np(node_pit, branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, height_difference, comp_fact, der_comp, der_comp1): # Formulas for gas pressure loss according to laminar version v_init_abs = np.abs(branch_pit[:, VINIT]) @@ -40,12 +40,13 @@ def derivatives_hydraulic_comp_np(branch_pit, lambda_, der_lambda, p_init_i_abs, p_diff = p_init_i_abs - p_init_i1_abs p_sum = p_init_i_abs + p_init_i1_abs p_sum_div = np.divide(1, p_sum) - - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * branch_pit[:, TINIT], + from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) + tm = (node_pit[from_nodes, TINIT_NODE] + branch_pit[:, T_OUT]) / 2 + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * tm, NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[:, RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference, - 2 * NORMAL_PRESSURE * branch_pit[:, TINIT] * P_CONVERSION) + 2 * NORMAL_PRESSURE * tm * P_CONVERSION) friction_term = np.divide(lambda_ * branch_pit[:, LENGTH], branch_pit[:, D]) + branch_pit[:, LC] load_vec = p_diff + branch_pit[:, PL] + const_height * p_sum \ diff --git a/pandapipes/pf/derivative_toolbox_numba.py b/pandapipes/pf/derivative_toolbox_numba.py index a3b7f3eb8..3e125a114 100644 --- a/pandapipes/pf/derivative_toolbox_numba.py +++ b/pandapipes/pf/derivative_toolbox_numba.py @@ -3,8 +3,8 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE -from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, TINIT, \ - VINIT +from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, \ + VINIT, FROM_NODE, TO_NODE from pandapipes.idx_node import HEIGHT, PAMB, PINIT, TINIT as TINIT_NODE try: @@ -43,9 +43,9 @@ def derivatives_hydraulic_incomp_numba(branch_pit, der_lambda, p_init_i_abs, p_i return load_vec, load_vec_nodes, df_dv, df_dv_nodes, df_dp, df_dp1 -@jit((float64[:, :], float64[:], float64[:], float64[:], float64[:], float64[:], float64[:], +@jit((float64[:, :], float64[:, :], float64[:], float64[:], float64[:], float64[:], float64[:], float64[:], float64[:], float64[:]), nopython=True, cache=False) -def derivatives_hydraulic_comp_numba(branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, +def derivatives_hydraulic_comp_numba(node_pit, branch_pit, lambda_, der_lambda, p_init_i_abs, p_init_i1_abs, height_difference, comp_fact, der_comp, der_comp1): le = lambda_.shape[0] load_vec = np.zeros_like(lambda_) @@ -54,6 +54,8 @@ def derivatives_hydraulic_comp_numba(branch_pit, lambda_, der_lambda, p_init_i_a df_dp1 = np.zeros_like(lambda_) * (-1) load_vec_nodes = np.zeros_like(der_lambda) df_dv_nodes = np.zeros_like(der_lambda) + from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) + to_nodes = branch_pit[:, TO_NODE].astype(np.int32) # Formulas for gas pressure loss according to laminar version for i in range(le): @@ -63,12 +65,15 @@ def derivatives_hydraulic_comp_numba(branch_pit, lambda_, der_lambda, p_init_i_a p_diff = p_init_i_abs[i] - p_init_i1_abs[i] p_sum = p_init_i_abs[i] + p_init_i1_abs[i] p_sum_div = np.divide(1, p_sum) + fn = from_nodes[i] + tn = to_nodes[i] + tm = (node_pit[fn, TINIT_NODE] + node_pit[tn, TINIT_NODE]) / 2 - const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * branch_pit[i][TINIT], + const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[i][RHO] * tm, NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( branch_pit[i][RHO] * NORMAL_TEMPERATURE * GRAVITATION_CONSTANT * height_difference[i], - 2 * NORMAL_PRESSURE * branch_pit[i][TINIT] * P_CONVERSION) + 2 * NORMAL_PRESSURE * tm * P_CONVERSION) friction_term = np.divide(lambda_[i] * branch_pit[i][LENGTH], branch_pit[i][D]) + branch_pit[i][LC] diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 1782a9f4c..7bf8bf1cf 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -2,7 +2,7 @@ from pandapipes.constants import NORMAL_PRESSURE, NORMAL_TEMPERATURE from pandapipes.idx_branch import ELEMENT_IDX, FROM_NODE, TO_NODE, LOAD_VEC_NODES, VINIT, RE, \ - LAMBDA, TINIT, FROM_NODE_T, TO_NODE_T, PL, T_OUT + LAMBDA, FROM_NODE_T, TO_NODE_T, PL, T_OUT from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup, get_net_option @@ -77,9 +77,15 @@ def get_branch_results_gas(net, branch_pit, node_pit, from_nodes, to_nodes, v_mp / (p_abs_from[mask] ** 2 - p_abs_to[mask] ** 2) fluid = get_fluid(net) - numerator = NORMAL_PRESSURE * branch_pit[:, TINIT] / NORMAL_TEMPERATURE - normfactor_from = numerator * fluid.get_property("compressibility", p_abs_from) / p_abs_from - normfactor_to = numerator * fluid.get_property("compressibility", p_abs_to) / p_abs_to + t_from = node_pit[from_nodes, TINIT_NODE] + t_to = branch_pit[:, T_OUT] + tm = (t_from + t_to) / 2 + numerator_from = NORMAL_PRESSURE * t_from / NORMAL_TEMPERATURE + numerator_to = NORMAL_PRESSURE * t_to / NORMAL_TEMPERATURE + numerator = NORMAL_PRESSURE * tm / NORMAL_TEMPERATURE + + normfactor_from = numerator_from * fluid.get_property("compressibility", p_abs_from) / p_abs_from + normfactor_to = numerator_to * fluid.get_property("compressibility", p_abs_to) / p_abs_to normfactor_mean = numerator * fluid.get_property("compressibility", p_abs_mean) / p_abs_mean v_gas_from = v_mps * normfactor_from @@ -101,7 +107,7 @@ def get_branch_results_gas_numba(net, branch_pit, node_pit, from_nodes, to_nodes comp_mean = fluid.get_property("compressibility", p_abs_mean) v_gas_from, v_gas_to, v_gas_mean, normfactor_from, normfactor_to, normfactor_mean = \ - get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_abs_to, + get_gas_vel_numba(node_pit, branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_abs_to, p_abs_mean, v_mps) return v_gas_from, v_gas_to, v_gas_mean, p_abs_from, p_abs_to, p_abs_mean, normfactor_from, \ @@ -125,15 +131,19 @@ def get_pressures_numba(node_pit, from_nodes, to_nodes, v_mps, p_from, p_to): @jit(nopython=True) -def get_gas_vel_numba(branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_abs_to, p_abs_mean, - v_mps): +def get_gas_vel_numba(node_pit, branch_pit, comp_from, comp_to, comp_mean, p_abs_from, p_abs_to, p_abs_mean, v_mps): v_gas_from, v_gas_to, v_gas_mean, normfactor_from, normfactor_to, normfactor_mean = \ [np.empty_like(v_mps) for _ in range(6)] - + from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) for i in range(len(v_mps)): - numerator = np.divide(NORMAL_PRESSURE * branch_pit[i, TINIT], NORMAL_TEMPERATURE) - normfactor_from[i] = np.divide(numerator * comp_from[i], p_abs_from[i]) - normfactor_to[i] = np.divide(numerator * comp_to[i], p_abs_to[i]) + t_from = node_pit[from_nodes[i], TINIT_NODE] + t_to = branch_pit[i, T_OUT] + tm = (t_from + t_to) / 2 + numerator_from = np.divide(NORMAL_PRESSURE * t_from, NORMAL_TEMPERATURE) + numerator_to = np.divide(NORMAL_PRESSURE * t_to, NORMAL_TEMPERATURE) + numerator = np.divide(NORMAL_PRESSURE * tm, NORMAL_TEMPERATURE) + normfactor_from[i] = np.divide(numerator_from * comp_from[i], p_abs_from[i]) + normfactor_to[i] = np.divide(numerator_to * comp_to[i], p_abs_to[i]) normfactor_mean[i] = np.divide(numerator * comp_mean[i], p_abs_mean[i]) v_gas_from[i] = v_mps[i] * normfactor_from[i] v_gas_to[i] = v_mps[i] * normfactor_to[i] diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py b/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py index 8daa84d14..f08d49397 100644 --- a/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py +++ b/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py @@ -95,7 +95,7 @@ def test_heat_only(use_numba): nonlinear_method="automatic", mode="hydraulics", use_numba=use_numba) p = ntw._pit["node"][:, 5] - v = ntw._pit["branch"][:, 12] + v = ntw._pit["branch"][:, 11] u = np.concatenate((p, v)) pandapipes.pipeflow(ntw, sol_vec=u, stop_condition="tol", iter=50, friction_model="nikuradse", From 85fe997a1874c3e97866a824f7edb619916b5508 Mon Sep 17 00:00:00 2001 From: Khalil Ben Safta Date: Mon, 18 Sep 2023 12:42:11 +0200 Subject: [PATCH 056/126] fix formatting error in the documentation --- doc/source/fluid_properties/create_fluids.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/source/fluid_properties/create_fluids.rst b/doc/source/fluid_properties/create_fluids.rst index 32efef516..ec2fbd1b7 100644 --- a/doc/source/fluid_properties/create_fluids.rst +++ b/doc/source/fluid_properties/create_fluids.rst @@ -18,6 +18,7 @@ possible to work with the default fluids: - ``water``, - ``biomethane_pure`` and ``biomathane_treated`` (see `here `_ for the compositions), - ``air``. + The values are loaded from txt-files in the 'pandapipes/properties/[fluid name]' folder. One of these default fluids can be created and added to an From 32baa211cae166773be316af17c9c513da0a8464 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 29 Sep 2023 11:45:07 +0200 Subject: [PATCH 057/126] error in generic geodata: The second part was always missed and only pipes were considered. Adapted it accordingly that any branch component is considered. --- pandapipes/plotting/generic_geodata.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pandapipes/plotting/generic_geodata.py b/pandapipes/plotting/generic_geodata.py index 1a1b1be09..d3e518892 100644 --- a/pandapipes/plotting/generic_geodata.py +++ b/pandapipes/plotting/generic_geodata.py @@ -20,7 +20,7 @@ def build_igraph_from_ppipes(net, junctions=None): """ This function uses the igraph library to create an igraph graph for a given pandapipes network. - Pipes and valves are respected. + Any branch component is respected. Performance vs. networkx: https://graph-tool.skewed.de/performance :param net: The pandapipes network @@ -50,19 +50,20 @@ def build_igraph_from_ppipes(net, junctions=None): g.vs["label"] = list(junction_index) pp_junction_mapping = dict(list(zip(junction_index, list(range(nr_junctions))))) - mask = _get_element_mask_from_nodes(net, "pipe", ["from_junction", "to_junction"], junctions) - for pipe in net.pipe[mask].itertuples(): - g.add_edge(pp_junction_mapping[pipe.from_junction], pp_junction_mapping[pipe.to_junction], - weight=pipe.length_km) + #mask = _get_element_mask_from_nodes(net, "pipe", ["from_junction", "to_junction"], junctions) + #for pipe in net.pipe[mask].itertuples(): + # g.add_edge(pp_junction_mapping[pipe.from_junction], pp_junction_mapping[pipe.to_junction], + # weight=pipe.length_km) for comp in net['component_list']: - if not isinstance(comp, BranchComponent): + if not issubclass(comp, BranchComponent): continue fjc, tjc = comp.from_to_node_cols() mask = _get_element_mask_from_nodes(net, comp.table_name(), [fjc, tjc], junctions) for comp_data in net[comp.table_name()][mask].itertuples(): - g.add_edge(pp_junction_mapping[comp_data[fjc]], pp_junction_mapping[comp_data[tjc]], - weight=0.001) + weight = 0.001 if 'length_km' not in dir(comp_data) else getattr(comp_data, 'length_km') + g.add_edge(pp_junction_mapping[getattr(comp_data, fjc)], pp_junction_mapping[getattr(comp_data, tjc)], + weight=weight) meshed = _igraph_meshed(g) roots = [pp_junction_mapping[s] for s in net.ext_grid.junction.values if s in junction_index] From 98a89723a5db7745f92e8a1259c574c38a72a58c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 29 Sep 2023 11:50:46 +0200 Subject: [PATCH 058/126] removing changes from local develop --- CHANGELOG.rst | 1 - pandapipes/multinet/create_multinet.py | 2 + .../timeseries/run_time_series_multinet.py | 1 + pandapipes/pf/pipeflow_setup.py | 1 - pandapipes/pipeflow.py | 17 ++---- .../test/pipeflow_internals/test_inservice.py | 57 ++++--------------- 6 files changed, 19 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e9f952c5c..58ff9bc6f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,6 @@ Change Log ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) -- [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables diff --git a/pandapipes/multinet/create_multinet.py b/pandapipes/multinet/create_multinet.py index cd74dce9f..4a5352a5c 100644 --- a/pandapipes/multinet/create_multinet.py +++ b/pandapipes/multinet/create_multinet.py @@ -12,6 +12,8 @@ import logging logger = logging.getLogger(__name__) +logger.setLevel(level=logging.WARNING) + def create_empty_multinet(name=""): """ diff --git a/pandapipes/multinet/timeseries/run_time_series_multinet.py b/pandapipes/multinet/timeseries/run_time_series_multinet.py index 1d829c75d..7394a7780 100644 --- a/pandapipes/multinet/timeseries/run_time_series_multinet.py +++ b/pandapipes/multinet/timeseries/run_time_series_multinet.py @@ -19,6 +19,7 @@ import logging as pplog logger = pplog.getLogger(__name__) +logger.setLevel(level=pplog.WARNING) def _call_output_writer(multinet, time_step, pf_converged, ctrl_converged, ts_variables): diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index eb63f5f6d..713f05be8 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -498,7 +498,6 @@ def identify_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): mode = "hydraulics" if hydraulic else "heat_transfer" net["_lookups"]["node_active_" + mode] = nodes_connected net["_lookups"]["branch_active_" + mode] = branches_connected - return node_pit[nodes_connected], branch_pit[branches_connected] def branches_connected_flow(branch_pit): diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index e31674d3b..1dc89367a 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -4,6 +4,7 @@ import numpy as np from numpy import linalg +from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T @@ -15,7 +16,6 @@ initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ identify_active_nodes_branches from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit -from pandapower.auxiliary import ppException try: import pandaplan.core.pplog as logging @@ -70,22 +70,15 @@ def pipeflow(net, sol_vec=None, **kwargs): create_lookups(net) node_pit, branch_pit = initialize_pit(net) - if len(node_pit) == 0: - logger.warning("There are no nodes defined. " - "You need at least one node! " - "Without any nodes, you are not able to conduct a pipeflow!") + if (len(node_pit) == 0) & (len(branch_pit) == 0): + logger.warning("There are no node and branch entries defined. This might mean that your net" + " is empty") return - calculation_mode = get_net_option(net, "mode") calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - active_node_pit, active_branch_pit = identify_active_nodes_branches(net, branch_pit, node_pit) - - if (len(active_node_pit) == 0): - logger.warning(" All nodes are out of service. Probably they are not supplied." - " Have you forgotten to define an external grid?") - return + identify_active_nodes_branches(net, branch_pit, node_pit) if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index bec68b475..1db306804 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -9,8 +9,8 @@ import pandapipes from pandapipes.pf.pipeflow_setup import get_lookup -from pandapipes.pipeflow import PipeflowNotConverged from pandapipes.pipeflow import logger as pf_logger +from pandapipes.pipeflow import PipeflowNotConverged try: import pandaplan.core.pplog as logging @@ -125,29 +125,6 @@ def create_mixed_indexing_grid(): return net -@pytest.fixture -def create_net_wo_external_hydraulic_grid(): - net = pandapipes.create_empty_network("net", add_stdtypes=False) - pandapipes.create_fluid_from_lib(net, "hgas", overwrite=True) - pandapipes.create_junction(net, index=3, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 3", in_service=True, - type="junction", geodata=(0, 0)) - pandapipes.create_junction(net, index=9, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 9", in_service=True, - type="junction", geodata=(1, 0)) - pandapipes.create_junction(net, index=10, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 10", in_service=True, - type="junction", geodata=(2, 0)) - pandapipes.create_pipe_from_parameters(net, 9, 10, length_km=1, diameter_m=0.03, k_mm=.1, sections=10, - alpha_w_per_m2k=1, name="Pipe 6") - pandapipes.create_sink(net, 9, mdot_kg_per_s=0.01, name="Sink 3") - pandapipes.create_source(net, junction=10, mdot_kg_per_s=0.04, name="Source 3") - pandapipes.create_compressor(net, from_junction=9, to_junction=3, pressure_ratio=1.1, - name="Compressor 0", index=None, in_service=True) - pandapipes.create_ext_grid(net, junction=3, t_k=300) - return net - - @pytest.mark.parametrize("use_numba", [True, False]) def test_inservice_gas(create_test_net, use_numba): """ @@ -169,7 +146,7 @@ def test_inservice_gas(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not np.any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -202,7 +179,7 @@ def test_inservice_water(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -237,8 +214,8 @@ def test_connectivity_hydraulic(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[[1, 2, 3], :].values)) assert not np.any(np.isnan(net.res_junction.loc[[0, 1, 3, 4], :].values)) assert not np.any(np.isnan(net.res_pipe.loc[[0, 4], - ["v_mean_m_per_s", "p_from_bar", - "p_to_bar"]].values)) + ["v_mean_m_per_s", "p_from_bar", + "p_to_bar"]].values)) assert not np.any(np.isnan(net.res_sink.loc[[0, 2], "mdot_kg_per_s"].values)) assert np.all(np.isnan(net.res_sink.loc[[1, 3, 4], "mdot_kg_per_s"].values)) @@ -519,7 +496,7 @@ def test_mixed_indexing_oos2(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -537,7 +514,7 @@ def test_mixed_indexing_oos3(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -555,7 +532,7 @@ def test_mixed_indexing_oos4(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -573,7 +550,7 @@ def test_mixed_indexing_oos5(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -591,7 +568,7 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -600,22 +577,10 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) -@pytest.mark.parametrize("use_numba", [True, False]) -def test_pipeflow_cancellation(create_net_wo_external_hydraulic_grid, use_numba): - net = create_net_wo_external_hydraulic_grid - pandapipes.pipeflow(net) - assert np.all(np.isnan(net.res_junction)) - assert np.all(np.isnan(net.res_pipe)) - assert np.all(np.isnan(net.res_ext_grid)) - assert np.all(np.isnan(net.res_sink)) - assert np.all(np.isnan(net.res_source)) - assert np.all(np.isnan(net.res_compressor)) - - if __name__ == "__main__": pytest.main([r'pandapipes/test/pipeflow_internals/test_inservice.py']) From 4244569068e86f2803f76f544eafd0bbcd586f05 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 29 Sep 2023 13:33:18 +0200 Subject: [PATCH 059/126] renaming T_OUT in TOUTINIT, making test/pipeflow more stable --- .../abstract_models/branch_w_internals_models.py | 6 +++--- .../abstract_models/branch_wo_internals_models.py | 6 +++--- .../component_models/heat_exchanger_component.py | 3 ++- pandapipes/component_models/pump_component.py | 8 ++++---- pandapipes/idx_branch.py | 2 +- pandapipes/pf/derivative_calculation.py | 4 ++-- pandapipes/pf/derivative_toolbox.py | 4 ++-- pandapipes/pf/result_extraction.py | 10 +++++----- pandapipes/pipeflow.py | 10 +++++----- .../test/pipeflow_internals/test_pipeflow_modes.py | 4 ++-- 10 files changed, 29 insertions(+), 28 deletions(-) diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/pandapipes/component_models/abstract_models/branch_w_internals_models.py index c7d5c2b5c..0478254a9 100644 --- a/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -6,7 +6,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent from pandapipes.component_models.component_toolbox import set_entry_check_repeat -from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, RHO, ETA, CP, ELEMENT_IDX, T_OUT +from pandapipes.idx_branch import ACTIVE, FROM_NODE, TO_NODE, RHO, ETA, CP, ELEMENT_IDX, TOUTINIT from pandapipes.idx_node import L, node_cols, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup, get_lookup, get_table_number from pandapipes.properties.fluids import get_fluid @@ -196,8 +196,8 @@ def create_pit_branch_entries(cls, net, branch_pit): internal_pipe_number, has_internals) branch_w_internals_pit[:, FROM_NODE] = from_nodes branch_w_internals_pit[:, TO_NODE] = to_nodes - branch_w_internals_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] - tm = (node_pit[from_nodes, TINIT_NODE] + branch_w_internals_pit[:, T_OUT]) / 2 + branch_w_internals_pit[:, TOUTINIT] = node_pit[to_nodes, TINIT_NODE] + tm = (node_pit[from_nodes, TINIT_NODE] + branch_w_internals_pit[:, TOUTINIT]) / 2 fluid = get_fluid(net) branch_w_internals_pit[:, RHO] = fluid.get_density(tm) branch_w_internals_pit[:, ETA] = fluid.get_viscosity(tm) diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index b66d01567..2867c241b 100644 --- a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -4,7 +4,7 @@ from pandapipes.component_models.abstract_models.branch_models import BranchComponent -from pandapipes.idx_branch import FROM_NODE, TO_NODE, T_OUT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE +from pandapipes.idx_branch import FROM_NODE, TO_NODE, TOUTINIT, ELEMENT_IDX, RHO, ETA, CP, ACTIVE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import add_table_lookup @@ -82,8 +82,8 @@ def create_pit_branch_entries(cls, net, branch_pit): branch_wo_internals_pit[:, ELEMENT_IDX] = net[cls.table_name()].index.values branch_wo_internals_pit[:, FROM_NODE] = from_nodes branch_wo_internals_pit[:, TO_NODE] = to_nodes - branch_wo_internals_pit[:, T_OUT] = node_pit[to_nodes, TINIT_NODE] - tm = (node_pit[from_nodes, TINIT_NODE] + branch_wo_internals_pit[:, T_OUT]) / 2 + branch_wo_internals_pit[:, TOUTINIT] = node_pit[to_nodes, TINIT_NODE] + tm = (node_pit[from_nodes, TINIT_NODE] + branch_wo_internals_pit[:, TOUTINIT]) / 2 fluid = get_fluid(net) branch_wo_internals_pit[:, RHO] = fluid.get_density(tm) branch_wo_internals_pit[:, ETA] = fluid.get_viscosity(tm) diff --git a/pandapipes/component_models/heat_exchanger_component.py b/pandapipes/component_models/heat_exchanger_component.py index 3270d9db1..d958fda94 100644 --- a/pandapipes/component_models/heat_exchanger_component.py +++ b/pandapipes/component_models/heat_exchanger_component.py @@ -9,7 +9,7 @@ from pandapipes.component_models.abstract_models.branch_wzerolength_models import \ BranchWZeroLengthComponent from pandapipes.component_models.junction_component import Junction -from pandapipes.idx_branch import ALPHA, TEXT, QEXT, D, AREA, LOSS_COEFFICIENT as LC +from pandapipes.idx_branch import ALPHA, TEXT, QEXT, D, AREA, LOSS_COEFFICIENT as LC, TOUTINIT from pandapipes.pf.pipeflow_setup import get_fluid from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -58,6 +58,7 @@ def create_pit_branch_entries(cls, net, branch_pit): heat_exchanger_pit[:, ALPHA] = 0 heat_exchanger_pit[:, QEXT] = net[cls.table_name()].qext_w.values heat_exchanger_pit[:, TEXT] = 293.15 + heat_exchanger_pit[:, TOUTINIT] = 307 @classmethod def extract_results(cls, net, options, branch_results, mode): diff --git a/pandapipes/component_models/pump_component.py b/pandapipes/component_models/pump_component.py index aa7f6a34c..715332f69 100644 --- a/pandapipes/component_models/pump_component.py +++ b/pandapipes/component_models/pump_component.py @@ -12,7 +12,7 @@ from pandapipes.component_models.component_toolbox import get_component_array from pandapipes.component_models.junction_component import Junction from pandapipes.constants import NORMAL_TEMPERATURE, NORMAL_PRESSURE, R_UNIVERSAL, P_CONVERSION -from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, T_OUT, PL +from pandapipes.idx_branch import VINIT, D, AREA, LOSS_COEFFICIENT as LC, FROM_NODE, PL from pandapipes.idx_node import PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.pipeflow_setup import get_fluid, get_net_option, get_lookup from pandapipes.pf.result_extraction import extract_branch_results_without_internals @@ -109,10 +109,10 @@ def adaption_before_derivatives_hydraulic(cls, net, branch_pit, node_pit, idx_lo # consider volume flow at inlet normfactor_from = numerator_from * fluid.get_property("compressibility", p_from) \ / (p_from * NORMAL_TEMPERATURE) - v_mean = v_mps * normfactor_from + v_from = v_mps * normfactor_from else: - v_mean = v_mps - vol = v_mean * area + v_from = v_mps + vol = v_from * area if len(std_types): fcts = itemgetter(*std_types)(net['std_types']['pump']) fcts = [fcts] if not isinstance(fcts, tuple) else fcts diff --git a/pandapipes/idx_branch.py b/pandapipes/idx_branch.py index 57a08ce6c..c4e3c1632 100644 --- a/pandapipes/idx_branch.py +++ b/pandapipes/idx_branch.py @@ -32,7 +32,7 @@ JAC_DERIV_DT = 23 JAC_DERIV_DT1 = 24 LOAD_VEC_BRANCHES_T = 25 -T_OUT = 26 # Internal slot for outlet pipe temperature +TOUTINIT = 26 # Internal slot for outlet pipe temperature JAC_DERIV_DT_NODE = 27 # Slot for the derivative fpr T for the nodes connected to branch LOAD_VEC_NODES_T = 28 VINIT_T = 29 diff --git a/pandapipes/pf/derivative_calculation.py b/pandapipes/pf/derivative_calculation.py index 79f148194..7298adbd8 100644 --- a/pandapipes/pf/derivative_calculation.py +++ b/pandapipes/pf/derivative_calculation.py @@ -2,7 +2,7 @@ from pandapipes.idx_branch import LENGTH, ETA, RHO, D, K, RE, LAMBDA, LOAD_VEC_BRANCHES, \ JAC_DERIV_DV, JAC_DERIV_DP, JAC_DERIV_DP1, LOAD_VEC_NODES, JAC_DERIV_DV_NODE, VINIT, \ - FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, T_OUT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ + FROM_NODE, TO_NODE, CP, VINIT_T, FROM_NODE_T, TOUTINIT, TEXT, AREA, ALPHA, TL, QEXT, LOAD_VEC_NODES_T, \ LOAD_VEC_BRANCHES_T, JAC_DERIV_DT, JAC_DERIV_DT1, JAC_DERIV_DT_NODE from pandapipes.idx_node import TINIT as TINIT_NODE from pandapipes.properties.fluids import get_fluid @@ -80,7 +80,7 @@ def calculate_derivatives_thermal(net, branch_pit, node_pit, options): v_init = branch_pit[:, VINIT_T] from_nodes = branch_pit[:, FROM_NODE_T].astype(np.int32) t_init_i = node_pit[from_nodes, TINIT_NODE] - t_init_i1 = branch_pit[:, T_OUT] + t_init_i1 = branch_pit[:, TOUTINIT] t_amb = branch_pit[:, TEXT] area = branch_pit[:, AREA] length = branch_pit[:, LENGTH] diff --git a/pandapipes/pf/derivative_toolbox.py b/pandapipes/pf/derivative_toolbox.py index 605064639..8ee435712 100644 --- a/pandapipes/pf/derivative_toolbox.py +++ b/pandapipes/pf/derivative_toolbox.py @@ -8,7 +8,7 @@ from pandapipes.constants import P_CONVERSION, GRAVITATION_CONSTANT, NORMAL_PRESSURE, \ NORMAL_TEMPERATURE from pandapipes.idx_branch import LENGTH, LAMBDA, D, LOSS_COEFFICIENT as LC, RHO, PL, AREA, \ - VINIT, T_OUT, FROM_NODE + VINIT, TOUTINIT, FROM_NODE from pandapipes.idx_node import HEIGHT, PINIT, PAMB, TINIT as TINIT_NODE @@ -41,7 +41,7 @@ def derivatives_hydraulic_comp_np(node_pit, branch_pit, lambda_, der_lambda, p_i p_sum = p_init_i_abs + p_init_i1_abs p_sum_div = np.divide(1, p_sum) from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) - tm = (node_pit[from_nodes, TINIT_NODE] + branch_pit[:, T_OUT]) / 2 + tm = (node_pit[from_nodes, TINIT_NODE] + branch_pit[:, TOUTINIT]) / 2 const_lambda = np.divide(NORMAL_PRESSURE * branch_pit[:, RHO] * tm, NORMAL_TEMPERATURE * P_CONVERSION) const_height = np.divide( diff --git a/pandapipes/pf/result_extraction.py b/pandapipes/pf/result_extraction.py index 7bf8bf1cf..037ffc790 100644 --- a/pandapipes/pf/result_extraction.py +++ b/pandapipes/pf/result_extraction.py @@ -2,7 +2,7 @@ from pandapipes.constants import NORMAL_PRESSURE, NORMAL_TEMPERATURE from pandapipes.idx_branch import ELEMENT_IDX, FROM_NODE, TO_NODE, LOAD_VEC_NODES, VINIT, RE, \ - LAMBDA, FROM_NODE_T, TO_NODE_T, PL, T_OUT + LAMBDA, FROM_NODE_T, TO_NODE_T, PL, TOUTINIT from pandapipes.idx_node import TABLE_IDX as TABLE_IDX_NODE, PINIT, PAMB, TINIT as TINIT_NODE from pandapipes.pf.internals_toolbox import _sum_by_group from pandapipes.pf.pipeflow_setup import get_table_number, get_lookup, get_net_option @@ -78,7 +78,7 @@ def get_branch_results_gas(net, branch_pit, node_pit, from_nodes, to_nodes, v_mp fluid = get_fluid(net) t_from = node_pit[from_nodes, TINIT_NODE] - t_to = branch_pit[:, T_OUT] + t_to = branch_pit[:, TOUTINIT] tm = (t_from + t_to) / 2 numerator_from = NORMAL_PRESSURE * t_from / NORMAL_TEMPERATURE numerator_to = NORMAL_PRESSURE * t_to / NORMAL_TEMPERATURE @@ -137,7 +137,7 @@ def get_gas_vel_numba(node_pit, branch_pit, comp_from, comp_to, comp_mean, p_abs from_nodes = branch_pit[:, FROM_NODE].astype(np.int32) for i in range(len(v_mps)): t_from = node_pit[from_nodes[i], TINIT_NODE] - t_to = branch_pit[i, T_OUT] + t_to = branch_pit[i, TOUTINIT] tm = (t_from + t_to) / 2 numerator_from = np.divide(NORMAL_PRESSURE * t_from, NORMAL_TEMPERATURE) numerator_to = np.divide(NORMAL_PRESSURE * t_to, NORMAL_TEMPERATURE) @@ -283,8 +283,8 @@ def extract_results_active_pit(net, mode="hydraulics"): if i not in [not_affected_node_col]]) rows_nodes = np.arange(net["_pit"]["node"].shape[0])[nodes_connected] - result_branch_col = VINIT if mode == "hydraulics" else T_OUT - not_affected_branch_col = T_OUT if mode == "hydraulics" else VINIT + result_branch_col = VINIT if mode == "hydraulics" else TOUTINIT + not_affected_branch_col = TOUTINIT if mode == "hydraulics" else VINIT copied_branch_cols = np.array([i for i in range(net["_pit"]["branch"].shape[1]) if i not in [FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, not_affected_branch_col]]) diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 710764ef4..aa9f49947 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -7,7 +7,7 @@ from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve -from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, T_OUT, VINIT_T +from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, TOUTINIT, VINIT_T from pandapipes.idx_node import PINIT, TINIT from pandapipes.pf.build_system_matrix import build_system_matrix from pandapipes.pf.derivative_calculation import calculate_derivatives_hydraulic, calculate_derivatives_thermal @@ -278,13 +278,13 @@ def solve_temperature(net): jacobian, epsilon = build_system_matrix(net, branch_pit, node_pit, True) t_init_old = node_pit[:, TINIT].copy() - t_out_old = branch_pit[:, T_OUT].copy() + t_out_old = branch_pit[:, TOUTINIT].copy() x = spsolve(jacobian, epsilon) node_pit[:, TINIT] += x[:len(node_pit)] * options["alpha"] - branch_pit[:, T_OUT] += x[len(node_pit):] + branch_pit[:, TOUTINIT] += x[len(node_pit):] - return branch_pit[:, T_OUT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon + return branch_pit[:, TOUTINIT], t_out_old, node_pit[:, TINIT], t_init_old, epsilon def set_damping_factor(net, niter, error): @@ -318,7 +318,7 @@ def set_damping_factor(net, niter, error): def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_method, tol_1, tol_2, tol_res, vals_1_old, vals_2_old, hydraulic_mode=True): - col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, T_OUT) + col1, col2 = (PINIT, VINIT) if hydraulic_mode else (TINIT, TOUTINIT) # Control of damping factor if nonlinear_method == "automatic": diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py b/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py index f08d49397..d722711ab 100644 --- a/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py +++ b/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py @@ -94,8 +94,8 @@ def test_heat_only(use_numba): pandapipes.pipeflow(ntw, stop_condition="tol", iter=50, friction_model="nikuradse", nonlinear_method="automatic", mode="hydraulics", use_numba=use_numba) - p = ntw._pit["node"][:, 5] - v = ntw._pit["branch"][:, 11] + p = ntw._pit["node"][:, PINIT] + v = ntw._pit["branch"][:, VINIT] u = np.concatenate((p, v)) pandapipes.pipeflow(ntw, sol_vec=u, stop_condition="tol", iter=50, friction_model="nikuradse", From c0ac8a5447390eb0e2caafc1913a8a756d1e9e32 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Fri, 3 Nov 2023 09:52:38 +0100 Subject: [PATCH 060/126] made list of liquids and gases global in fluids.py --- pandapipes/properties/fluids.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandapipes/properties/fluids.py b/pandapipes/properties/fluids.py index 9721fa3cd..fd9a275aa 100644 --- a/pandapipes/properties/fluids.py +++ b/pandapipes/properties/fluids.py @@ -18,6 +18,9 @@ logger = logging.getLogger(__name__) +_LIQUIDS = ["water"] +_GASES = ["air", "lgas", "hgas", "hydrogen", "methane", "biomethane_pure", "biomethane_treated"] + class Fluid(JSONSerializableClass): """ @@ -668,17 +671,14 @@ def linear_property(prop): return FluidPropertyLinear.from_path( os.path.join(pp_dir, "properties", fluid_name, prop + ".txt")) - liquids = ["water"] - gases = ["air", "lgas", "hgas", "hydrogen", "methane", "biomethane_pure", "biomethane_treated"] - if fluid_name == "natural_gas": logger.error("'natural_gas' is ambigious. Please choose 'hgas' or 'lgas' " "(high- or low calorific natural gas)") - if fluid_name not in liquids and fluid_name not in gases: + if fluid_name not in _LIQUIDS and fluid_name not in _GASES: raise AttributeError("Fluid '%s' not found in the fluid library. It might not be " "implemented yet." % fluid_name) - phase = "liquid" if fluid_name in liquids else "gas" + phase = "liquid" if fluid_name in _LIQUIDS else "gas" density = interextra_property("density") viscosity = interextra_property("viscosity") From bab5c14f935c100c3009a16dcf46299bb6c31e11 Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Fri, 3 Nov 2023 10:42:02 +0100 Subject: [PATCH 061/126] corrections in fluid library to make call_lib pass again - adapted wrong files for new biomethane properties - added lhv and hhv with exception in case file was not found, as these properties are not absolutely necessary --- .../biomethane_pure/lower_heating_value.txt | 1 - .../biomethane_treated/compressibility.txt | 2 +- .../biomethane_treated/heat_capacity.txt | 2 +- .../lower_heating_value.txt | 1 - pandapipes/properties/fluids.py | 34 +++++++++---------- 5 files changed, 18 insertions(+), 22 deletions(-) delete mode 100644 pandapipes/properties/biomethane_pure/lower_heating_value.txt delete mode 100644 pandapipes/properties/biomethane_treated/lower_heating_value.txt diff --git a/pandapipes/properties/biomethane_pure/lower_heating_value.txt b/pandapipes/properties/biomethane_pure/lower_heating_value.txt deleted file mode 100644 index e7b41c8d4..000000000 --- a/pandapipes/properties/biomethane_pure/lower_heating_value.txt +++ /dev/null @@ -1 +0,0 @@ -# lower heating value in kWh/kg (at normal conditions) diff --git a/pandapipes/properties/biomethane_treated/compressibility.txt b/pandapipes/properties/biomethane_treated/compressibility.txt index 7ebaa69ce..dbb50a0a5 100644 --- a/pandapipes/properties/biomethane_treated/compressibility.txt +++ b/pandapipes/properties/biomethane_treated/compressibility.txt @@ -1,3 +1,3 @@ # source: linear approximation based on CoolProp (http://www.coolprop.org/) # slope in 1/bar, offset for linear property --0.0024789428559189412, 0.9962776221466679 \ No newline at end of file +-0.0024789428559189412 0.9962776221466679 \ No newline at end of file diff --git a/pandapipes/properties/biomethane_treated/heat_capacity.txt b/pandapipes/properties/biomethane_treated/heat_capacity.txt index f9f78e48d..ec06044fc 100644 --- a/pandapipes/properties/biomethane_treated/heat_capacity.txt +++ b/pandapipes/properties/biomethane_treated/heat_capacity.txt @@ -1,6 +1,6 @@ #source CoolProp (http://www.coolprop.org/) # temperature in Kelvin, isobaric heat capacity in J/(kg K) -263.151976.8823234072695 +263.15 1976.8823234072695 265.15 1980.6134982832095 267.15 1984.416050463013 269.15 1988.2894370033634 diff --git a/pandapipes/properties/biomethane_treated/lower_heating_value.txt b/pandapipes/properties/biomethane_treated/lower_heating_value.txt deleted file mode 100644 index e7b41c8d4..000000000 --- a/pandapipes/properties/biomethane_treated/lower_heating_value.txt +++ /dev/null @@ -1 +0,0 @@ -# lower heating value in kWh/kg (at normal conditions) diff --git a/pandapipes/properties/fluids.py b/pandapipes/properties/fluids.py index fd9a275aa..5d35b0f36 100644 --- a/pandapipes/properties/fluids.py +++ b/pandapipes/properties/fluids.py @@ -680,24 +680,22 @@ def linear_property(prop): phase = "liquid" if fluid_name in _LIQUIDS else "gas" - density = interextra_property("density") - viscosity = interextra_property("viscosity") - heat_capacity = interextra_property("heat_capacity") - molar_mass = constant_property("molar_mass") - der_compr = constant_property("der_compressibility") - compr = linear_property("compressibility") - - if (phase == 'gas') & (fluid_name != 'air'): - lhv = constant_property("lower_heating_value") - hhv = constant_property("higher_heating_value") - - return Fluid(fluid_name, phase, density=density, viscosity=viscosity, - heat_capacity=heat_capacity, molar_mass=molar_mass, - compressibility=compr, der_compressibility=der_compr, lhv=lhv, hhv=hhv) - else: - return Fluid(fluid_name, phase, density=density, viscosity=viscosity, - heat_capacity=heat_capacity, molar_mass=molar_mass, compressibility=compr, - der_compressibility=der_compr) + properties = dict() + properties["density"] = interextra_property("density") + properties["viscosity"] = interextra_property("viscosity") + properties["heat_capacity"] = interextra_property("heat_capacity") + properties["molar_mass"] = constant_property("molar_mass") + properties["der_compressibility"] = constant_property("der_compressibility") + properties["compressibility"] = linear_property("compressibility") + + if phase == 'gas': + for entry, name in [("lhv", "lower_heating_value"), ("hhv", "higher_heating_value")]: + try: + properties[entry] = constant_property(name) + except FileNotFoundError: + pass + + return Fluid(fluid_name, phase, **properties) def get_fluid(net): From b82f5020c1227405e0e522481e683dff321701dc Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 3 Nov 2023 15:50:26 +0100 Subject: [PATCH 062/126] take only files from pandapipes folder --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index ba1a37a33..4608f4c53 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,8 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=find_namespace_packages(), + packages=find_namespace_packages(where="pandapipes"), + package_dir={"": "pandapipes"}, include_package_data=True, classifiers=classifiers ) From 0380e4b6decb765b28819b69be1d8d3d802a99b5 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 17 Nov 2023 14:08:23 +0100 Subject: [PATCH 063/126] removing uncommented code --- pandapipes/plotting/generic_geodata.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandapipes/plotting/generic_geodata.py b/pandapipes/plotting/generic_geodata.py index d3e518892..a158651d8 100644 --- a/pandapipes/plotting/generic_geodata.py +++ b/pandapipes/plotting/generic_geodata.py @@ -50,11 +50,6 @@ def build_igraph_from_ppipes(net, junctions=None): g.vs["label"] = list(junction_index) pp_junction_mapping = dict(list(zip(junction_index, list(range(nr_junctions))))) - #mask = _get_element_mask_from_nodes(net, "pipe", ["from_junction", "to_junction"], junctions) - #for pipe in net.pipe[mask].itertuples(): - # g.add_edge(pp_junction_mapping[pipe.from_junction], pp_junction_mapping[pipe.to_junction], - # weight=pipe.length_km) - for comp in net['component_list']: if not issubclass(comp, BranchComponent): continue From b1ee8dbdc4753c7becffdc3febcaa81e5dc2146c Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 20 Nov 2023 12:26:21 +0100 Subject: [PATCH 064/126] added warning when not finding LHV / HHV in fluid lib --- pandapipes/properties/fluids.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandapipes/properties/fluids.py b/pandapipes/properties/fluids.py index 5d35b0f36..7917b2e1d 100644 --- a/pandapipes/properties/fluids.py +++ b/pandapipes/properties/fluids.py @@ -693,7 +693,10 @@ def linear_property(prop): try: properties[entry] = constant_property(name) except FileNotFoundError: - pass + logger.warning( + f"Unable to find {' '.join([n.capitalize() for n in name.split('_')])} for " + f"{fluid_name}" + ) return Fluid(fluid_name, phase, **properties) From 8a9d614ed7d4565064cbb910518f320e35fd2a6d Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 20 Nov 2023 12:48:27 +0100 Subject: [PATCH 065/126] small fixes for graph creation wrt pressure circ_pumps and for stanet converter (wrong keyword) --- pandapipes/converter/stanet/table_creation.py | 2 +- pandapipes/topology/create_graph.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandapipes/converter/stanet/table_creation.py b/pandapipes/converter/stanet/table_creation.py index 553a0c3f4..ae80a264f 100644 --- a/pandapipes/converter/stanet/table_creation.py +++ b/pandapipes/converter/stanet/table_creation.py @@ -631,7 +631,7 @@ def create_heat_exchangers_stanet(net, stored_data, index_mapping, add_layers, a # TODO: there is no qext given!!! pandapipes.create_heat_exchanger( net, node_mapping[from_stanet_nr], node_mapping[to_stanet_nr], qext_w=qext, - diameter_m=float(row.DM / 1000), loss_coefficient=row.ZETA, std_type=row.ROHRTYP, + diameter_m=float(row.DM / 1000), loss_coefficient=row.ZETA, in_service=bool(row.ISACTIVE), name="heat_exchanger_%s_%s" % (row.ANFNAM, row.ENDNAM), stanet_nr=int(row.RECNO), stanet_id=str(row.STANETID), v_stanet=row.VM, stanet_active=bool(row.ISACTIVE), **add_info diff --git a/pandapipes/topology/create_graph.py b/pandapipes/topology/create_graph.py index 529fa7f89..96b0a3132 100644 --- a/pandapipes/topology/create_graph.py +++ b/pandapipes/topology/create_graph.py @@ -113,7 +113,7 @@ def create_nxgraph(net, include_pipes=True, respect_status_pipes=True, loc = locals() branch_params.update({"%s_%s" % (par, bc): loc.get("%s_%s" % (par, bc)) for par in branch_kw for bc in ["pipes", "valves", "pumps", "press_controls", - "mass_circ_pumps", "press_circ_pumps", "valve_pipes", + "mass_circ_pumps", "pressure_circ_pumps", "valve_pipes", "flow_controls"]}) for comp in net.component_list: From c425cb6679aaf6835e314af60c7dea66c95eec1b Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 4 Dec 2023 10:47:07 +0100 Subject: [PATCH 066/126] added option to guess slider valve types; some small adaptions --- .../converter/stanet/preparing_steps.py | 47 +++-- .../converter/stanet/stanet2pandapipes.py | 8 +- pandapipes/converter/stanet/table_creation.py | 187 +++++++++++------- 3 files changed, 146 insertions(+), 96 deletions(-) diff --git a/pandapipes/converter/stanet/preparing_steps.py b/pandapipes/converter/stanet/preparing_steps.py index 0050b643a..91e8b5b5e 100644 --- a/pandapipes/converter/stanet/preparing_steps.py +++ b/pandapipes/converter/stanet/preparing_steps.py @@ -25,6 +25,28 @@ logger = logging.getLogger(__name__) +DEFAULT_STANET_KEYWORDS = { + "pipes": ['REM Leitungsdaten'], + "house_pipes": ['REM HA Leitungsdaten'], + "nodes": ['REM Knotendaten'], + "house_nodes": ["REM HA Knotendaten"], + "valves": ['REM Ventiledaten'], + "pumps_gas": ['REM Kompressorendaten'], + "pumps_water": ['REM Pumpendaten'], + "net_parameters": ['REM Netzparameterdaten'], + "houses": ["REM Hausdaten"], + "house_connections": ["REM HA Verbindungsdaten"], + "meters": ["REM HA Zählerdaten"], + "controllers": ["REM Reglerdaten"], + "slider_valves": ["REM Schieberdaten"], + "inflexion_points": ["REM Knickpunktdaten"], + "heat_exchangers": ["REM Wärmetauscherdaten"], + "customers": ["REM Abnehmerdaten"], + "house_inflexion_points": ["REM HA Knickpunktdaten"], + "layers": ["REM Layerdaten"] +} + + def get_stanet_raw_data(stanet_path, read_options=None, add_layers=True, return_line_info=False, keywords=None): """ @@ -52,24 +74,7 @@ def get_stanet_raw_data(stanet_path, read_options=None, add_layers=True, return_ # 4th line: STANET internal header of table (this is the first line to convert to pandas # dataframe and return to the converter) # everything until the next empty line will be added to the dataframe - keywords = {"pipes": ['REM Leitungsdaten'], - "house_pipes": ['REM HA Leitungsdaten'], - "nodes": ['REM Knotendaten'], - "house_nodes": ["REM HA Knotendaten"], - "valves": ['REM Ventiledaten'], - "pumps_gas": ['REM Kompressorendaten'], - "pumps_water": ['REM Pumpendaten'], - "net_parameters": ['REM Netzparameterdaten'], - "houses": ["REM Hausdaten"], - "house_connections": ["REM HA Verbindungsdaten"], - "meters": ["REM HA Zählerdaten"], - "controllers": ["REM Reglerdaten"], - "slider_valves": ["REM Schieberdaten"], - "inflexion_points": ["REM Knickpunktdaten"], - "heat_exchangers": ["REM Wärmetauscherdaten"], - "customers": ["REM Abnehmerdaten"], - "house_inflexion_points": ["REM HA Knickpunktdaten"], - "layers": ["REM Layerdaten"]} + keywords = DEFAULT_STANET_KEYWORDS stored_data = dict() logger.info("Reading STANET csv-file.") @@ -230,9 +235,9 @@ def adapt_pipe_data_according_to_nodes(pipe_data, pipes_to_check, node_geo, pipe coord = "x" if is_x else "y" locat = "from" if is_start else "to" run = 0 if is_x else 2 - run += 0 if is_start else 1 + run += 1 - int(is_start) pipe_name = coord_names[run] - node_nr = node_cols[0] if is_start else node_cols[1] + node_nr = node_cols[1 - int(is_start)] node_val = node_geo.loc[pipe_data.loc[pipes_to_check, node_nr].values, node_name].values if pipe_name not in pipe_data.columns: @@ -273,7 +278,7 @@ def adapt_pipe_data(stored_data, pipe_data, coord_names, use_clients): # the following code is just a check whether pipe and node geodata fit together # in case of deviations, the pipe geodata is adapted on the basis of the node geodata - pipe_rec = pipe_data.RECNO.values + pipe_rec = pipe_data.index.values for is_x, is_start in product([True, False], [True, False]): current_index_range = indices[0] if is_start else indices[1] current_pipe_nums = pipe_rec[current_index_range.values] diff --git a/pandapipes/converter/stanet/stanet2pandapipes.py b/pandapipes/converter/stanet/stanet2pandapipes.py index a0a4f6875..ed644f9f9 100644 --- a/pandapipes/converter/stanet/stanet2pandapipes.py +++ b/pandapipes/converter/stanet/stanet2pandapipes.py @@ -31,7 +31,8 @@ # - maybe it will be necessary to remove deleted data from the STANET tables, otherwise they # might be inserted into the pandapipes net erroneously def stanet_to_pandapipes(stanet_path, name="net", remove_unused_household_connections=True, - stanet_like_valves=False, read_options=None, add_layers=True, **kwargs): + stanet_like_valves=False, read_options=None, add_layers=True, + guess_slider_valve_types=False, **kwargs): """Converts STANET csv-file to pandapipesNet. :param stanet_path: path to csv-file exported from STANET @@ -50,6 +51,9 @@ def stanet_to_pandapipes(stanet_path, name="net", remove_unused_household_connec :param add_layers: If True, adds information on layers of different components if provided by \ STANET :type add_layers: bool, default True + :param guess_slider_valve_types: If set to True, the slider valve status (opened / closed) is \ + guessed based on the logic "even number = opened; odd number = closed". + :type guess_slider_valve_types: bool, default False :return: net :rtype: pandapipesNet """ @@ -99,7 +103,7 @@ def stanet_to_pandapipes(stanet_path, name="net", remove_unused_household_connec # pandapipes create_valve_and_pipe(net, stored_data, index_mapping, net_params, stanet_like_valves, add_layers) - create_slider_valves(net, stored_data, index_mapping, add_layers) + create_slider_valves(net, stored_data, index_mapping, add_layers, guess_slider_valve_types) if "pumps_water" in stored_data: create_pumps(net, stored_data['pumps_water'], index_mapping, add_layers) diff --git a/pandapipes/converter/stanet/table_creation.py b/pandapipes/converter/stanet/table_creation.py index 553a0c3f4..ab974d142 100644 --- a/pandapipes/converter/stanet/table_creation.py +++ b/pandapipes/converter/stanet/table_creation.py @@ -65,8 +65,9 @@ def create_junctions_from_nodes(net, stored_data, net_params, index_mapping, add add_info = {"stanet_id": node_table.STANETID.astype(str).values if "STANETID" in node_table.columns else knams, "p_stanet": node_table.PRECH.values.astype(np.float64), - "stanet_valid": ~node_table.CALCBAD.values.astype(np.bool_), - "t_stanet": node_table.TEMP.values.astype(np.float64)} + "stanet_valid": ~node_table.CALCBAD.values.astype(np.bool_)} + if "TEMP" in node_table.columns: + add_info["t_stanet"] = node_table.TEMP.values.astype(np.float64) if hasattr(node_table, "KFAK"): add_info["K_stanet"] = node_table.KFAK.values.astype(np.float64) if add_layers: @@ -173,62 +174,88 @@ def create_valve_and_pipe(net, stored_data, index_mapping, net_params, stanet_li ) -def create_slider_valves(net, stored_data, index_mapping, add_layers): +def create_slider_valves(net, stored_data, index_mapping, add_layers, + guess_opened_from_types=False): """ Creates pandapipes slider valves from STANET data. - :param net: - :type net: - :param stored_data: - :type stored_data: - :param index_mapping: - :type index_mapping: - :param add_layers: - :type add_layers: - :return: - :rtype: + + :param net: pandapipes net to which to add slider valves + :type net: pandapipesNet + :param stored_data: dictionary of STANET element tables + :type stored_data: dict + :param index_mapping: dictionary of mappings between STANET and pandapipes indices + :type index_mapping: dict + :param add_layers: if True, the layer info will be added to the slider valve table + :type add_layers: bool + :param guess_opened_from_types: if True, the status of slider valves with unknown types is \ + guessed based on the logic "even type number = opened, odd type number = closed" + :type guess_opened_from_types: bool, default False + :return: No output + :rtype: None """ - if "slider_valves" not in stored_data: + if "slider_valves" not in stored_data and "house_slider_valves" not in stored_data: return logger.info("Creating all slider valves.") - slider_valves = stored_data["slider_valves"] - - # identify all junctions that are connected on each side of the slider valves - svf = index_mapping["slider_valves_from"] - svt = index_mapping["slider_valves_to"] - from_junctions = np.array([svf[sv] for sv in slider_valves.RECNO.values]) - to_junctions = np.array([svt[sv] for sv in slider_valves.RECNO.values]) - - # these types can be converted to normal valves - # --> there are many types of slider valves in STANET, the behavior is not always clear, so - # if you want to convert another type, identify the correct valve behavior in pandapipes - # that matches this type. - opened_sv = [2, 6, 10, 18] - closed_sv = [3, 7, 11, 19] - opened_types = {o: True for o in opened_sv} - opened_types.update({c: False for c in closed_sv}) - sv_types = set(slider_valves.TYP.values.astype(np.int32)) - if len(sv_types - set(opened_types.keys())): - raise UserWarning("The slider valve types %s cannot be converted." - % (sv_types - set(opened_types.keys()))) - - # create all slider valves --> most important are the opened and loss_coefficient entries - valve_system = slider_valves.CLIENTTYP.replace(CLIENT_TYPES_OF_PIPES).values - add_info = dict() - if add_layers: - add_info["stanet_layer"] = slider_valves.LAYER.values.astype(str) - # account for sliders with diameter 0 m - if any(slider_valves.DM == 0): - logger.warning(f"{sum(slider_valves.DM == 0)} sliders have a inner diameter of 0 m! " - f"The diameter will be set to 1 m.") - slider_valves.DM[slider_valves.DM == 0] = 1e3 - pandapipes.create_valves( - net, from_junctions, to_junctions, slider_valves.DM.values / 1000, - opened=slider_valves.TYP.astype(np.int32).replace(opened_types).values, - loss_coefficient=slider_valves.ZETA.values, name=slider_valves.STANETID.values, - type="slider_valve_" + valve_system, stanet_nr=slider_valves.RECNO.values.astype(np.int32), - stanet_id=slider_valves.STANETID.values.astype(str), stanet_system=valve_system, - stanet_active=slider_valves.ISACTIVE.values.astype(np.bool_), **add_info - ) + + for tbl_name in ("slider_valves", "house_slider_valves"): + if tbl_name not in stored_data: + continue + slider_valves = stored_data[tbl_name] + + # identify all junctions that are connected on each side of the slider valves + svf = index_mapping["slider_valves_from"] + svt = index_mapping["slider_valves_to"] + from_junctions = np.array([svf[sv] for sv in slider_valves.RECNO.values]) + to_junctions = np.array([svt[sv] for sv in slider_valves.RECNO.values]) + + # these types can be converted to normal valves + # --> there are many types of slider valves in STANET, the behavior is not always clear, so + # if you want to convert another type, identify the correct valve behavior in pandapipes + # that matches this type. + opened_sv = [2, 6, 10, 18] + closed_sv = [3, 7, 11, 19] + # TODO: Is it possible that there is always a "CONNECTED" column and it says whether the + # valve is opened or closed? Maybe the type is only used for graphical purpose. + opened_types = {o: True for o in opened_sv} + opened_types.update({c: False for c in closed_sv}) + sv_types = set(slider_valves.TYP.values.astype(np.int32)) + if len(sv_types - set(opened_types.keys())): + if guess_opened_from_types: + logger.warning( + "The slider valve types %s are not (yet) known. Their status (opened/closed) " + "will be guessed based on the logic: even number = opened, odd number = closed." + % (sv_types - set(opened_types.keys())) + ) + opened_types.update( + {t: bool(t % 2 + 1) for t in sv_types - set(opened_types.keys())} + ) + else: + raise UserWarning("The slider valve types %s cannot be converted." + % (sv_types - set(opened_types.keys()))) + + # create all slider valves --> most important are the opened and loss_coefficient entries + valve_system = slider_valves.CLIENTTYP.replace(CLIENT_TYPES_OF_PIPES).values + add_info = dict() + if add_layers: + add_info["stanet_layer"] = slider_valves.LAYER.values.astype(str) + # account for sliders with diameter 0 m + if "DM" not in slider_valves.columns: + logger.warning(f"The table {tbl_name} does not contain the slider valve inner diameter!" + f"The diameter will be set to 1 m.") + slider_valves["DM"] = 1e3 + if any(slider_valves.DM == 0): + logger.warning(f"{sum(slider_valves.DM == 0)} sliders have an inner diameter of 0 m! " + f"The diameter will be set to 1 m.") + slider_valves.DM[slider_valves.DM == 0] = 1e3 + pandapipes.create_valves( + net, from_junctions, to_junctions, slider_valves.DM.values / 1000, + opened=slider_valves.TYP.astype(np.int32).replace(opened_types).values, + loss_coefficient=slider_valves.ZETA.values, name=slider_valves.STANETID.values, + type="slider_valve_" + valve_system, + stanet_nr=slider_valves.RECNO.values.astype(np.int32), + stanet_id=slider_valves.STANETID.values.astype(str), stanet_system=valve_system, + stanet_active=slider_valves.ISACTIVE.values.astype(np.bool_), **add_info + ) # noinspection PyTypeChecker @@ -317,7 +344,7 @@ def create_control_components(net, stored_data, index_mapping, net_params, add_l control_active = (control_table.AKTIV.values == "J").astype(np.bool_) if consider_controlled: - control_active &= fully_open + control_active &= ~fully_open in_service = control_table.ISACTIVE.values.astype(np.bool_) if consider_controlled: in_service &= ~(control_table.ZU.values == "J") @@ -398,7 +425,7 @@ def get_connection_types(connection_table): :return: :rtype: """ - extend_from_to = ["slider_valves"] + extend_from_to = ["slider_valves", "house_slider_valves"] connection_types = list(chain.from_iterable([ [(ct, ct)] if ct not in extend_from_to else [(ct, ct + "_from"), (ct, ct + "_to")] for ct in set(connection_table.type) @@ -432,6 +459,8 @@ def create_junctions_from_connections(net, connection_table, net_params, index_m extend_from_to, connection_types = get_connection_types(connection_table) for con_type, node_type in connection_types: cons = connection_table.loc[connection_table.type == con_type] + if cons.empty: + continue stanet_ids = cons.STANETID.astype(str).values stanet_nrs = cons.RECNO.astype(np.int32).values p_stanet = cons.PRECH.astype(np.float64).values if houses_in_calculation else np.NaN @@ -566,11 +595,14 @@ def create_geodata_sections(row): text_k = 293 if "TU" in pipes.columns: text_k = pipes.TU.values.astype(np.float64) + 273.15 + alpha = 0 + if "WDZAHL" in pipes.columns: + alpha = pipes.WDZAHL.values.astype(np.float64) pandapipes.create_pipes_from_parameters( net, pipe_sections.fj.values, pipe_sections.tj.values, pipe_sections.length.values / 1000, pipes.DM.values / 1000, pipes.RAU.values, pipes.ZETA.values, type="main_pipe", stanet_std_type=pipes.ROHRTYP.values, in_service=pipes.ISACTIVE.values, text_k=text_k, - alpha_w_per_m2k=pipes.WDZAHL.values.astype(np.float64), + alpha_w_per_m2k=alpha, name=["pipe_%s_%s_%s" % (nf, nt, sec) for nf, nt, sec in zip( pipes.ANFNAM.values, pipes.ENDNAM.values, pipe_sections.section_no.values)], stanet_nr=pipes.RECNO.values, stanet_id=pipes.STANETID.values, @@ -694,14 +726,16 @@ def create_pipes_from_remaining_pipe_table(net, stored_data, connection_table, i text_k = 293 if "TU" in p_tbl.columns: text_k = p_tbl.TU.values.astype(np.float64) + 273.15 + alpha = 0 + if "WDZAHL" in p_tbl.columns: + alpha = p_tbl.WDZAHL.values.astype(np.float64) pandapipes.create_pipes_from_parameters( net, from_junctions, to_junctions, length_km=p_tbl.RORL.values.astype(np.float64) / 1000, type="main_pipe", diameter_m=p_tbl.DM.values.astype(np.float64) / 1000, loss_coefficient=p_tbl.ZETA.values, stanet_std_type=p_tbl.ROHRTYP.values, k_mm=p_tbl.RAU.values, in_service=p_tbl.ISACTIVE.values.astype(np.bool_), - alpha_w_per_m2k=p_tbl.WDZAHL.values.astype(np.float64), text_k=text_k, name=["pipe_%s_%s" % (anf, end) for anf, end in zip(from_names[valid], to_names[valid])], - stanet_nr=p_tbl.RECNO.values.astype(np.int32), + alpha_w_per_m2k=alpha, text_k=text_k, stanet_nr=p_tbl.RECNO.values.astype(np.int32), stanet_id=p_tbl.STANETID.values.astype(str), v_stanet=p_tbl.VM.values, geodata=geodata, stanet_system=CLIENT_TYPES_OF_PIPES[MAIN_PIPE_TYPE], stanet_active=p_tbl.ISACTIVE.values.astype(np.bool_), @@ -710,7 +744,8 @@ def create_pipes_from_remaining_pipe_table(net, stored_data, connection_table, i ) -def check_connection_client_types(hh_pipes, all_client_types, node_client_types): +def check_connection_client_types(hh_pipes, all_client_types, node_client_types, + fail_on_connection_check=True): # create pipes for household connections (from house to supply pipe), which is a separate table # in the STANET CSV file # --> there are many ways how household connections can be created in STANET, @@ -725,16 +760,20 @@ def check_connection_client_types(hh_pipes, all_client_types, node_client_types) clientnodetype = hh_pipes.CLIENTTYP.isin(node_client_types) client2nodetype = hh_pipes.CLIENT2TYP.isin(node_client_types) if not np.all(clientnodetype | client2nodetype): - raise UserWarning( - f"One of the household connection sides must be connected to a node (type {NODE_TYPE} element)\n" - f"or a connection (type {HOUSE_CONNECTION_TYPE} element with ID CON...) " - f"or a house node (type {HOUSE_CONNECTION_TYPE} element). \n" - f"Please check that the input data is correct. \n" - f"Check these CLIENTTYP / CLIENT2TYP: " - f"{set(hh_pipes.loc[~clientnodetype, 'CLIENTTYP'].values) | set(hh_pipes.loc[~client2nodetype, 'CLIENT2TYP'].values)} " - f"in the HA LEI table (max. 10 entries shown): \n " - f"{hh_pipes.loc[~clientnodetype & ~client2nodetype].head(10)}" - ) + not_node_type = (set(hh_pipes.loc[~clientnodetype, 'CLIENTTYP'].values) + | set(hh_pipes.loc[~client2nodetype, 'CLIENT2TYP'].values)) + msg = (f"One of the household connection sides must be connected to a node (type " + f"{NODE_TYPE} element)\n or a connection (type {HOUSE_CONNECTION_TYPE} element with" + f" ID CON...) or a house node (type {HOUSE_CONNECTION_TYPE} element). \n" + f"Please check that the input data is correct. \n" + f"Check these CLIENTTYP / CLIENT2TYP: " + f"{not_node_type} in the HA LEI table (max. 10 entries shown): \n" + f"{hh_pipes.loc[~clientnodetype & ~client2nodetype].head(10)}") + if fail_on_connection_check: + raise UserWarning(msg) + else: + logger.warning(f"{msg} \nWill ignore this error and continue net setup, please check " + f"your network configuration carefully!") return clientnodetype, client2nodetype @@ -1009,16 +1048,18 @@ def create_geodata_sections(row): text_k = 293 if "TU" in hp_data.columns: text_k = hp_data.TU.values.astype(np.float64) + 273.15 + alpha = 0 + if "WDZAHL" in hp_data.columns: + alpha = hp_data.WDZAHL.values.astype(np.float64) pandapipes.create_pipes_from_parameters( net, hp_data.fj.values, hp_data.tj.values, hp_data.length.values / 1000, hp_data.DM.values / 1000, hp_data.RAU.values, hp_data.ZETA.values, type="house_pipe", - stanet_std_type=hp_data.ROHRTYP.values, in_service=hp_data.ISACTIVE.values if houses_in_calculation else False, text_k=text_k, - alpha_w_per_m2k=hp_data.WDZAHL.values.astype(np.float64), + alpha_w_per_m2k=alpha, geodata=hp_data.section_geo.values, name=["pipe_%s_%s_%s" % (nf, nt, sec) for nf, nt, sec in zip( hp_data.CLIENTID.values, hp_data.CLIENT2ID.values, hp_data.section_no.values)], - stanet_nr=hp_data.RECNO.values, stanet_id=hp_data.STANETID.values, - geodata=hp_data.section_geo.values, v_stanet=hp_data.VM.values, + stanet_std_type=hp_data.ROHRTYP.values, stanet_nr=hp_data.RECNO.values, + stanet_id=hp_data.STANETID.values, v_stanet=hp_data.VM.values, stanet_active=hp_data.ISACTIVE.values.astype(np.bool_), stanet_valid=houses_in_calculation, **add_info ) From ba81ca0f66bed51a49d2476e6167a0ab1aea047a Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Mon, 4 Dec 2023 10:53:06 +0100 Subject: [PATCH 067/126] removed trailing whitespace --- pandapipes/converter/stanet/table_creation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandapipes/converter/stanet/table_creation.py b/pandapipes/converter/stanet/table_creation.py index ae80a264f..1192cf279 100644 --- a/pandapipes/converter/stanet/table_creation.py +++ b/pandapipes/converter/stanet/table_creation.py @@ -631,7 +631,7 @@ def create_heat_exchangers_stanet(net, stored_data, index_mapping, add_layers, a # TODO: there is no qext given!!! pandapipes.create_heat_exchanger( net, node_mapping[from_stanet_nr], node_mapping[to_stanet_nr], qext_w=qext, - diameter_m=float(row.DM / 1000), loss_coefficient=row.ZETA, + diameter_m=float(row.DM / 1000), loss_coefficient=row.ZETA, in_service=bool(row.ISACTIVE), name="heat_exchanger_%s_%s" % (row.ANFNAM, row.ENDNAM), stanet_nr=int(row.RECNO), stanet_id=str(row.STANETID), v_stanet=row.VM, stanet_active=bool(row.ISACTIVE), **add_info From 1468b489fc00375bdd0e3be2b0d736cf96483b61 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Mon, 11 Dec 2023 15:47:24 +0100 Subject: [PATCH 068/126] remove changes as part of seperate PR --- pandapipes/test/pipeflow_internals/test_inservice.py | 4 ++-- setup.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index bec68b475..54acfaf78 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -237,8 +237,8 @@ def test_connectivity_hydraulic(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[[1, 2, 3], :].values)) assert not np.any(np.isnan(net.res_junction.loc[[0, 1, 3, 4], :].values)) assert not np.any(np.isnan(net.res_pipe.loc[[0, 4], - ["v_mean_m_per_s", "p_from_bar", - "p_to_bar"]].values)) + ["v_mean_m_per_s", "p_from_bar", + "p_to_bar"]].values)) assert not np.any(np.isnan(net.res_sink.loc[[0, 2], "mdot_kg_per_s"].values)) assert np.all(np.isnan(net.res_sink.loc[[1, 3, 4], "mdot_kg_per_s"].values)) diff --git a/setup.py b/setup.py index 4608f4c53..4c22eda53 100644 --- a/setup.py +++ b/setup.py @@ -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. -from setuptools import find_namespace_packages +from setuptools import find_packages from setuptools import setup import re @@ -49,8 +49,7 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=find_namespace_packages(where="pandapipes"), - package_dir={"": "pandapipes"}, + packages=find_packages(), include_package_data=True, classifiers=classifiers ) From ebaa13fdbbd35de43a228c80f94480ea65b7b850 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Mon, 11 Dec 2023 15:51:13 +0100 Subject: [PATCH 069/126] already considered in different PR --- CHANGELOG.rst | 1 - pandapipes/multinet/create_multinet.py | 2 + .../timeseries/run_time_series_multinet.py | 1 + pandapipes/pf/pipeflow_setup.py | 1 - pandapipes/pipeflow.py | 17 ++---- .../test/pipeflow_internals/test_inservice.py | 57 ++++--------------- 6 files changed, 19 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e9f952c5c..58ff9bc6f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,7 +5,6 @@ Change Log ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) -- [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables diff --git a/pandapipes/multinet/create_multinet.py b/pandapipes/multinet/create_multinet.py index cd74dce9f..4a5352a5c 100644 --- a/pandapipes/multinet/create_multinet.py +++ b/pandapipes/multinet/create_multinet.py @@ -12,6 +12,8 @@ import logging logger = logging.getLogger(__name__) +logger.setLevel(level=logging.WARNING) + def create_empty_multinet(name=""): """ diff --git a/pandapipes/multinet/timeseries/run_time_series_multinet.py b/pandapipes/multinet/timeseries/run_time_series_multinet.py index 1d829c75d..7394a7780 100644 --- a/pandapipes/multinet/timeseries/run_time_series_multinet.py +++ b/pandapipes/multinet/timeseries/run_time_series_multinet.py @@ -19,6 +19,7 @@ import logging as pplog logger = pplog.getLogger(__name__) +logger.setLevel(level=pplog.WARNING) def _call_output_writer(multinet, time_step, pf_converged, ctrl_converged, ts_variables): diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index eb63f5f6d..713f05be8 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -498,7 +498,6 @@ def identify_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): mode = "hydraulics" if hydraulic else "heat_transfer" net["_lookups"]["node_active_" + mode] = nodes_connected net["_lookups"]["branch_active_" + mode] = branches_connected - return node_pit[nodes_connected], branch_pit[branches_connected] def branches_connected_flow(branch_pit): diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 19d16d9ca..aa9f49947 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -4,6 +4,7 @@ import numpy as np from numpy import linalg +from pandapower.auxiliary import ppException from scipy.sparse.linalg import spsolve from pandapipes.idx_branch import FROM_NODE, TO_NODE, FROM_NODE_T, TO_NODE_T, VINIT, TOUTINIT, VINIT_T @@ -15,7 +16,6 @@ initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ identify_active_nodes_branches from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit -from pandapower.auxiliary import ppException try: import pandaplan.core.pplog as logging @@ -70,22 +70,15 @@ def pipeflow(net, sol_vec=None, **kwargs): create_lookups(net) node_pit, branch_pit = initialize_pit(net) - if len(node_pit) == 0: - logger.warning("There are no nodes defined. " - "You need at least one node! " - "Without any nodes, you are not able to conduct a pipeflow!") + if (len(node_pit) == 0) & (len(branch_pit) == 0): + logger.warning("There are no node and branch entries defined. This might mean that your net" + " is empty") return - calculation_mode = get_net_option(net, "mode") calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - active_node_pit, active_branch_pit = identify_active_nodes_branches(net, branch_pit, node_pit) - - if (len(active_node_pit) == 0): - logger.warning(" All nodes are out of service. Probably they are not supplied." - " Have you forgotten to define an external grid?") - return + identify_active_nodes_branches(net, branch_pit, node_pit) if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index bec68b475..1db306804 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -9,8 +9,8 @@ import pandapipes from pandapipes.pf.pipeflow_setup import get_lookup -from pandapipes.pipeflow import PipeflowNotConverged from pandapipes.pipeflow import logger as pf_logger +from pandapipes.pipeflow import PipeflowNotConverged try: import pandaplan.core.pplog as logging @@ -125,29 +125,6 @@ def create_mixed_indexing_grid(): return net -@pytest.fixture -def create_net_wo_external_hydraulic_grid(): - net = pandapipes.create_empty_network("net", add_stdtypes=False) - pandapipes.create_fluid_from_lib(net, "hgas", overwrite=True) - pandapipes.create_junction(net, index=3, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 3", in_service=True, - type="junction", geodata=(0, 0)) - pandapipes.create_junction(net, index=9, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 9", in_service=True, - type="junction", geodata=(1, 0)) - pandapipes.create_junction(net, index=10, pn_bar=16, tfluid_k=283, height_m=0, - name="Junction 10", in_service=True, - type="junction", geodata=(2, 0)) - pandapipes.create_pipe_from_parameters(net, 9, 10, length_km=1, diameter_m=0.03, k_mm=.1, sections=10, - alpha_w_per_m2k=1, name="Pipe 6") - pandapipes.create_sink(net, 9, mdot_kg_per_s=0.01, name="Sink 3") - pandapipes.create_source(net, junction=10, mdot_kg_per_s=0.04, name="Source 3") - pandapipes.create_compressor(net, from_junction=9, to_junction=3, pressure_ratio=1.1, - name="Compressor 0", index=None, in_service=True) - pandapipes.create_ext_grid(net, junction=3, t_k=300) - return net - - @pytest.mark.parametrize("use_numba", [True, False]) def test_inservice_gas(create_test_net, use_numba): """ @@ -169,7 +146,7 @@ def test_inservice_gas(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not np.any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -202,7 +179,7 @@ def test_inservice_water(create_test_net, use_numba): assert np.all(np.isnan(net.res_junction.p_bar.loc[~net.junction.in_service].values)) oos_sinks = np.isin(net.sink.junction.values, net.junction.index[~net.junction.in_service]) \ - | ~net.sink.in_service.values + | ~net.sink.in_service.values assert np.all(np.isnan(net.res_sink.loc[oos_sinks, :].values)) assert not any(np.isnan(net.res_pipe.v_mean_m_per_s.loc[net.pipe.in_service].values)) @@ -237,8 +214,8 @@ def test_connectivity_hydraulic(create_test_net, use_numba): assert np.all(np.isnan(net.res_pipe.loc[[1, 2, 3], :].values)) assert not np.any(np.isnan(net.res_junction.loc[[0, 1, 3, 4], :].values)) assert not np.any(np.isnan(net.res_pipe.loc[[0, 4], - ["v_mean_m_per_s", "p_from_bar", - "p_to_bar"]].values)) + ["v_mean_m_per_s", "p_from_bar", + "p_to_bar"]].values)) assert not np.any(np.isnan(net.res_sink.loc[[0, 2], "mdot_kg_per_s"].values)) assert np.all(np.isnan(net.res_sink.loc[[1, 3, 4], "mdot_kg_per_s"].values)) @@ -519,7 +496,7 @@ def test_mixed_indexing_oos2(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -537,7 +514,7 @@ def test_mixed_indexing_oos3(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -555,7 +532,7 @@ def test_mixed_indexing_oos4(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -573,7 +550,7 @@ def test_mixed_indexing_oos5(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -591,7 +568,7 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) @@ -600,22 +577,10 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): assert all(np.all(net["res_" + tbl].loc[~oos_func(net, tbl, oos_juncs)].notnull()) for tbl, oos_func in all_tbls_funcs.items()) assert all(np.all(net["res_" + tbl].loc[oos_func(net, tbl, oos_juncs), - get_col_slice_null(tbl)].isnull()) + get_col_slice_null(tbl)].isnull()) for tbl, oos_func in all_tbls_funcs.items()) assert check_mass_flows(net) -@pytest.mark.parametrize("use_numba", [True, False]) -def test_pipeflow_cancellation(create_net_wo_external_hydraulic_grid, use_numba): - net = create_net_wo_external_hydraulic_grid - pandapipes.pipeflow(net) - assert np.all(np.isnan(net.res_junction)) - assert np.all(np.isnan(net.res_pipe)) - assert np.all(np.isnan(net.res_ext_grid)) - assert np.all(np.isnan(net.res_sink)) - assert np.all(np.isnan(net.res_source)) - assert np.all(np.isnan(net.res_compressor)) - - if __name__ == "__main__": pytest.main([r'pandapipes/test/pipeflow_internals/test_inservice.py']) From e501c158c32294ab129635018667466f223ddca9 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 11:55:29 +0100 Subject: [PATCH 070/126] adding a __init__.py to the repo --- __init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 000000000..e69de29bb From 17315e1d30b405189f0707269d059cd8fa047b36 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 11:58:12 +0100 Subject: [PATCH 071/126] might solve the problem --- .github/workflows/run_tests_develop.yml | 2 +- __init__.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 __init__.py diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index a172d407a..06a3de885 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,7 +101,7 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + pip install -e . - name: List all installed packages run: | pip list diff --git a/__init__.py b/__init__.py deleted file mode 100644 index e69de29bb..000000000 From e5a9571e9cd47cb19108b6a962a84b68975c7493 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 12:31:58 +0100 Subject: [PATCH 072/126] bug check --- setup.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4608f4c53..358d62406 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,9 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=find_namespace_packages(where="pandapipes"), - package_dir={"": "pandapipes"}, + #packages=find_namespace_packages(where="pandapipes"), + #package_dir={"": "pandapipes"}, + packages=find_namespace_packages(), include_package_data=True, classifiers=classifiers ) From 0fa38f139a69e2781a6eed6b974ff8a57d802014 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 14:11:35 +0100 Subject: [PATCH 073/126] upgrade setuptools due to bug --- .github/workflows/run_tests_develop.yml | 1 + setup.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 06a3de885..0fc69b8a6 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,6 +101,7 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 --upgrade setuptools pip install -e . - name: List all installed packages run: | diff --git a/setup.py b/setup.py index 358d62406..4608f4c53 100644 --- a/setup.py +++ b/setup.py @@ -49,9 +49,8 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - #packages=find_namespace_packages(where="pandapipes"), - #package_dir={"": "pandapipes"}, - packages=find_namespace_packages(), + packages=find_namespace_packages(where="pandapipes"), + package_dir={"": "pandapipes"}, include_package_data=True, classifiers=classifiers ) From 086f87731bd084a39a5c466f13a13ef74a8e92c7 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 14:15:25 +0100 Subject: [PATCH 074/126] check for bugfix --- .github/workflows/run_tests_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 0fc69b8a6..7924f63b2 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -108,7 +108,7 @@ jobs: pip list - name: Test with pytest run: | - pytest --nbmake -n=auto "./tutorials" + python -m pytest --nbmake -n=auto "./tutorials" docs_check: runs-on: ubuntu-latest From ac372c48b992e268db6f703456620a0bb89f6f4d Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 14:40:31 +0100 Subject: [PATCH 075/126] removing upgrade setuptools --- .github/workflows/run_tests_develop.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 7924f63b2..a3bb4f6d0 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,7 +101,6 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 --upgrade setuptools pip install -e . - name: List all installed packages run: | From cb124274c0a443b54c4b98b3cab0c7b78b62e901 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:20:42 +0100 Subject: [PATCH 076/126] pip install with pip install . --- .github/workflows/run_tests_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index a3bb4f6d0..985bd23ee 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,7 +101,7 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 -e . + pip install . - name: List all installed packages run: | pip list From 92b04ce6dbed8a8010065e1596d07fbc1849a416 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:23:23 +0100 Subject: [PATCH 077/126] trying with python -m pip install . --- .github/workflows/run_tests_develop.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 985bd23ee..fb0e4a4d0 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,7 +101,8 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + python -m pip install . + - name: List all installed packages run: | pip list From f56fa14ca580dbdbe0225a74b525c8b6fa63c85c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:25:54 +0100 Subject: [PATCH 078/126] trying to upgrade jupyter --- .github/workflows/run_tests_develop.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index fb0e4a4d0..d6a78ee09 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -96,12 +96,13 @@ jobs: 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 igraph + pip install --upgrade pip + pip install pytest nbmake pytest-xdist pytest-split igraph if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower + pip install --upgrade jupyter + pip install . - name: List all installed packages run: | From 5b17399ab08c0e0de52629d046f7b90c1fb50db2 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:37:56 +0100 Subject: [PATCH 079/126] trying to solve problem with python -m --- .github/workflows/run_tests_develop.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index d6a78ee09..fb0e4a4d0 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -96,13 +96,12 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - pip install --upgrade pip - pip install pytest nbmake pytest-xdist pytest-split igraph + python -m pip install --upgrade pip + python -m pip install pytest nbmake pytest-xdist pytest-split igraph if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower - pip install --upgrade jupyter - pip install . + python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower + python -m pip install . - name: List all installed packages run: | From d75caad2805ccda836656a68f52a912ee6ffe816 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:43:12 +0100 Subject: [PATCH 080/126] install jupyter --- .github/workflows/run_tests_develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index fb0e4a4d0..ab53ed7ab 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,6 +101,7 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 jupyter python -m pip install . - name: List all installed packages From 521d38a72d0b76bbf2b38a44b6009fde373ba2e0 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:50:51 +0100 Subject: [PATCH 081/126] install pytest-pythonpath --- .github/workflows/run_tests_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index ab53ed7ab..fb5d204f5 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -97,7 +97,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest nbmake pytest-xdist pytest-split igraph + python -m pip install pytest nbmake pytest-xdist pytest-split igraph pytest-pythonpath if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower From 6df52d4b30723981c0e1687781bb5126dfd90660 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 20:53:42 +0100 Subject: [PATCH 082/126] upgrade setuptools --- .github/workflows/run_tests_develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index fb5d204f5..b8a18ac9a 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -102,6 +102,7 @@ jobs: 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 jupyter + python -m pip install --upgrade setuptools python -m pip install . - name: List all installed packages From cdc5f8df4b5d57a9cd5d07fcda249d700ad08acd Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:06:51 +0100 Subject: [PATCH 083/126] upgrade pytest --- .github/workflows/run_tests_develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index b8a18ac9a..f71a4283d 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -103,6 +103,7 @@ jobs: python -m pip install git+https://github.com/e2nIEE/pandapower@develop#egg=pandapower python -m pip install jupyter python -m pip install --upgrade setuptools + python -m pip install --upgrade pytest python -m pip install . - name: List all installed packages From ba5828ebce8b14ed7eb84281f78c9a23c5fad491 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:22:13 +0100 Subject: [PATCH 084/126] further packages installed --- .github/workflows/run_tests_develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index f71a4283d..7ae405bfe 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -104,6 +104,7 @@ jobs: python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest + python -m pip install atomicwrites colorama pywinpty pywin32 python -m pip install . - name: List all installed packages From eba1c19404825653c76b80d7158ac1c368301b12 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:26:02 +0100 Subject: [PATCH 085/126] further packages installed --- .github/workflows/run_tests_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 7ae405bfe..2cc2094e2 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -104,7 +104,7 @@ jobs: python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest - python -m pip install atomicwrites colorama pywinpty pywin32 + python -m pip install atomicwrites colorama python -m pip install . - name: List all installed packages From 380d39a40edd49bcdf6d8f1c394c2f7881796078 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:41:49 +0100 Subject: [PATCH 086/126] uninstall certain packages --- .github/workflows/run_tests_develop.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 2cc2094e2..8c19b9f1e 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -101,12 +101,12 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest python -m pip install atomicwrites colorama - python -m pip install . - + python -m pip uninstall pexpect ptyprocess - name: List all installed packages run: | pip list From 8becbb9da781f9fea24ae8b61a8912cc0151ed09 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:46:47 +0100 Subject: [PATCH 087/126] downgrade packages --- .github/workflows/run_tests_develop.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 8c19b9f1e..476149a52 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -105,8 +105,9 @@ jobs: python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest - python -m pip install atomicwrites colorama - python -m pip uninstall pexpect ptyprocess + python -m pip install prompt-toolkit==3.0.41 + python -m pip install Babel==2.13.1 + - name: List all installed packages run: | pip list From 3c8db9bd93a743b6b3f879d52f42e04958ef2612 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:50:47 +0100 Subject: [PATCH 088/126] install further packages --- .github/workflows/run_tests_develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 476149a52..2036fa936 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -105,6 +105,7 @@ jobs: python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest + python -m pip install atomicwrites colorama python -m pip install prompt-toolkit==3.0.41 python -m pip install Babel==2.13.1 From 26b65a3e8c73dddb2226e05034afb35eb386a53a Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 21:58:39 +0100 Subject: [PATCH 089/126] install ipython --- .github/workflows/run_tests_develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 2036fa936..2294cbce6 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -105,7 +105,7 @@ jobs: python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest - python -m pip install atomicwrites colorama + python -m pip install atomicwrites colorama ipython python -m pip install prompt-toolkit==3.0.41 python -m pip install Babel==2.13.1 From f7e9b7cce291ceb024ba7061b5fc85baa2b1e7e1 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 12 Dec 2023 22:07:11 +0100 Subject: [PATCH 090/126] adding a pytest.ini --- pandapipes/pytest.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pandapipes/pytest.ini diff --git a/pandapipes/pytest.ini b/pandapipes/pytest.ini new file mode 100644 index 000000000..1134c8c6f --- /dev/null +++ b/pandapipes/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +pythonpath = . .. pandapipes \ No newline at end of file From c39e1bdd853b714747414e345c68c4590a5edb17 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 10:22:30 +0100 Subject: [PATCH 091/126] add pandapipes. in front of namespace folder paths --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4608f4c53..9557f6d80 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,7 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=find_namespace_packages(where="pandapipes"), - package_dir={"": "pandapipes"}, + packages= ['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")], include_package_data=True, classifiers=classifiers ) From 278e850659a34d81e706a6f73d2c46d29aeea976 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 10:35:15 +0100 Subject: [PATCH 092/126] calling pythonpath and sys path --- .github/workflows/run_tests_develop.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 2294cbce6..1bbb6326d 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -112,6 +112,12 @@ jobs: - name: List all installed packages run: | pip list + - name: Get PYTHONPATH + run: | + echo $PYTHONPATH + - name: Get sys path + run: | + python -c "import sys; print(sys.path)" - name: Test with pytest run: | python -m pytest --nbmake -n=auto "./tutorials" From c9824573fe054e4021351a972c4f24e4786b4afb Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 10:56:27 +0100 Subject: [PATCH 093/126] call pandapipes packages --- .github/workflows/run_tests_develop.yml | 3 +++ pandapipes/pytest.ini | 2 -- setup.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 pandapipes/pytest.ini diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 1bbb6326d..bbc09f9e3 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -118,6 +118,9 @@ jobs: - name: Get sys path run: | python -c "import sys; print(sys.path)" + - name: List pandapipes packages + run: | + python -c "import sys; import os; from setuptools import find_packages; print(find_packages(where=os.path.join([p for p in sys.path if p.endswith('site-packages')][0], 'pandapipes')))" - name: Test with pytest run: | python -m pytest --nbmake -n=auto "./tutorials" diff --git a/pandapipes/pytest.ini b/pandapipes/pytest.ini deleted file mode 100644 index 1134c8c6f..000000000 --- a/pandapipes/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -pythonpath = . .. pandapipes \ No newline at end of file diff --git a/setup.py b/setup.py index 9557f6d80..c08f3c9e3 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,8 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages= ['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")], + packages= find_namespace_packages(where="pandapipes"), + package_dir={"": "pandapipes"}, include_package_data=True, classifiers=classifiers ) From 047332d5c337d16daac77617c7d6e7a5ce414652 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:13:43 +0100 Subject: [PATCH 094/126] uninstall pytest-pythonpath --- .github/workflows/run_tests_develop.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index bbc09f9e3..e3bcb5d63 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -97,15 +97,16 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest nbmake pytest-xdist pytest-split igraph pytest-pythonpath + python -m pip install pytest nbmake pytest-xdist pytest-split igraph if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + python -m pip uninstall pytest-pythonpath python -m pip install jupyter python -m pip install --upgrade setuptools python -m pip install --upgrade pytest - python -m pip install atomicwrites colorama ipython + python -m pip install atomicwrites colorama ipython pytest-pythonpath python -m pip install prompt-toolkit==3.0.41 python -m pip install Babel==2.13.1 From 3dc066692701a89673b4c86f9cc4afdf2bc58dd2 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:18:00 +0100 Subject: [PATCH 095/126] add a pytest.ini --- pandapipes/pytest.ini | 3 +++ tutorials/pytest.ini | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 pandapipes/pytest.ini create mode 100644 tutorials/pytest.ini diff --git a/pandapipes/pytest.ini b/pandapipes/pytest.ini new file mode 100644 index 000000000..a01d26adf --- /dev/null +++ b/pandapipes/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +python_paths = . .. +site_dirs = . .. \ No newline at end of file diff --git a/tutorials/pytest.ini b/tutorials/pytest.ini new file mode 100644 index 000000000..a01d26adf --- /dev/null +++ b/tutorials/pytest.ini @@ -0,0 +1,3 @@ +[pytest] +python_paths = . .. +site_dirs = . .. \ No newline at end of file From 89909515ea7073ef337dc216fc72b0e85791d96c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:22:13 +0100 Subject: [PATCH 096/126] add pytest.ini and adapt setup.py --- pandapipes/pytest.ini => pytest.ini | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename pandapipes/pytest.ini => pytest.ini (100%) diff --git a/pandapipes/pytest.ini b/pytest.ini similarity index 100% rename from pandapipes/pytest.ini rename to pytest.ini From bfe67fe8252cee6c9f78c7919295dc5e7076d359 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:22:19 +0100 Subject: [PATCH 097/126] add pytest.ini and adapt setup.py --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c08f3c9e3..8937708dc 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,7 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages= find_namespace_packages(where="pandapipes"), - package_dir={"": "pandapipes"}, + packages= ['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")] + ['pandapipes'], include_package_data=True, classifiers=classifiers ) From 9dfe30b50823979e47cc75fedbe1127a0fafd7d7 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:25:54 +0100 Subject: [PATCH 098/126] first try only with pytest.ini --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 8937708dc..c08f3c9e3 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,8 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages= ['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")] + ['pandapipes'], + packages= find_namespace_packages(where="pandapipes"), + package_dir={"": "pandapipes"}, include_package_data=True, classifiers=classifiers ) From 968495a04ab8ba2e46c534ac020fcab4a6efe125 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 13:41:51 +0100 Subject: [PATCH 099/126] solution to problem --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c08f3c9e3..9e8d009f0 100644 --- a/setup.py +++ b/setup.py @@ -49,8 +49,7 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages= find_namespace_packages(where="pandapipes"), - package_dir={"": "pandapipes"}, + packages=['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")]+ ['pandapipes'], include_package_data=True, classifiers=classifiers ) From 0cbeaa90ecb294556369bd139d61e68b07d4afc0 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 14:06:01 +0100 Subject: [PATCH 100/126] move everything in src folder --- .github/workflows/run_tests_develop.yml | 17 ----------------- setup.py | 3 ++- {pandapipes => src/pandapipes}/__init__.py | 0 .../pandapipes}/component_models/__init__.py | 0 .../abstract_models/__init__.py | 0 .../abstract_models/base_component.py | 0 .../abstract_models/branch_models.py | 0 .../branch_w_internals_models.py | 0 .../branch_wo_internals_models.py | 0 .../branch_wzerolength_models.py | 0 .../abstract_models/circulation_pump.py | 0 .../abstract_models/const_flow_models.py | 0 .../abstract_models/node_element_models.py | 0 .../abstract_models/node_models.py | 0 .../circulation_pump_mass_component.py | 0 .../circulation_pump_pressure_component.py | 0 .../component_models/component_toolbox.py | 0 .../component_models/compressor_component.py | 0 .../component_models/ext_grid_component.py | 0 .../component_models/flow_control_component.py | 0 .../heat_exchanger_component.py | 0 .../component_models/junction_component.py | 0 .../component_models/mass_storage_component.py | 0 .../component_models/pipe_component.py | 0 .../pressure_control_component.py | 0 .../component_models/pump_component.py | 0 .../component_models/sink_component.py | 0 .../component_models/source_component.py | 0 .../component_models/valve_component.py | 0 {pandapipes => src/pandapipes}/constants.py | 0 .../pandapipes}/control/__init__.py | 0 .../pandapipes}/control/run_control.py | 0 .../pandapipes}/converter/__init__.py | 0 .../pandapipes}/converter/stanet/__init__.py | 0 .../converter/stanet/data_cleaning.py | 0 .../converter/stanet/preparing_steps.py | 0 .../converter/stanet/stanet2pandapipes.py | 0 .../converter/stanet/table_creation.py | 0 .../stanet/valve_pipe_component/__init__.py | 0 .../valve_pipe_component/create_valve_pipe.py | 0 .../valve_pipe_component.py | 0 .../valve_pipe_component/valve_pipe_plotting.py | 0 {pandapipes => src/pandapipes}/create.py | 0 {pandapipes => src/pandapipes}/idx_branch.py | 0 {pandapipes => src/pandapipes}/idx_node.py | 0 {pandapipes => src/pandapipes}/io/__init__.py | 0 .../pandapipes}/io/convert_format.py | 0 {pandapipes => src/pandapipes}/io/file_io.py | 0 {pandapipes => src/pandapipes}/io/io_utils.py | 0 .../pandapipes}/multinet/__init__.py | 0 .../pandapipes}/multinet/control/__init__.py | 0 .../multinet/control/controller/__init__.py | 0 .../control/controller/multinet_control.py | 0 .../multinet/control/run_control_multinet.py | 0 .../pandapipes}/multinet/create_multinet.py | 0 .../pandapipes}/multinet/multinet.py | 0 .../pandapipes}/multinet/timeseries/__init__.py | 0 .../timeseries/run_time_series_multinet.py | 0 .../pandapipes}/networks/__init__.py | 0 .../gas_net_schutterwald_1bar.json | 0 .../heat_transfer_cases/delta.json | 0 .../heat_transfer_cases/delta_2sinks.json | 0 .../heat_transfer_cases/heights.json | 0 .../heat_transfer_cases/one_pipe.json | 0 .../heat_transfer_cases/one_source.json | 0 .../heat_transfer_cases/section_variation.json | 0 .../heat_transfer_cases/t_cross.json | 0 .../heat_transfer_cases/two_pipes.json | 0 .../combined_networks/mixed_net.json | 0 .../combined_networks/versatility.json | 0 .../meshed_networks/delta.json | 0 .../meshed_networks/heights.json | 0 .../meshed_networks/pumps.json | 0 .../meshed_networks/two_valves.json | 0 .../water_cases_colebrook/one_pipe/pipe_1.json | 0 .../water_cases_colebrook/one_pipe/pipe_2.json | 0 .../water_cases_colebrook/one_pipe/pipe_3.json | 0 .../strand_net/cross_3ext.json | 0 .../strand_net/strand_net.json | 0 .../strand_net/two_pipes.json | 0 .../strand_net/two_pumps.json | 0 .../water_cases_colebrook/t_cross/t_cross.json | 0 .../water_cases_colebrook/t_cross/valves.json | 0 .../two_pressure_junctions/two_pipes.json | 0 .../combined_networks/mixed_net.json | 0 .../combined_networks/versatility.json | 0 .../meshed_networks/delta.json | 0 .../meshed_networks/heights.json | 0 .../meshed_networks/one_valve_stanet.json | 0 .../meshed_networks/pumps.json | 0 .../meshed_networks/two_valves.json | 0 .../one_pipe/pipe_1.json | 0 .../one_pipe/pipe_2.json | 0 .../one_pipe/pipe_3.json | 0 .../strand_net/cross_3ext.json | 0 .../strand_net/strand_net.json | 0 .../strand_net_stanet_variation1.json | 0 .../strand_net_stanet_variation2.json | 0 .../strand_net/two_pipes.json | 0 .../strand_net/two_pumps.json | 0 .../t_cross/t_cross.json | 0 .../water_cases_swamee-jain/t_cross/valves.json | 0 .../two_pressure_junctions/one_pipe_stanet.json | 0 .../two_pressure_junctions/two_pipes.json | 0 .../1-LV-rural1--0-no_sw.json | 0 .../1-LV-rural1--0-sw.json | 0 .../1-LV-rural2--0-no_sw.json | 0 .../1-LV-rural2--0-sw.json | 0 .../1-LV-rural3--0-no_sw.json | 0 .../1-LV-rural3--0-sw.json | 0 .../1-LV-semiurb4--0-no_sw.json | 0 .../1-LV-semiurb4--0-sw.json | 0 .../1-LV-semiurb5--0-no_sw.json | 0 .../1-LV-semiurb5--0-sw.json | 0 .../1-LV-urban6--0-no_sw.json | 0 .../1-LV-urban6--0-sw.json | 0 .../gas_cases/combined_networks/parallel_N.json | 0 .../combined_networks/parallel_PC.json | 0 .../combined_networks/versatility_PC.json | 0 .../gas_cases/meshed_networks/delta_PC.json | 0 .../gas_cases/meshed_networks/pumps_N.json | 0 .../gas_cases/meshed_networks/square_N.json | 0 .../gas_cases/meshed_networks/square_PC.json | 0 .../gas_cases/meshed_networks/two_valves_N.json | 0 .../meshed_networks/two_valves_PC.json | 0 .../gas_cases/one_pipe/pipe_1_N.json | 0 .../gas_cases/one_pipe/pipe_1_PC.json | 0 .../gas_cases/one_pipe/pipe_2_N.json | 0 .../gas_cases/one_pipe/pipe_2_PC.json | 0 .../gas_cases/strand_net/pump_N.json | 0 .../gas_cases/strand_net/two_pipes_N.json | 0 .../gas_cases/strand_net/two_pipes_PC.json | 0 .../gas_cases/t_cross/t_cross1_N.json | 0 .../gas_cases/t_cross/t_cross1_PC.json | 0 .../gas_cases/t_cross/t_cross2_N.json | 0 .../gas_cases/t_cross/t_cross2_PC.json | 0 .../two_pressure_junctions/H_net_N.json | 0 .../two_pressure_junctions/H_net_PC.json | 0 .../combined_networks/district_N.json | 0 .../combined_networks/district_PC.json | 0 .../combined_networks/versatility_N.json | 0 .../combined_networks/versatility_PC.json | 0 .../water_cases/meshed_networks/delta_N.json | 0 .../water_cases/meshed_networks/pumps_N.json | 0 .../meshed_networks/two_valves_N.json | 0 .../meshed_networks/two_valves_PC.json | 0 .../water_cases/one_pipe/pipe_1_N.json | 0 .../water_cases/one_pipe/pipe_1_PC.json | 0 .../water_cases/one_pipe/pipe_2_N.json | 0 .../water_cases/one_pipe/pipe_2_PC.json | 0 .../water_cases/one_pipe/pipe_3_N.json | 0 .../water_cases/one_pipe/pipe_3_PC.json | 0 .../water_cases/strand_net/cross_PC.json | 0 .../water_cases/strand_net/pump_N.json | 0 .../water_cases/strand_net/strand_net_N.json | 0 .../water_cases/strand_net/strand_net_PC.json | 0 .../water_cases/strand_net/two_pipes_N.json | 0 .../water_cases/strand_net/two_pipes_PC.json | 0 .../water_cases/t_cross/t_cross_N.json | 0 .../water_cases/t_cross/t_cross_PC.json | 0 .../two_pressure_junctions/two_pipes_N.json | 0 .../two_pressure_junctions/two_pipes_PC.json | 0 .../pandapipes}/networks/nw_aux.py | 0 .../pandapipes}/networks/simple_gas_networks.py | 0 .../networks/simple_heat_transfer_networks.py | 0 .../networks/simple_water_networks.py | 0 .../pandapipes}/pandapipes_net.py | 0 {pandapipes => src/pandapipes}/pf/__init__.py | 0 .../pandapipes}/pf/build_system_matrix.py | 0 .../pandapipes}/pf/derivative_calculation.py | 0 .../pandapipes}/pf/derivative_toolbox.py | 0 .../pandapipes}/pf/derivative_toolbox_numba.py | 0 .../pandapipes}/pf/internals_toolbox.py | 0 .../pandapipes}/pf/pipeflow_setup.py | 0 .../pandapipes}/pf/result_extraction.py | 0 {pandapipes => src/pandapipes}/pipeflow.py | 0 .../pandapipes}/plotting/__init__.py | 0 .../pandapipes}/plotting/collections.py | 0 .../pandapipes}/plotting/generic_geodata.py | 0 {pandapipes => src/pandapipes}/plotting/geo.py | 0 .../pandapipes}/plotting/patch_makers.py | 0 .../pandapipes}/plotting/pipeflow_results.py | 0 .../pandapipes}/plotting/plotting_toolbox.py | 0 .../pandapipes}/plotting/simple_plot.py | 0 .../pandapipes}/properties/__init__.py | 0 .../properties/air/compressibility.txt | 0 .../pandapipes}/properties/air/density.txt | 0 .../properties/air/der_compressibility.txt | 0 .../properties/air/heat_capacity.txt | 0 .../pandapipes}/properties/air/molar_mass.txt | 0 .../pandapipes}/properties/air/viscosity.txt | 0 .../biomethane_pure/compressibility.txt | 0 .../properties/biomethane_pure/density.txt | 0 .../biomethane_pure/der_compressibility.txt | 0 .../biomethane_pure/gas_composition.txt | 0 .../biomethane_pure/heat_capacity.txt | 0 .../biomethane_pure/higher_heating_value.txt | 0 .../biomethane_pure/lower_heating_value.txt | 0 .../properties/biomethane_pure/molar_mass.txt | 0 .../properties/biomethane_pure/viscosity.txt | 0 .../biomethane_treated/compressibility.txt | 0 .../properties/biomethane_treated/density.txt | 0 .../biomethane_treated/der_compressibility.txt | 0 .../biomethane_treated/gas_composition.txt | 0 .../biomethane_treated/heat_capacity.txt | 0 .../biomethane_treated/higher_heating_value.txt | 0 .../biomethane_treated/lower_heating_value.txt | 0 .../biomethane_treated/molar_mass.txt | 0 .../properties/biomethane_treated/viscosity.txt | 0 .../properties/carbondioxide/density.txt | 0 .../properties/carbondioxide/heat_capacity.txt | 0 .../properties/carbondioxide/molar_mass.txt | 0 .../properties/carbondioxide/viscosity.txt | 0 .../pandapipes}/properties/ethane/density.txt | 0 .../properties/ethane/heat_capacity.txt | 0 .../properties/ethane/molar_mass.txt | 0 .../pandapipes}/properties/ethane/viscosity.txt | 0 .../pandapipes}/properties/fluids.py | 0 .../properties/hgas/compressibility.txt | 0 .../pandapipes}/properties/hgas/density.txt | 0 .../properties/hgas/der_compressibility.txt | 0 .../properties/hgas/heat_capacity.txt | 0 .../properties/hgas/higher_heating_value.txt | 0 .../properties/hgas/lower_heating_value.txt | 0 .../pandapipes}/properties/hgas/molar_mass.txt | 0 .../pandapipes}/properties/hgas/viscosity.txt | 0 .../properties/hydrogen/compressibility.txt | 0 .../pandapipes}/properties/hydrogen/density.txt | 0 .../properties/hydrogen/der_compressibility.txt | 0 .../properties/hydrogen/heat_capacity.txt | 0 .../hydrogen/higher_heating_value.txt | 0 .../properties/hydrogen/lower_heating_value.txt | 0 .../properties/hydrogen/molar_mass.txt | 0 .../properties/hydrogen/viscosity.txt | 0 .../properties/lgas/compressibility.txt | 0 .../pandapipes}/properties/lgas/density.txt | 0 .../properties/lgas/der_compressibility.txt | 0 .../properties/lgas/heat_capacity.txt | 0 .../properties/lgas/higher_heating_value.txt | 0 .../properties/lgas/lower_heating_value.txt | 0 .../pandapipes}/properties/lgas/molar_mass.txt | 0 .../pandapipes}/properties/lgas/viscosity.txt | 0 .../properties/methane/compressibility.txt | 0 .../pandapipes}/properties/methane/density.txt | 0 .../properties/methane/der_compressibility.txt | 0 .../properties/methane/heat_capacity.txt | 0 .../properties/methane/higher_heating_value.txt | 0 .../properties/methane/lower_heating_value.txt | 0 .../properties/methane/molar_mass.txt | 0 .../properties/methane/viscosity.txt | 0 .../pandapipes}/properties/nitrogen/density.txt | 0 .../properties/nitrogen/heat_capacity.txt | 0 .../properties/nitrogen/molar_mass.txt | 0 .../properties/nitrogen/viscosity.txt | 0 .../pandapipes}/properties/oxygen/density.txt | 0 .../properties/oxygen/heat_capacity.txt | 0 .../properties/oxygen/molar_mass.txt | 0 .../pandapipes}/properties/oxygen/viscosity.txt | 0 .../properties/properties_toolbox.py | 0 .../properties/water/compressibility.txt | 0 .../pandapipes}/properties/water/density.txt | 0 .../properties/water/der_compressibility.txt | 0 .../properties/water/heat_capacity.txt | 0 .../pandapipes}/properties/water/molar_mass.txt | 0 .../pandapipes}/properties/water/viscosity.txt | 0 .../pandapipes}/std_types/__init__.py | 0 .../pandapipes}/std_types/library/Pipe.csv | 0 .../pandapipes}/std_types/library/Pump/P1.csv | 0 .../pandapipes}/std_types/library/Pump/P2.csv | 0 .../pandapipes}/std_types/library/Pump/P3.csv | 0 .../pandapipes}/std_types/std_type_class.py | 0 .../pandapipes}/std_types/std_types.py | 0 {pandapipes => src/pandapipes}/test/__init__.py | 0 .../pandapipes}/test/api/__init__.py | 0 .../test/api/old_versions/example_0.1.0.json | 0 .../test/api/old_versions/example_0.1.1.json | 0 .../test/api/old_versions/example_0.1.2.json | 0 .../test/api/old_versions/example_0.2.0.json | 0 .../test/api/old_versions/example_0.4.0.json | 0 .../test/api/old_versions/example_0.5.0.json | 0 .../test/api/old_versions/example_0.6.0.json | 0 .../test/api/old_versions/example_0.7.0.json | 0 .../api/old_versions/example_0.8.0_gas.json | 0 .../api/old_versions/example_0.8.0_water.json | 0 .../api/old_versions/example_0.8.1_gas.json | 0 .../api/old_versions/example_0.8.1_water.json | 0 .../api/old_versions/example_0.8.2_gas.json | 0 .../api/old_versions/example_0.8.2_water.json | 0 .../api/old_versions/example_0.8.3_gas.json | 0 .../api/old_versions/example_0.8.3_water.json | 0 .../api/old_versions/example_0.8.4_gas.json | 0 .../api/old_versions/example_0.8.4_water.json | 0 .../api/old_versions/example_0.8.5_gas.json | 0 .../api/old_versions/example_0.8.5_water.json | 0 .../release_control_test_network.py | 0 .../release_control_test_sink_profiles.csv | 0 .../release_control_test_source_profiles.csv | 0 .../pandapipes}/test/api/test_aux_function.py | 0 .../test/api/test_components/__init__.py | 0 .../api/test_components/test_circ_pump_mass.py | 0 .../test_components/test_circ_pump_pressure.py | 0 .../test/api/test_components/test_compressor.py | 0 .../test/api/test_components/test_ext_grid.py | 0 .../api/test_components/test_flow_control.py | 0 .../api/test_components/test_heat_exchanger.py | 0 .../api/test_components/test_mass_storage.py | 0 .../api/test_components/test_pipe_results.py | 0 .../test_components/test_pressure_control.py | 0 .../test/api/test_components/test_pump.py | 0 .../test/api/test_components/test_valve.py | 0 .../pandapipes}/test/api/test_convert_format.py | 0 .../pandapipes}/test/api/test_create.py | 0 .../pandapipes}/test/api/test_network_tables.py | 0 .../test/api/test_special_networks.py | 0 .../pandapipes}/test/api/test_std_types.py | 0 .../pandapipes}/test/api/test_time_series.py | 0 .../pandapipes}/test/converter/__init__.py | 0 .../converter_test_files/Exampelonia_mini.csv | 0 .../Exampelonia_mini_with_2valvepipe.csv | 0 ...mpelonia_mini_with_valve_2sliders_closed.csv | 0 ...xampelonia_mini_with_valve_2sliders_open.csv | 0 .../test/converter/test_stanet_converter.py | 0 .../pandapipes}/test/io/__init__.py | 0 .../pandapipes}/test/io/test_file_io.py | 0 .../pandapipes}/test/multinet/__init__.py | 0 .../test/multinet/test_control_multinet.py | 0 .../test/multinet/test_time_series_multinet.py | 0 .../pandapipes}/test/networks/__init__.py | 0 .../pandapipes}/test/networks/test_networks.py | 0 .../test/openmodelica_comparison/__init__.py | 0 .../pipeflow_openmodelica_comparison.py | 0 .../test_heat_transfer_openmodelica.py | 0 .../test_water_openmodelica.py | 0 .../test/pipeflow_internals/__init__.py | 0 .../data/Temperature_2zu_2ab_an.csv | 0 .../data/Temperature_masche_1load_an.csv | 0 .../Temperature_masche_1load_direction_an.csv | 0 .../data/Temperature_one_pipe_an.csv | 0 .../data/Temperature_tee_2ab_1zu_an.csv | 0 .../data/Temperature_tee_2zu_1ab_an.csv | 0 .../test/pipeflow_internals/data/ext_grid_p.csv | 0 .../pipeflow_internals/data/gas_sections_an.csv | 0 .../data/heat_exchanger_test.csv | 0 .../test/pipeflow_internals/data/hydraulics.csv | 0 .../data/pressure_control_test_analytical.csv | 0 .../data/test_circ_pump_mass.csv | 0 .../data/test_circ_pump_pressure.csv | 0 .../data/test_pressure_control.csv | 0 .../test/pipeflow_internals/data/test_pump.csv | 0 .../res_ext_grid/mdot_kg_per_s.csv | 0 .../res_junction/p_bar.csv | 0 .../res_pipe/lambda.csv | 0 .../res_pipe/reynolds.csv | 0 .../res_pipe/v_mean_m_per_s.csv | 0 .../res_sink/mdot_kg_per_s.csv | 0 .../res_source/mdot_kg_per_s.csv | 0 .../data/test_time_series_sink_profiles.csv | 0 .../data/test_time_series_source_profiles.csv | 0 .../test/pipeflow_internals/data/test_valve.csv | 0 .../test/pipeflow_internals/test_inservice.py | 0 .../pipeflow_internals/test_non_convergence.py | 0 .../test/pipeflow_internals/test_options.py | 0 .../test_pipeflow_analytic_comparison.py | 0 .../pipeflow_internals/test_pipeflow_modes.py | 0 .../test/pipeflow_internals/test_time_series.py | 0 .../pipeflow_internals/test_update_matrix.py | 0 .../pandapipes}/test/plotting/__init__.py | 0 .../test/plotting/test_collections.py | 0 .../test/plotting/test_generic_coordinates.py | 0 .../test/plotting/test_pipeflow_results.py | 0 .../test/plotting/test_simple_collections.py | 0 .../pandapipes}/test/properties/__init__.py | 0 .../test/properties/test_fluid_specials.py | 0 .../test/properties/test_properties_toolbox.py | 0 {pandapipes => src/pandapipes}/test/pytest.ini | 0 .../pandapipes}/test/run_tests.py | 0 .../test/stanet_comparison/__init__.py | 0 .../pipeflow_stanet_comparison.py | 0 .../test/stanet_comparison/test_gas_stanet.py | 0 .../test/stanet_comparison/test_water_stanet.py | 0 .../pandapipes}/test/test_imports.py | 0 .../pandapipes}/test/test_toolbox.py | 0 .../pandapipes}/test/topology/__init__.py | 0 .../test/topology/test_graph_searches.py | 0 .../pandapipes}/test/topology/test_nxgraph.py | 0 .../pandapipes}/timeseries/__init__.py | 0 .../pandapipes}/timeseries/run_time_series.py | 0 {pandapipes => src/pandapipes}/toolbox.py | 0 .../pandapipes}/topology/__init__.py | 0 .../pandapipes}/topology/create_graph.py | 0 .../pandapipes}/topology/graph_searches.py | 0 391 files changed, 2 insertions(+), 18 deletions(-) rename {pandapipes => src/pandapipes}/__init__.py (100%) rename {pandapipes => src/pandapipes}/component_models/__init__.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/__init__.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/base_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/branch_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/branch_w_internals_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/branch_wo_internals_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/branch_wzerolength_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/circulation_pump.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/const_flow_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/node_element_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/abstract_models/node_models.py (100%) rename {pandapipes => src/pandapipes}/component_models/circulation_pump_mass_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/circulation_pump_pressure_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/component_toolbox.py (100%) rename {pandapipes => src/pandapipes}/component_models/compressor_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/ext_grid_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/flow_control_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/heat_exchanger_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/junction_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/mass_storage_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/pipe_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/pressure_control_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/pump_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/sink_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/source_component.py (100%) rename {pandapipes => src/pandapipes}/component_models/valve_component.py (100%) rename {pandapipes => src/pandapipes}/constants.py (100%) rename {pandapipes => src/pandapipes}/control/__init__.py (100%) rename {pandapipes => src/pandapipes}/control/run_control.py (100%) rename {pandapipes => src/pandapipes}/converter/__init__.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/__init__.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/data_cleaning.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/preparing_steps.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/stanet2pandapipes.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/table_creation.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/valve_pipe_component/__init__.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/valve_pipe_component/create_valve_pipe.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/valve_pipe_component/valve_pipe_component.py (100%) rename {pandapipes => src/pandapipes}/converter/stanet/valve_pipe_component/valve_pipe_plotting.py (100%) rename {pandapipes => src/pandapipes}/create.py (100%) rename {pandapipes => src/pandapipes}/idx_branch.py (100%) rename {pandapipes => src/pandapipes}/idx_node.py (100%) rename {pandapipes => src/pandapipes}/io/__init__.py (100%) rename {pandapipes => src/pandapipes}/io/convert_format.py (100%) rename {pandapipes => src/pandapipes}/io/file_io.py (100%) rename {pandapipes => src/pandapipes}/io/io_utils.py (100%) rename {pandapipes => src/pandapipes}/multinet/__init__.py (100%) rename {pandapipes => src/pandapipes}/multinet/control/__init__.py (100%) rename {pandapipes => src/pandapipes}/multinet/control/controller/__init__.py (100%) rename {pandapipes => src/pandapipes}/multinet/control/controller/multinet_control.py (100%) rename {pandapipes => src/pandapipes}/multinet/control/run_control_multinet.py (100%) rename {pandapipes => src/pandapipes}/multinet/create_multinet.py (100%) rename {pandapipes => src/pandapipes}/multinet/multinet.py (100%) rename {pandapipes => src/pandapipes}/multinet/timeseries/__init__.py (100%) rename {pandapipes => src/pandapipes}/multinet/timeseries/run_time_series_multinet.py (100%) rename {pandapipes => src/pandapipes}/networks/__init__.py (100%) rename {pandapipes => src/pandapipes}/networks/network_files/gas_net_schutterwald_1bar.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta_2sinks.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/heights.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_pipe.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_source.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/section_variation.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/t_cross.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/heat_transfer_cases/two_pipes.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/mixed_net.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/versatility.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/delta.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/heights.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/pumps.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/two_valves.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_1.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_2.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_3.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/cross_3ext.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/strand_net.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pipes.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pumps.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/t_cross.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/valves.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_colebrook/two_pressure_junctions/two_pipes.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/mixed_net.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/versatility.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/delta.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/heights.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/one_valve_stanet.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/pumps.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/two_valves.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_1.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_2.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_3.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/cross_3ext.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation1.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation2.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pipes.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pumps.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/t_cross.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/valves.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/one_pipe_stanet.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/two_pipes.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural1--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural1--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural2--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural2--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural3--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-rural3--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-urban6--0-no_sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/simbench_test_networks/1-LV-urban6--0-sw.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/combined_networks/versatility_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/delta_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/pumps_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/strand_net/pump_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/meshed_networks/delta_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/meshed_networks/pumps_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/cross_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/pump_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_N.json (100%) rename {pandapipes => src/pandapipes}/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_PC.json (100%) rename {pandapipes => src/pandapipes}/networks/nw_aux.py (100%) rename {pandapipes => src/pandapipes}/networks/simple_gas_networks.py (100%) rename {pandapipes => src/pandapipes}/networks/simple_heat_transfer_networks.py (100%) rename {pandapipes => src/pandapipes}/networks/simple_water_networks.py (100%) rename {pandapipes => src/pandapipes}/pandapipes_net.py (100%) rename {pandapipes => src/pandapipes}/pf/__init__.py (100%) rename {pandapipes => src/pandapipes}/pf/build_system_matrix.py (100%) rename {pandapipes => src/pandapipes}/pf/derivative_calculation.py (100%) rename {pandapipes => src/pandapipes}/pf/derivative_toolbox.py (100%) rename {pandapipes => src/pandapipes}/pf/derivative_toolbox_numba.py (100%) rename {pandapipes => src/pandapipes}/pf/internals_toolbox.py (100%) rename {pandapipes => src/pandapipes}/pf/pipeflow_setup.py (100%) rename {pandapipes => src/pandapipes}/pf/result_extraction.py (100%) rename {pandapipes => src/pandapipes}/pipeflow.py (100%) rename {pandapipes => src/pandapipes}/plotting/__init__.py (100%) rename {pandapipes => src/pandapipes}/plotting/collections.py (100%) rename {pandapipes => src/pandapipes}/plotting/generic_geodata.py (100%) rename {pandapipes => src/pandapipes}/plotting/geo.py (100%) rename {pandapipes => src/pandapipes}/plotting/patch_makers.py (100%) rename {pandapipes => src/pandapipes}/plotting/pipeflow_results.py (100%) rename {pandapipes => src/pandapipes}/plotting/plotting_toolbox.py (100%) rename {pandapipes => src/pandapipes}/plotting/simple_plot.py (100%) rename {pandapipes => src/pandapipes}/properties/__init__.py (100%) rename {pandapipes => src/pandapipes}/properties/air/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/air/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/air/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/air/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/air/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/air/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/gas_composition.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_pure/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/gas_composition.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/biomethane_treated/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/carbondioxide/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/carbondioxide/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/carbondioxide/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/carbondioxide/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/ethane/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/ethane/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/ethane/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/ethane/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/fluids.py (100%) rename {pandapipes => src/pandapipes}/properties/hgas/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/hgas/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/hydrogen/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/lgas/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/higher_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/lower_heating_value.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/methane/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/nitrogen/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/nitrogen/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/nitrogen/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/nitrogen/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/oxygen/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/oxygen/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/oxygen/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/oxygen/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/properties/properties_toolbox.py (100%) rename {pandapipes => src/pandapipes}/properties/water/compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/water/density.txt (100%) rename {pandapipes => src/pandapipes}/properties/water/der_compressibility.txt (100%) rename {pandapipes => src/pandapipes}/properties/water/heat_capacity.txt (100%) rename {pandapipes => src/pandapipes}/properties/water/molar_mass.txt (100%) rename {pandapipes => src/pandapipes}/properties/water/viscosity.txt (100%) rename {pandapipes => src/pandapipes}/std_types/__init__.py (100%) rename {pandapipes => src/pandapipes}/std_types/library/Pipe.csv (100%) rename {pandapipes => src/pandapipes}/std_types/library/Pump/P1.csv (100%) rename {pandapipes => src/pandapipes}/std_types/library/Pump/P2.csv (100%) rename {pandapipes => src/pandapipes}/std_types/library/Pump/P3.csv (100%) rename {pandapipes => src/pandapipes}/std_types/std_type_class.py (100%) rename {pandapipes => src/pandapipes}/std_types/std_types.py (100%) rename {pandapipes => src/pandapipes}/test/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/api/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.1.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.1.1.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.1.2.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.2.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.4.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.5.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.6.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.7.0.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.0_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.0_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.1_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.1_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.2_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.2_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.3_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.3_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.4_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.4_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.5_gas.json (100%) rename {pandapipes => src/pandapipes}/test/api/old_versions/example_0.8.5_water.json (100%) rename {pandapipes => src/pandapipes}/test/api/release_cycle/release_control_test_network.py (100%) rename {pandapipes => src/pandapipes}/test/api/release_cycle/release_control_test_sink_profiles.csv (100%) rename {pandapipes => src/pandapipes}/test/api/release_cycle/release_control_test_source_profiles.csv (100%) rename {pandapipes => src/pandapipes}/test/api/test_aux_function.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_circ_pump_mass.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_circ_pump_pressure.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_compressor.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_ext_grid.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_flow_control.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_heat_exchanger.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_mass_storage.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_pipe_results.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_pressure_control.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_pump.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_components/test_valve.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_convert_format.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_create.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_network_tables.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_special_networks.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_std_types.py (100%) rename {pandapipes => src/pandapipes}/test/api/test_time_series.py (100%) rename {pandapipes => src/pandapipes}/test/converter/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/converter/converter_test_files/Exampelonia_mini.csv (100%) rename {pandapipes => src/pandapipes}/test/converter/converter_test_files/Exampelonia_mini_with_2valvepipe.csv (100%) rename {pandapipes => src/pandapipes}/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_closed.csv (100%) rename {pandapipes => src/pandapipes}/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_open.csv (100%) rename {pandapipes => src/pandapipes}/test/converter/test_stanet_converter.py (100%) rename {pandapipes => src/pandapipes}/test/io/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/io/test_file_io.py (100%) rename {pandapipes => src/pandapipes}/test/multinet/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/multinet/test_control_multinet.py (100%) rename {pandapipes => src/pandapipes}/test/multinet/test_time_series_multinet.py (100%) rename {pandapipes => src/pandapipes}/test/networks/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/networks/test_networks.py (100%) rename {pandapipes => src/pandapipes}/test/openmodelica_comparison/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py (100%) rename {pandapipes => src/pandapipes}/test/openmodelica_comparison/test_heat_transfer_openmodelica.py (100%) rename {pandapipes => src/pandapipes}/test/openmodelica_comparison/test_water_openmodelica.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_2zu_2ab_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_masche_1load_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_masche_1load_direction_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_one_pipe_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_tee_2ab_1zu_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/Temperature_tee_2zu_1ab_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/ext_grid_p.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/gas_sections_an.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/heat_exchanger_test.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/hydraulics.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/pressure_control_test_analytical.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_circ_pump_mass.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_circ_pump_pressure.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_pressure_control.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_pump.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_ext_grid/mdot_kg_per_s.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_junction/p_bar.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_pipe/lambda.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_pipe/reynolds.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_pipe/v_mean_m_per_s.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_sink/mdot_kg_per_s.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_results/res_source/mdot_kg_per_s.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_sink_profiles.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_time_series_source_profiles.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/data/test_valve.csv (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_inservice.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_non_convergence.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_options.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_pipeflow_analytic_comparison.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_pipeflow_modes.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_time_series.py (100%) rename {pandapipes => src/pandapipes}/test/pipeflow_internals/test_update_matrix.py (100%) rename {pandapipes => src/pandapipes}/test/plotting/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/plotting/test_collections.py (100%) rename {pandapipes => src/pandapipes}/test/plotting/test_generic_coordinates.py (100%) rename {pandapipes => src/pandapipes}/test/plotting/test_pipeflow_results.py (100%) rename {pandapipes => src/pandapipes}/test/plotting/test_simple_collections.py (100%) rename {pandapipes => src/pandapipes}/test/properties/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/properties/test_fluid_specials.py (100%) rename {pandapipes => src/pandapipes}/test/properties/test_properties_toolbox.py (100%) rename {pandapipes => src/pandapipes}/test/pytest.ini (100%) rename {pandapipes => src/pandapipes}/test/run_tests.py (100%) rename {pandapipes => src/pandapipes}/test/stanet_comparison/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/stanet_comparison/pipeflow_stanet_comparison.py (100%) rename {pandapipes => src/pandapipes}/test/stanet_comparison/test_gas_stanet.py (100%) rename {pandapipes => src/pandapipes}/test/stanet_comparison/test_water_stanet.py (100%) rename {pandapipes => src/pandapipes}/test/test_imports.py (100%) rename {pandapipes => src/pandapipes}/test/test_toolbox.py (100%) rename {pandapipes => src/pandapipes}/test/topology/__init__.py (100%) rename {pandapipes => src/pandapipes}/test/topology/test_graph_searches.py (100%) rename {pandapipes => src/pandapipes}/test/topology/test_nxgraph.py (100%) rename {pandapipes => src/pandapipes}/timeseries/__init__.py (100%) rename {pandapipes => src/pandapipes}/timeseries/run_time_series.py (100%) rename {pandapipes => src/pandapipes}/toolbox.py (100%) rename {pandapipes => src/pandapipes}/topology/__init__.py (100%) rename {pandapipes => src/pandapipes}/topology/create_graph.py (100%) rename {pandapipes => src/pandapipes}/topology/graph_searches.py (100%) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index e3bcb5d63..d1ea95dbf 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -102,26 +102,9 @@ jobs: 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 . - python -m pip uninstall pytest-pythonpath - python -m pip install jupyter - python -m pip install --upgrade setuptools - python -m pip install --upgrade pytest - python -m pip install atomicwrites colorama ipython pytest-pythonpath - python -m pip install prompt-toolkit==3.0.41 - python -m pip install Babel==2.13.1 - - name: List all installed packages run: | pip list - - name: Get PYTHONPATH - run: | - echo $PYTHONPATH - - name: Get sys path - run: | - python -c "import sys; print(sys.path)" - - name: List pandapipes packages - run: | - python -c "import sys; import os; from setuptools import find_packages; print(find_packages(where=os.path.join([p for p in sys.path if p.endswith('site-packages')][0], 'pandapipes')))" - name: Test with pytest run: | python -m pytest --nbmake -n=auto "./tutorials" diff --git a/setup.py b/setup.py index 9e8d009f0..5ad029dc3 100644 --- a/setup.py +++ b/setup.py @@ -49,7 +49,8 @@ "test": ["pytest", "pytest-xdist", "nbmake"], "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, - packages=['pandapipes.' + x for x in find_namespace_packages(where="pandapipes")]+ ['pandapipes'], + packages=find_namespace_packages(where='src'), + package_dir={"":"src"}, include_package_data=True, classifiers=classifiers ) diff --git a/pandapipes/__init__.py b/src/pandapipes/__init__.py similarity index 100% rename from pandapipes/__init__.py rename to src/pandapipes/__init__.py diff --git a/pandapipes/component_models/__init__.py b/src/pandapipes/component_models/__init__.py similarity index 100% rename from pandapipes/component_models/__init__.py rename to src/pandapipes/component_models/__init__.py diff --git a/pandapipes/component_models/abstract_models/__init__.py b/src/pandapipes/component_models/abstract_models/__init__.py similarity index 100% rename from pandapipes/component_models/abstract_models/__init__.py rename to src/pandapipes/component_models/abstract_models/__init__.py diff --git a/pandapipes/component_models/abstract_models/base_component.py b/src/pandapipes/component_models/abstract_models/base_component.py similarity index 100% rename from pandapipes/component_models/abstract_models/base_component.py rename to src/pandapipes/component_models/abstract_models/base_component.py diff --git a/pandapipes/component_models/abstract_models/branch_models.py b/src/pandapipes/component_models/abstract_models/branch_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/branch_models.py rename to src/pandapipes/component_models/abstract_models/branch_models.py diff --git a/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/src/pandapipes/component_models/abstract_models/branch_w_internals_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/branch_w_internals_models.py rename to src/pandapipes/component_models/abstract_models/branch_w_internals_models.py diff --git a/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/branch_wo_internals_models.py rename to src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py diff --git a/pandapipes/component_models/abstract_models/branch_wzerolength_models.py b/src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/branch_wzerolength_models.py rename to src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py diff --git a/pandapipes/component_models/abstract_models/circulation_pump.py b/src/pandapipes/component_models/abstract_models/circulation_pump.py similarity index 100% rename from pandapipes/component_models/abstract_models/circulation_pump.py rename to src/pandapipes/component_models/abstract_models/circulation_pump.py diff --git a/pandapipes/component_models/abstract_models/const_flow_models.py b/src/pandapipes/component_models/abstract_models/const_flow_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/const_flow_models.py rename to src/pandapipes/component_models/abstract_models/const_flow_models.py diff --git a/pandapipes/component_models/abstract_models/node_element_models.py b/src/pandapipes/component_models/abstract_models/node_element_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/node_element_models.py rename to src/pandapipes/component_models/abstract_models/node_element_models.py diff --git a/pandapipes/component_models/abstract_models/node_models.py b/src/pandapipes/component_models/abstract_models/node_models.py similarity index 100% rename from pandapipes/component_models/abstract_models/node_models.py rename to src/pandapipes/component_models/abstract_models/node_models.py diff --git a/pandapipes/component_models/circulation_pump_mass_component.py b/src/pandapipes/component_models/circulation_pump_mass_component.py similarity index 100% rename from pandapipes/component_models/circulation_pump_mass_component.py rename to src/pandapipes/component_models/circulation_pump_mass_component.py diff --git a/pandapipes/component_models/circulation_pump_pressure_component.py b/src/pandapipes/component_models/circulation_pump_pressure_component.py similarity index 100% rename from pandapipes/component_models/circulation_pump_pressure_component.py rename to src/pandapipes/component_models/circulation_pump_pressure_component.py diff --git a/pandapipes/component_models/component_toolbox.py b/src/pandapipes/component_models/component_toolbox.py similarity index 100% rename from pandapipes/component_models/component_toolbox.py rename to src/pandapipes/component_models/component_toolbox.py diff --git a/pandapipes/component_models/compressor_component.py b/src/pandapipes/component_models/compressor_component.py similarity index 100% rename from pandapipes/component_models/compressor_component.py rename to src/pandapipes/component_models/compressor_component.py diff --git a/pandapipes/component_models/ext_grid_component.py b/src/pandapipes/component_models/ext_grid_component.py similarity index 100% rename from pandapipes/component_models/ext_grid_component.py rename to src/pandapipes/component_models/ext_grid_component.py diff --git a/pandapipes/component_models/flow_control_component.py b/src/pandapipes/component_models/flow_control_component.py similarity index 100% rename from pandapipes/component_models/flow_control_component.py rename to src/pandapipes/component_models/flow_control_component.py diff --git a/pandapipes/component_models/heat_exchanger_component.py b/src/pandapipes/component_models/heat_exchanger_component.py similarity index 100% rename from pandapipes/component_models/heat_exchanger_component.py rename to src/pandapipes/component_models/heat_exchanger_component.py diff --git a/pandapipes/component_models/junction_component.py b/src/pandapipes/component_models/junction_component.py similarity index 100% rename from pandapipes/component_models/junction_component.py rename to src/pandapipes/component_models/junction_component.py diff --git a/pandapipes/component_models/mass_storage_component.py b/src/pandapipes/component_models/mass_storage_component.py similarity index 100% rename from pandapipes/component_models/mass_storage_component.py rename to src/pandapipes/component_models/mass_storage_component.py diff --git a/pandapipes/component_models/pipe_component.py b/src/pandapipes/component_models/pipe_component.py similarity index 100% rename from pandapipes/component_models/pipe_component.py rename to src/pandapipes/component_models/pipe_component.py diff --git a/pandapipes/component_models/pressure_control_component.py b/src/pandapipes/component_models/pressure_control_component.py similarity index 100% rename from pandapipes/component_models/pressure_control_component.py rename to src/pandapipes/component_models/pressure_control_component.py diff --git a/pandapipes/component_models/pump_component.py b/src/pandapipes/component_models/pump_component.py similarity index 100% rename from pandapipes/component_models/pump_component.py rename to src/pandapipes/component_models/pump_component.py diff --git a/pandapipes/component_models/sink_component.py b/src/pandapipes/component_models/sink_component.py similarity index 100% rename from pandapipes/component_models/sink_component.py rename to src/pandapipes/component_models/sink_component.py diff --git a/pandapipes/component_models/source_component.py b/src/pandapipes/component_models/source_component.py similarity index 100% rename from pandapipes/component_models/source_component.py rename to src/pandapipes/component_models/source_component.py diff --git a/pandapipes/component_models/valve_component.py b/src/pandapipes/component_models/valve_component.py similarity index 100% rename from pandapipes/component_models/valve_component.py rename to src/pandapipes/component_models/valve_component.py diff --git a/pandapipes/constants.py b/src/pandapipes/constants.py similarity index 100% rename from pandapipes/constants.py rename to src/pandapipes/constants.py diff --git a/pandapipes/control/__init__.py b/src/pandapipes/control/__init__.py similarity index 100% rename from pandapipes/control/__init__.py rename to src/pandapipes/control/__init__.py diff --git a/pandapipes/control/run_control.py b/src/pandapipes/control/run_control.py similarity index 100% rename from pandapipes/control/run_control.py rename to src/pandapipes/control/run_control.py diff --git a/pandapipes/converter/__init__.py b/src/pandapipes/converter/__init__.py similarity index 100% rename from pandapipes/converter/__init__.py rename to src/pandapipes/converter/__init__.py diff --git a/pandapipes/converter/stanet/__init__.py b/src/pandapipes/converter/stanet/__init__.py similarity index 100% rename from pandapipes/converter/stanet/__init__.py rename to src/pandapipes/converter/stanet/__init__.py diff --git a/pandapipes/converter/stanet/data_cleaning.py b/src/pandapipes/converter/stanet/data_cleaning.py similarity index 100% rename from pandapipes/converter/stanet/data_cleaning.py rename to src/pandapipes/converter/stanet/data_cleaning.py diff --git a/pandapipes/converter/stanet/preparing_steps.py b/src/pandapipes/converter/stanet/preparing_steps.py similarity index 100% rename from pandapipes/converter/stanet/preparing_steps.py rename to src/pandapipes/converter/stanet/preparing_steps.py diff --git a/pandapipes/converter/stanet/stanet2pandapipes.py b/src/pandapipes/converter/stanet/stanet2pandapipes.py similarity index 100% rename from pandapipes/converter/stanet/stanet2pandapipes.py rename to src/pandapipes/converter/stanet/stanet2pandapipes.py diff --git a/pandapipes/converter/stanet/table_creation.py b/src/pandapipes/converter/stanet/table_creation.py similarity index 100% rename from pandapipes/converter/stanet/table_creation.py rename to src/pandapipes/converter/stanet/table_creation.py diff --git a/pandapipes/converter/stanet/valve_pipe_component/__init__.py b/src/pandapipes/converter/stanet/valve_pipe_component/__init__.py similarity index 100% rename from pandapipes/converter/stanet/valve_pipe_component/__init__.py rename to src/pandapipes/converter/stanet/valve_pipe_component/__init__.py diff --git a/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py b/src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py similarity index 100% rename from pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py rename to src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py diff --git a/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py similarity index 100% rename from pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py rename to src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py diff --git a/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py similarity index 100% rename from pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py rename to src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py diff --git a/pandapipes/create.py b/src/pandapipes/create.py similarity index 100% rename from pandapipes/create.py rename to src/pandapipes/create.py diff --git a/pandapipes/idx_branch.py b/src/pandapipes/idx_branch.py similarity index 100% rename from pandapipes/idx_branch.py rename to src/pandapipes/idx_branch.py diff --git a/pandapipes/idx_node.py b/src/pandapipes/idx_node.py similarity index 100% rename from pandapipes/idx_node.py rename to src/pandapipes/idx_node.py diff --git a/pandapipes/io/__init__.py b/src/pandapipes/io/__init__.py similarity index 100% rename from pandapipes/io/__init__.py rename to src/pandapipes/io/__init__.py diff --git a/pandapipes/io/convert_format.py b/src/pandapipes/io/convert_format.py similarity index 100% rename from pandapipes/io/convert_format.py rename to src/pandapipes/io/convert_format.py diff --git a/pandapipes/io/file_io.py b/src/pandapipes/io/file_io.py similarity index 100% rename from pandapipes/io/file_io.py rename to src/pandapipes/io/file_io.py diff --git a/pandapipes/io/io_utils.py b/src/pandapipes/io/io_utils.py similarity index 100% rename from pandapipes/io/io_utils.py rename to src/pandapipes/io/io_utils.py diff --git a/pandapipes/multinet/__init__.py b/src/pandapipes/multinet/__init__.py similarity index 100% rename from pandapipes/multinet/__init__.py rename to src/pandapipes/multinet/__init__.py diff --git a/pandapipes/multinet/control/__init__.py b/src/pandapipes/multinet/control/__init__.py similarity index 100% rename from pandapipes/multinet/control/__init__.py rename to src/pandapipes/multinet/control/__init__.py diff --git a/pandapipes/multinet/control/controller/__init__.py b/src/pandapipes/multinet/control/controller/__init__.py similarity index 100% rename from pandapipes/multinet/control/controller/__init__.py rename to src/pandapipes/multinet/control/controller/__init__.py diff --git a/pandapipes/multinet/control/controller/multinet_control.py b/src/pandapipes/multinet/control/controller/multinet_control.py similarity index 100% rename from pandapipes/multinet/control/controller/multinet_control.py rename to src/pandapipes/multinet/control/controller/multinet_control.py diff --git a/pandapipes/multinet/control/run_control_multinet.py b/src/pandapipes/multinet/control/run_control_multinet.py similarity index 100% rename from pandapipes/multinet/control/run_control_multinet.py rename to src/pandapipes/multinet/control/run_control_multinet.py diff --git a/pandapipes/multinet/create_multinet.py b/src/pandapipes/multinet/create_multinet.py similarity index 100% rename from pandapipes/multinet/create_multinet.py rename to src/pandapipes/multinet/create_multinet.py diff --git a/pandapipes/multinet/multinet.py b/src/pandapipes/multinet/multinet.py similarity index 100% rename from pandapipes/multinet/multinet.py rename to src/pandapipes/multinet/multinet.py diff --git a/pandapipes/multinet/timeseries/__init__.py b/src/pandapipes/multinet/timeseries/__init__.py similarity index 100% rename from pandapipes/multinet/timeseries/__init__.py rename to src/pandapipes/multinet/timeseries/__init__.py diff --git a/pandapipes/multinet/timeseries/run_time_series_multinet.py b/src/pandapipes/multinet/timeseries/run_time_series_multinet.py similarity index 100% rename from pandapipes/multinet/timeseries/run_time_series_multinet.py rename to src/pandapipes/multinet/timeseries/run_time_series_multinet.py diff --git a/pandapipes/networks/__init__.py b/src/pandapipes/networks/__init__.py similarity index 100% rename from pandapipes/networks/__init__.py rename to src/pandapipes/networks/__init__.py diff --git a/pandapipes/networks/network_files/gas_net_schutterwald_1bar.json b/src/pandapipes/networks/network_files/gas_net_schutterwald_1bar.json similarity index 100% rename from pandapipes/networks/network_files/gas_net_schutterwald_1bar.json rename to src/pandapipes/networks/network_files/gas_net_schutterwald_1bar.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta_2sinks.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta_2sinks.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta_2sinks.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/delta_2sinks.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/heights.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/heights.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/heights.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/heights.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_pipe.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_pipe.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_pipe.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_pipe.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_source.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_source.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_source.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/one_source.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/section_variation.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/section_variation.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/section_variation.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/section_variation.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/t_cross.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/t_cross.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/t_cross.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/t_cross.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/two_pipes.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/two_pipes.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/two_pipes.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/heat_transfer_cases/two_pipes.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/mixed_net.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/mixed_net.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/mixed_net.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/mixed_net.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/versatility.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/versatility.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/versatility.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/combined_networks/versatility.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/delta.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/delta.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/delta.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/delta.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/heights.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/heights.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/heights.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/heights.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/pumps.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/pumps.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/pumps.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/pumps.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/two_valves.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/two_valves.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/two_valves.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/meshed_networks/two_valves.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_1.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_1.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_1.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_1.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_2.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_2.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_2.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_2.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_3.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_3.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_3.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/one_pipe/pipe_3.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/cross_3ext.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/cross_3ext.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/cross_3ext.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/cross_3ext.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/strand_net.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/strand_net.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/strand_net.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/strand_net.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pipes.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pipes.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pipes.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pipes.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pumps.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pumps.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pumps.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/strand_net/two_pumps.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/t_cross.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/t_cross.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/t_cross.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/t_cross.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/valves.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/valves.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/valves.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/t_cross/valves.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/two_pressure_junctions/two_pipes.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/two_pressure_junctions/two_pipes.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/two_pressure_junctions/two_pipes.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_colebrook/two_pressure_junctions/two_pipes.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/mixed_net.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/mixed_net.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/mixed_net.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/mixed_net.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/versatility.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/versatility.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/versatility.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/combined_networks/versatility.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/delta.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/delta.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/delta.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/delta.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/heights.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/heights.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/heights.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/heights.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/one_valve_stanet.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/one_valve_stanet.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/one_valve_stanet.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/one_valve_stanet.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/pumps.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/pumps.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/pumps.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/pumps.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/two_valves.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/two_valves.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/two_valves.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/meshed_networks/two_valves.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_1.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_1.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_1.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_1.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_2.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_2.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_2.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_2.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_3.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_3.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_3.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/one_pipe/pipe_3.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/cross_3ext.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/cross_3ext.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/cross_3ext.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/cross_3ext.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation1.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation1.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation1.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation1.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation2.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation2.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation2.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/strand_net_stanet_variation2.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pipes.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pipes.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pipes.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pipes.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pumps.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pumps.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pumps.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/strand_net/two_pumps.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/t_cross.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/t_cross.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/t_cross.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/t_cross.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/valves.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/valves.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/valves.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/t_cross/valves.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/one_pipe_stanet.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/one_pipe_stanet.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/one_pipe_stanet.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/one_pipe_stanet.json diff --git a/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/two_pipes.json b/src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/two_pipes.json similarity index 100% rename from pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/two_pipes.json rename to src/pandapipes/networks/network_files/openmodelica_test_networks/water_cases_swamee-jain/two_pressure_junctions/two_pipes.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural1--0-sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural2--0-sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-rural3--0-sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb4--0-sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-semiurb5--0-sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-no_sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-no_sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-no_sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-no_sw.json diff --git a/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-sw.json b/src/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-sw.json similarity index 100% rename from pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-sw.json rename to src/pandapipes/networks/network_files/simbench_test_networks/1-LV-urban6--0-sw.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/parallel_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/versatility_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/versatility_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/versatility_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/combined_networks/versatility_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/delta_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/delta_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/delta_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/delta_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/pumps_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/pumps_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/pumps_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/pumps_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/square_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/meshed_networks/two_valves_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_1_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/one_pipe/pipe_2_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/pump_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/pump_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/pump_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/pump_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/strand_net/two_pipes_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross1_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/t_cross/t_cross2_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/gas_cases/two_pressure_junctions/H_net_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/district_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/combined_networks/versatility_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/delta_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/delta_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/delta_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/delta_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/pumps_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/pumps_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/pumps_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/pumps_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/meshed_networks/two_valves_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_1_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_2_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/one_pipe/pipe_3_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/cross_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/cross_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/cross_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/cross_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/pump_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/pump_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/pump_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/pump_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/strand_net_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/strand_net/two_pipes_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/t_cross/t_cross_PC.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_N.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_N.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_N.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_N.json diff --git a/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_PC.json b/src/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_PC.json similarity index 100% rename from pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_PC.json rename to src/pandapipes/networks/network_files/stanet_test_networks/water_cases/two_pressure_junctions/two_pipes_PC.json diff --git a/pandapipes/networks/nw_aux.py b/src/pandapipes/networks/nw_aux.py similarity index 100% rename from pandapipes/networks/nw_aux.py rename to src/pandapipes/networks/nw_aux.py diff --git a/pandapipes/networks/simple_gas_networks.py b/src/pandapipes/networks/simple_gas_networks.py similarity index 100% rename from pandapipes/networks/simple_gas_networks.py rename to src/pandapipes/networks/simple_gas_networks.py diff --git a/pandapipes/networks/simple_heat_transfer_networks.py b/src/pandapipes/networks/simple_heat_transfer_networks.py similarity index 100% rename from pandapipes/networks/simple_heat_transfer_networks.py rename to src/pandapipes/networks/simple_heat_transfer_networks.py diff --git a/pandapipes/networks/simple_water_networks.py b/src/pandapipes/networks/simple_water_networks.py similarity index 100% rename from pandapipes/networks/simple_water_networks.py rename to src/pandapipes/networks/simple_water_networks.py diff --git a/pandapipes/pandapipes_net.py b/src/pandapipes/pandapipes_net.py similarity index 100% rename from pandapipes/pandapipes_net.py rename to src/pandapipes/pandapipes_net.py diff --git a/pandapipes/pf/__init__.py b/src/pandapipes/pf/__init__.py similarity index 100% rename from pandapipes/pf/__init__.py rename to src/pandapipes/pf/__init__.py diff --git a/pandapipes/pf/build_system_matrix.py b/src/pandapipes/pf/build_system_matrix.py similarity index 100% rename from pandapipes/pf/build_system_matrix.py rename to src/pandapipes/pf/build_system_matrix.py diff --git a/pandapipes/pf/derivative_calculation.py b/src/pandapipes/pf/derivative_calculation.py similarity index 100% rename from pandapipes/pf/derivative_calculation.py rename to src/pandapipes/pf/derivative_calculation.py diff --git a/pandapipes/pf/derivative_toolbox.py b/src/pandapipes/pf/derivative_toolbox.py similarity index 100% rename from pandapipes/pf/derivative_toolbox.py rename to src/pandapipes/pf/derivative_toolbox.py diff --git a/pandapipes/pf/derivative_toolbox_numba.py b/src/pandapipes/pf/derivative_toolbox_numba.py similarity index 100% rename from pandapipes/pf/derivative_toolbox_numba.py rename to src/pandapipes/pf/derivative_toolbox_numba.py diff --git a/pandapipes/pf/internals_toolbox.py b/src/pandapipes/pf/internals_toolbox.py similarity index 100% rename from pandapipes/pf/internals_toolbox.py rename to src/pandapipes/pf/internals_toolbox.py diff --git a/pandapipes/pf/pipeflow_setup.py b/src/pandapipes/pf/pipeflow_setup.py similarity index 100% rename from pandapipes/pf/pipeflow_setup.py rename to src/pandapipes/pf/pipeflow_setup.py diff --git a/pandapipes/pf/result_extraction.py b/src/pandapipes/pf/result_extraction.py similarity index 100% rename from pandapipes/pf/result_extraction.py rename to src/pandapipes/pf/result_extraction.py diff --git a/pandapipes/pipeflow.py b/src/pandapipes/pipeflow.py similarity index 100% rename from pandapipes/pipeflow.py rename to src/pandapipes/pipeflow.py diff --git a/pandapipes/plotting/__init__.py b/src/pandapipes/plotting/__init__.py similarity index 100% rename from pandapipes/plotting/__init__.py rename to src/pandapipes/plotting/__init__.py diff --git a/pandapipes/plotting/collections.py b/src/pandapipes/plotting/collections.py similarity index 100% rename from pandapipes/plotting/collections.py rename to src/pandapipes/plotting/collections.py diff --git a/pandapipes/plotting/generic_geodata.py b/src/pandapipes/plotting/generic_geodata.py similarity index 100% rename from pandapipes/plotting/generic_geodata.py rename to src/pandapipes/plotting/generic_geodata.py diff --git a/pandapipes/plotting/geo.py b/src/pandapipes/plotting/geo.py similarity index 100% rename from pandapipes/plotting/geo.py rename to src/pandapipes/plotting/geo.py diff --git a/pandapipes/plotting/patch_makers.py b/src/pandapipes/plotting/patch_makers.py similarity index 100% rename from pandapipes/plotting/patch_makers.py rename to src/pandapipes/plotting/patch_makers.py diff --git a/pandapipes/plotting/pipeflow_results.py b/src/pandapipes/plotting/pipeflow_results.py similarity index 100% rename from pandapipes/plotting/pipeflow_results.py rename to src/pandapipes/plotting/pipeflow_results.py diff --git a/pandapipes/plotting/plotting_toolbox.py b/src/pandapipes/plotting/plotting_toolbox.py similarity index 100% rename from pandapipes/plotting/plotting_toolbox.py rename to src/pandapipes/plotting/plotting_toolbox.py diff --git a/pandapipes/plotting/simple_plot.py b/src/pandapipes/plotting/simple_plot.py similarity index 100% rename from pandapipes/plotting/simple_plot.py rename to src/pandapipes/plotting/simple_plot.py diff --git a/pandapipes/properties/__init__.py b/src/pandapipes/properties/__init__.py similarity index 100% rename from pandapipes/properties/__init__.py rename to src/pandapipes/properties/__init__.py diff --git a/pandapipes/properties/air/compressibility.txt b/src/pandapipes/properties/air/compressibility.txt similarity index 100% rename from pandapipes/properties/air/compressibility.txt rename to src/pandapipes/properties/air/compressibility.txt diff --git a/pandapipes/properties/air/density.txt b/src/pandapipes/properties/air/density.txt similarity index 100% rename from pandapipes/properties/air/density.txt rename to src/pandapipes/properties/air/density.txt diff --git a/pandapipes/properties/air/der_compressibility.txt b/src/pandapipes/properties/air/der_compressibility.txt similarity index 100% rename from pandapipes/properties/air/der_compressibility.txt rename to src/pandapipes/properties/air/der_compressibility.txt diff --git a/pandapipes/properties/air/heat_capacity.txt b/src/pandapipes/properties/air/heat_capacity.txt similarity index 100% rename from pandapipes/properties/air/heat_capacity.txt rename to src/pandapipes/properties/air/heat_capacity.txt diff --git a/pandapipes/properties/air/molar_mass.txt b/src/pandapipes/properties/air/molar_mass.txt similarity index 100% rename from pandapipes/properties/air/molar_mass.txt rename to src/pandapipes/properties/air/molar_mass.txt diff --git a/pandapipes/properties/air/viscosity.txt b/src/pandapipes/properties/air/viscosity.txt similarity index 100% rename from pandapipes/properties/air/viscosity.txt rename to src/pandapipes/properties/air/viscosity.txt diff --git a/pandapipes/properties/biomethane_pure/compressibility.txt b/src/pandapipes/properties/biomethane_pure/compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/compressibility.txt rename to src/pandapipes/properties/biomethane_pure/compressibility.txt diff --git a/pandapipes/properties/biomethane_pure/density.txt b/src/pandapipes/properties/biomethane_pure/density.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/density.txt rename to src/pandapipes/properties/biomethane_pure/density.txt diff --git a/pandapipes/properties/biomethane_pure/der_compressibility.txt b/src/pandapipes/properties/biomethane_pure/der_compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/der_compressibility.txt rename to src/pandapipes/properties/biomethane_pure/der_compressibility.txt diff --git a/pandapipes/properties/biomethane_pure/gas_composition.txt b/src/pandapipes/properties/biomethane_pure/gas_composition.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/gas_composition.txt rename to src/pandapipes/properties/biomethane_pure/gas_composition.txt diff --git a/pandapipes/properties/biomethane_pure/heat_capacity.txt b/src/pandapipes/properties/biomethane_pure/heat_capacity.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/heat_capacity.txt rename to src/pandapipes/properties/biomethane_pure/heat_capacity.txt diff --git a/pandapipes/properties/biomethane_pure/higher_heating_value.txt b/src/pandapipes/properties/biomethane_pure/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/higher_heating_value.txt rename to src/pandapipes/properties/biomethane_pure/higher_heating_value.txt diff --git a/pandapipes/properties/biomethane_pure/lower_heating_value.txt b/src/pandapipes/properties/biomethane_pure/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/lower_heating_value.txt rename to src/pandapipes/properties/biomethane_pure/lower_heating_value.txt diff --git a/pandapipes/properties/biomethane_pure/molar_mass.txt b/src/pandapipes/properties/biomethane_pure/molar_mass.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/molar_mass.txt rename to src/pandapipes/properties/biomethane_pure/molar_mass.txt diff --git a/pandapipes/properties/biomethane_pure/viscosity.txt b/src/pandapipes/properties/biomethane_pure/viscosity.txt similarity index 100% rename from pandapipes/properties/biomethane_pure/viscosity.txt rename to src/pandapipes/properties/biomethane_pure/viscosity.txt diff --git a/pandapipes/properties/biomethane_treated/compressibility.txt b/src/pandapipes/properties/biomethane_treated/compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/compressibility.txt rename to src/pandapipes/properties/biomethane_treated/compressibility.txt diff --git a/pandapipes/properties/biomethane_treated/density.txt b/src/pandapipes/properties/biomethane_treated/density.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/density.txt rename to src/pandapipes/properties/biomethane_treated/density.txt diff --git a/pandapipes/properties/biomethane_treated/der_compressibility.txt b/src/pandapipes/properties/biomethane_treated/der_compressibility.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/der_compressibility.txt rename to src/pandapipes/properties/biomethane_treated/der_compressibility.txt diff --git a/pandapipes/properties/biomethane_treated/gas_composition.txt b/src/pandapipes/properties/biomethane_treated/gas_composition.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/gas_composition.txt rename to src/pandapipes/properties/biomethane_treated/gas_composition.txt diff --git a/pandapipes/properties/biomethane_treated/heat_capacity.txt b/src/pandapipes/properties/biomethane_treated/heat_capacity.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/heat_capacity.txt rename to src/pandapipes/properties/biomethane_treated/heat_capacity.txt diff --git a/pandapipes/properties/biomethane_treated/higher_heating_value.txt b/src/pandapipes/properties/biomethane_treated/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/higher_heating_value.txt rename to src/pandapipes/properties/biomethane_treated/higher_heating_value.txt diff --git a/pandapipes/properties/biomethane_treated/lower_heating_value.txt b/src/pandapipes/properties/biomethane_treated/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/lower_heating_value.txt rename to src/pandapipes/properties/biomethane_treated/lower_heating_value.txt diff --git a/pandapipes/properties/biomethane_treated/molar_mass.txt b/src/pandapipes/properties/biomethane_treated/molar_mass.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/molar_mass.txt rename to src/pandapipes/properties/biomethane_treated/molar_mass.txt diff --git a/pandapipes/properties/biomethane_treated/viscosity.txt b/src/pandapipes/properties/biomethane_treated/viscosity.txt similarity index 100% rename from pandapipes/properties/biomethane_treated/viscosity.txt rename to src/pandapipes/properties/biomethane_treated/viscosity.txt diff --git a/pandapipes/properties/carbondioxide/density.txt b/src/pandapipes/properties/carbondioxide/density.txt similarity index 100% rename from pandapipes/properties/carbondioxide/density.txt rename to src/pandapipes/properties/carbondioxide/density.txt diff --git a/pandapipes/properties/carbondioxide/heat_capacity.txt b/src/pandapipes/properties/carbondioxide/heat_capacity.txt similarity index 100% rename from pandapipes/properties/carbondioxide/heat_capacity.txt rename to src/pandapipes/properties/carbondioxide/heat_capacity.txt diff --git a/pandapipes/properties/carbondioxide/molar_mass.txt b/src/pandapipes/properties/carbondioxide/molar_mass.txt similarity index 100% rename from pandapipes/properties/carbondioxide/molar_mass.txt rename to src/pandapipes/properties/carbondioxide/molar_mass.txt diff --git a/pandapipes/properties/carbondioxide/viscosity.txt b/src/pandapipes/properties/carbondioxide/viscosity.txt similarity index 100% rename from pandapipes/properties/carbondioxide/viscosity.txt rename to src/pandapipes/properties/carbondioxide/viscosity.txt diff --git a/pandapipes/properties/ethane/density.txt b/src/pandapipes/properties/ethane/density.txt similarity index 100% rename from pandapipes/properties/ethane/density.txt rename to src/pandapipes/properties/ethane/density.txt diff --git a/pandapipes/properties/ethane/heat_capacity.txt b/src/pandapipes/properties/ethane/heat_capacity.txt similarity index 100% rename from pandapipes/properties/ethane/heat_capacity.txt rename to src/pandapipes/properties/ethane/heat_capacity.txt diff --git a/pandapipes/properties/ethane/molar_mass.txt b/src/pandapipes/properties/ethane/molar_mass.txt similarity index 100% rename from pandapipes/properties/ethane/molar_mass.txt rename to src/pandapipes/properties/ethane/molar_mass.txt diff --git a/pandapipes/properties/ethane/viscosity.txt b/src/pandapipes/properties/ethane/viscosity.txt similarity index 100% rename from pandapipes/properties/ethane/viscosity.txt rename to src/pandapipes/properties/ethane/viscosity.txt diff --git a/pandapipes/properties/fluids.py b/src/pandapipes/properties/fluids.py similarity index 100% rename from pandapipes/properties/fluids.py rename to src/pandapipes/properties/fluids.py diff --git a/pandapipes/properties/hgas/compressibility.txt b/src/pandapipes/properties/hgas/compressibility.txt similarity index 100% rename from pandapipes/properties/hgas/compressibility.txt rename to src/pandapipes/properties/hgas/compressibility.txt diff --git a/pandapipes/properties/hgas/density.txt b/src/pandapipes/properties/hgas/density.txt similarity index 100% rename from pandapipes/properties/hgas/density.txt rename to src/pandapipes/properties/hgas/density.txt diff --git a/pandapipes/properties/hgas/der_compressibility.txt b/src/pandapipes/properties/hgas/der_compressibility.txt similarity index 100% rename from pandapipes/properties/hgas/der_compressibility.txt rename to src/pandapipes/properties/hgas/der_compressibility.txt diff --git a/pandapipes/properties/hgas/heat_capacity.txt b/src/pandapipes/properties/hgas/heat_capacity.txt similarity index 100% rename from pandapipes/properties/hgas/heat_capacity.txt rename to src/pandapipes/properties/hgas/heat_capacity.txt diff --git a/pandapipes/properties/hgas/higher_heating_value.txt b/src/pandapipes/properties/hgas/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/hgas/higher_heating_value.txt rename to src/pandapipes/properties/hgas/higher_heating_value.txt diff --git a/pandapipes/properties/hgas/lower_heating_value.txt b/src/pandapipes/properties/hgas/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/hgas/lower_heating_value.txt rename to src/pandapipes/properties/hgas/lower_heating_value.txt diff --git a/pandapipes/properties/hgas/molar_mass.txt b/src/pandapipes/properties/hgas/molar_mass.txt similarity index 100% rename from pandapipes/properties/hgas/molar_mass.txt rename to src/pandapipes/properties/hgas/molar_mass.txt diff --git a/pandapipes/properties/hgas/viscosity.txt b/src/pandapipes/properties/hgas/viscosity.txt similarity index 100% rename from pandapipes/properties/hgas/viscosity.txt rename to src/pandapipes/properties/hgas/viscosity.txt diff --git a/pandapipes/properties/hydrogen/compressibility.txt b/src/pandapipes/properties/hydrogen/compressibility.txt similarity index 100% rename from pandapipes/properties/hydrogen/compressibility.txt rename to src/pandapipes/properties/hydrogen/compressibility.txt diff --git a/pandapipes/properties/hydrogen/density.txt b/src/pandapipes/properties/hydrogen/density.txt similarity index 100% rename from pandapipes/properties/hydrogen/density.txt rename to src/pandapipes/properties/hydrogen/density.txt diff --git a/pandapipes/properties/hydrogen/der_compressibility.txt b/src/pandapipes/properties/hydrogen/der_compressibility.txt similarity index 100% rename from pandapipes/properties/hydrogen/der_compressibility.txt rename to src/pandapipes/properties/hydrogen/der_compressibility.txt diff --git a/pandapipes/properties/hydrogen/heat_capacity.txt b/src/pandapipes/properties/hydrogen/heat_capacity.txt similarity index 100% rename from pandapipes/properties/hydrogen/heat_capacity.txt rename to src/pandapipes/properties/hydrogen/heat_capacity.txt diff --git a/pandapipes/properties/hydrogen/higher_heating_value.txt b/src/pandapipes/properties/hydrogen/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/hydrogen/higher_heating_value.txt rename to src/pandapipes/properties/hydrogen/higher_heating_value.txt diff --git a/pandapipes/properties/hydrogen/lower_heating_value.txt b/src/pandapipes/properties/hydrogen/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/hydrogen/lower_heating_value.txt rename to src/pandapipes/properties/hydrogen/lower_heating_value.txt diff --git a/pandapipes/properties/hydrogen/molar_mass.txt b/src/pandapipes/properties/hydrogen/molar_mass.txt similarity index 100% rename from pandapipes/properties/hydrogen/molar_mass.txt rename to src/pandapipes/properties/hydrogen/molar_mass.txt diff --git a/pandapipes/properties/hydrogen/viscosity.txt b/src/pandapipes/properties/hydrogen/viscosity.txt similarity index 100% rename from pandapipes/properties/hydrogen/viscosity.txt rename to src/pandapipes/properties/hydrogen/viscosity.txt diff --git a/pandapipes/properties/lgas/compressibility.txt b/src/pandapipes/properties/lgas/compressibility.txt similarity index 100% rename from pandapipes/properties/lgas/compressibility.txt rename to src/pandapipes/properties/lgas/compressibility.txt diff --git a/pandapipes/properties/lgas/density.txt b/src/pandapipes/properties/lgas/density.txt similarity index 100% rename from pandapipes/properties/lgas/density.txt rename to src/pandapipes/properties/lgas/density.txt diff --git a/pandapipes/properties/lgas/der_compressibility.txt b/src/pandapipes/properties/lgas/der_compressibility.txt similarity index 100% rename from pandapipes/properties/lgas/der_compressibility.txt rename to src/pandapipes/properties/lgas/der_compressibility.txt diff --git a/pandapipes/properties/lgas/heat_capacity.txt b/src/pandapipes/properties/lgas/heat_capacity.txt similarity index 100% rename from pandapipes/properties/lgas/heat_capacity.txt rename to src/pandapipes/properties/lgas/heat_capacity.txt diff --git a/pandapipes/properties/lgas/higher_heating_value.txt b/src/pandapipes/properties/lgas/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/lgas/higher_heating_value.txt rename to src/pandapipes/properties/lgas/higher_heating_value.txt diff --git a/pandapipes/properties/lgas/lower_heating_value.txt b/src/pandapipes/properties/lgas/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/lgas/lower_heating_value.txt rename to src/pandapipes/properties/lgas/lower_heating_value.txt diff --git a/pandapipes/properties/lgas/molar_mass.txt b/src/pandapipes/properties/lgas/molar_mass.txt similarity index 100% rename from pandapipes/properties/lgas/molar_mass.txt rename to src/pandapipes/properties/lgas/molar_mass.txt diff --git a/pandapipes/properties/lgas/viscosity.txt b/src/pandapipes/properties/lgas/viscosity.txt similarity index 100% rename from pandapipes/properties/lgas/viscosity.txt rename to src/pandapipes/properties/lgas/viscosity.txt diff --git a/pandapipes/properties/methane/compressibility.txt b/src/pandapipes/properties/methane/compressibility.txt similarity index 100% rename from pandapipes/properties/methane/compressibility.txt rename to src/pandapipes/properties/methane/compressibility.txt diff --git a/pandapipes/properties/methane/density.txt b/src/pandapipes/properties/methane/density.txt similarity index 100% rename from pandapipes/properties/methane/density.txt rename to src/pandapipes/properties/methane/density.txt diff --git a/pandapipes/properties/methane/der_compressibility.txt b/src/pandapipes/properties/methane/der_compressibility.txt similarity index 100% rename from pandapipes/properties/methane/der_compressibility.txt rename to src/pandapipes/properties/methane/der_compressibility.txt diff --git a/pandapipes/properties/methane/heat_capacity.txt b/src/pandapipes/properties/methane/heat_capacity.txt similarity index 100% rename from pandapipes/properties/methane/heat_capacity.txt rename to src/pandapipes/properties/methane/heat_capacity.txt diff --git a/pandapipes/properties/methane/higher_heating_value.txt b/src/pandapipes/properties/methane/higher_heating_value.txt similarity index 100% rename from pandapipes/properties/methane/higher_heating_value.txt rename to src/pandapipes/properties/methane/higher_heating_value.txt diff --git a/pandapipes/properties/methane/lower_heating_value.txt b/src/pandapipes/properties/methane/lower_heating_value.txt similarity index 100% rename from pandapipes/properties/methane/lower_heating_value.txt rename to src/pandapipes/properties/methane/lower_heating_value.txt diff --git a/pandapipes/properties/methane/molar_mass.txt b/src/pandapipes/properties/methane/molar_mass.txt similarity index 100% rename from pandapipes/properties/methane/molar_mass.txt rename to src/pandapipes/properties/methane/molar_mass.txt diff --git a/pandapipes/properties/methane/viscosity.txt b/src/pandapipes/properties/methane/viscosity.txt similarity index 100% rename from pandapipes/properties/methane/viscosity.txt rename to src/pandapipes/properties/methane/viscosity.txt diff --git a/pandapipes/properties/nitrogen/density.txt b/src/pandapipes/properties/nitrogen/density.txt similarity index 100% rename from pandapipes/properties/nitrogen/density.txt rename to src/pandapipes/properties/nitrogen/density.txt diff --git a/pandapipes/properties/nitrogen/heat_capacity.txt b/src/pandapipes/properties/nitrogen/heat_capacity.txt similarity index 100% rename from pandapipes/properties/nitrogen/heat_capacity.txt rename to src/pandapipes/properties/nitrogen/heat_capacity.txt diff --git a/pandapipes/properties/nitrogen/molar_mass.txt b/src/pandapipes/properties/nitrogen/molar_mass.txt similarity index 100% rename from pandapipes/properties/nitrogen/molar_mass.txt rename to src/pandapipes/properties/nitrogen/molar_mass.txt diff --git a/pandapipes/properties/nitrogen/viscosity.txt b/src/pandapipes/properties/nitrogen/viscosity.txt similarity index 100% rename from pandapipes/properties/nitrogen/viscosity.txt rename to src/pandapipes/properties/nitrogen/viscosity.txt diff --git a/pandapipes/properties/oxygen/density.txt b/src/pandapipes/properties/oxygen/density.txt similarity index 100% rename from pandapipes/properties/oxygen/density.txt rename to src/pandapipes/properties/oxygen/density.txt diff --git a/pandapipes/properties/oxygen/heat_capacity.txt b/src/pandapipes/properties/oxygen/heat_capacity.txt similarity index 100% rename from pandapipes/properties/oxygen/heat_capacity.txt rename to src/pandapipes/properties/oxygen/heat_capacity.txt diff --git a/pandapipes/properties/oxygen/molar_mass.txt b/src/pandapipes/properties/oxygen/molar_mass.txt similarity index 100% rename from pandapipes/properties/oxygen/molar_mass.txt rename to src/pandapipes/properties/oxygen/molar_mass.txt diff --git a/pandapipes/properties/oxygen/viscosity.txt b/src/pandapipes/properties/oxygen/viscosity.txt similarity index 100% rename from pandapipes/properties/oxygen/viscosity.txt rename to src/pandapipes/properties/oxygen/viscosity.txt diff --git a/pandapipes/properties/properties_toolbox.py b/src/pandapipes/properties/properties_toolbox.py similarity index 100% rename from pandapipes/properties/properties_toolbox.py rename to src/pandapipes/properties/properties_toolbox.py diff --git a/pandapipes/properties/water/compressibility.txt b/src/pandapipes/properties/water/compressibility.txt similarity index 100% rename from pandapipes/properties/water/compressibility.txt rename to src/pandapipes/properties/water/compressibility.txt diff --git a/pandapipes/properties/water/density.txt b/src/pandapipes/properties/water/density.txt similarity index 100% rename from pandapipes/properties/water/density.txt rename to src/pandapipes/properties/water/density.txt diff --git a/pandapipes/properties/water/der_compressibility.txt b/src/pandapipes/properties/water/der_compressibility.txt similarity index 100% rename from pandapipes/properties/water/der_compressibility.txt rename to src/pandapipes/properties/water/der_compressibility.txt diff --git a/pandapipes/properties/water/heat_capacity.txt b/src/pandapipes/properties/water/heat_capacity.txt similarity index 100% rename from pandapipes/properties/water/heat_capacity.txt rename to src/pandapipes/properties/water/heat_capacity.txt diff --git a/pandapipes/properties/water/molar_mass.txt b/src/pandapipes/properties/water/molar_mass.txt similarity index 100% rename from pandapipes/properties/water/molar_mass.txt rename to src/pandapipes/properties/water/molar_mass.txt diff --git a/pandapipes/properties/water/viscosity.txt b/src/pandapipes/properties/water/viscosity.txt similarity index 100% rename from pandapipes/properties/water/viscosity.txt rename to src/pandapipes/properties/water/viscosity.txt diff --git a/pandapipes/std_types/__init__.py b/src/pandapipes/std_types/__init__.py similarity index 100% rename from pandapipes/std_types/__init__.py rename to src/pandapipes/std_types/__init__.py diff --git a/pandapipes/std_types/library/Pipe.csv b/src/pandapipes/std_types/library/Pipe.csv similarity index 100% rename from pandapipes/std_types/library/Pipe.csv rename to src/pandapipes/std_types/library/Pipe.csv diff --git a/pandapipes/std_types/library/Pump/P1.csv b/src/pandapipes/std_types/library/Pump/P1.csv similarity index 100% rename from pandapipes/std_types/library/Pump/P1.csv rename to src/pandapipes/std_types/library/Pump/P1.csv diff --git a/pandapipes/std_types/library/Pump/P2.csv b/src/pandapipes/std_types/library/Pump/P2.csv similarity index 100% rename from pandapipes/std_types/library/Pump/P2.csv rename to src/pandapipes/std_types/library/Pump/P2.csv diff --git a/pandapipes/std_types/library/Pump/P3.csv b/src/pandapipes/std_types/library/Pump/P3.csv similarity index 100% rename from pandapipes/std_types/library/Pump/P3.csv rename to src/pandapipes/std_types/library/Pump/P3.csv diff --git a/pandapipes/std_types/std_type_class.py b/src/pandapipes/std_types/std_type_class.py similarity index 100% rename from pandapipes/std_types/std_type_class.py rename to src/pandapipes/std_types/std_type_class.py diff --git a/pandapipes/std_types/std_types.py b/src/pandapipes/std_types/std_types.py similarity index 100% rename from pandapipes/std_types/std_types.py rename to src/pandapipes/std_types/std_types.py diff --git a/pandapipes/test/__init__.py b/src/pandapipes/test/__init__.py similarity index 100% rename from pandapipes/test/__init__.py rename to src/pandapipes/test/__init__.py diff --git a/pandapipes/test/api/__init__.py b/src/pandapipes/test/api/__init__.py similarity index 100% rename from pandapipes/test/api/__init__.py rename to src/pandapipes/test/api/__init__.py diff --git a/pandapipes/test/api/old_versions/example_0.1.0.json b/src/pandapipes/test/api/old_versions/example_0.1.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.1.0.json rename to src/pandapipes/test/api/old_versions/example_0.1.0.json diff --git a/pandapipes/test/api/old_versions/example_0.1.1.json b/src/pandapipes/test/api/old_versions/example_0.1.1.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.1.1.json rename to src/pandapipes/test/api/old_versions/example_0.1.1.json diff --git a/pandapipes/test/api/old_versions/example_0.1.2.json b/src/pandapipes/test/api/old_versions/example_0.1.2.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.1.2.json rename to src/pandapipes/test/api/old_versions/example_0.1.2.json diff --git a/pandapipes/test/api/old_versions/example_0.2.0.json b/src/pandapipes/test/api/old_versions/example_0.2.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.2.0.json rename to src/pandapipes/test/api/old_versions/example_0.2.0.json diff --git a/pandapipes/test/api/old_versions/example_0.4.0.json b/src/pandapipes/test/api/old_versions/example_0.4.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.4.0.json rename to src/pandapipes/test/api/old_versions/example_0.4.0.json diff --git a/pandapipes/test/api/old_versions/example_0.5.0.json b/src/pandapipes/test/api/old_versions/example_0.5.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.5.0.json rename to src/pandapipes/test/api/old_versions/example_0.5.0.json diff --git a/pandapipes/test/api/old_versions/example_0.6.0.json b/src/pandapipes/test/api/old_versions/example_0.6.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.6.0.json rename to src/pandapipes/test/api/old_versions/example_0.6.0.json diff --git a/pandapipes/test/api/old_versions/example_0.7.0.json b/src/pandapipes/test/api/old_versions/example_0.7.0.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.7.0.json rename to src/pandapipes/test/api/old_versions/example_0.7.0.json diff --git a/pandapipes/test/api/old_versions/example_0.8.0_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.0_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.0_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.0_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.0_water.json b/src/pandapipes/test/api/old_versions/example_0.8.0_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.0_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.0_water.json diff --git a/pandapipes/test/api/old_versions/example_0.8.1_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.1_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.1_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.1_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.1_water.json b/src/pandapipes/test/api/old_versions/example_0.8.1_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.1_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.1_water.json diff --git a/pandapipes/test/api/old_versions/example_0.8.2_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.2_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.2_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.2_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.2_water.json b/src/pandapipes/test/api/old_versions/example_0.8.2_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.2_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.2_water.json diff --git a/pandapipes/test/api/old_versions/example_0.8.3_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.3_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.3_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.3_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.3_water.json b/src/pandapipes/test/api/old_versions/example_0.8.3_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.3_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.3_water.json diff --git a/pandapipes/test/api/old_versions/example_0.8.4_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.4_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.4_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.4_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.4_water.json b/src/pandapipes/test/api/old_versions/example_0.8.4_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.4_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.4_water.json diff --git a/pandapipes/test/api/old_versions/example_0.8.5_gas.json b/src/pandapipes/test/api/old_versions/example_0.8.5_gas.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.5_gas.json rename to src/pandapipes/test/api/old_versions/example_0.8.5_gas.json diff --git a/pandapipes/test/api/old_versions/example_0.8.5_water.json b/src/pandapipes/test/api/old_versions/example_0.8.5_water.json similarity index 100% rename from pandapipes/test/api/old_versions/example_0.8.5_water.json rename to src/pandapipes/test/api/old_versions/example_0.8.5_water.json diff --git a/pandapipes/test/api/release_cycle/release_control_test_network.py b/src/pandapipes/test/api/release_cycle/release_control_test_network.py similarity index 100% rename from pandapipes/test/api/release_cycle/release_control_test_network.py rename to src/pandapipes/test/api/release_cycle/release_control_test_network.py diff --git a/pandapipes/test/api/release_cycle/release_control_test_sink_profiles.csv b/src/pandapipes/test/api/release_cycle/release_control_test_sink_profiles.csv similarity index 100% rename from pandapipes/test/api/release_cycle/release_control_test_sink_profiles.csv rename to src/pandapipes/test/api/release_cycle/release_control_test_sink_profiles.csv diff --git a/pandapipes/test/api/release_cycle/release_control_test_source_profiles.csv b/src/pandapipes/test/api/release_cycle/release_control_test_source_profiles.csv similarity index 100% rename from pandapipes/test/api/release_cycle/release_control_test_source_profiles.csv rename to src/pandapipes/test/api/release_cycle/release_control_test_source_profiles.csv diff --git a/pandapipes/test/api/test_aux_function.py b/src/pandapipes/test/api/test_aux_function.py similarity index 100% rename from pandapipes/test/api/test_aux_function.py rename to src/pandapipes/test/api/test_aux_function.py diff --git a/pandapipes/test/api/test_components/__init__.py b/src/pandapipes/test/api/test_components/__init__.py similarity index 100% rename from pandapipes/test/api/test_components/__init__.py rename to src/pandapipes/test/api/test_components/__init__.py diff --git a/pandapipes/test/api/test_components/test_circ_pump_mass.py b/src/pandapipes/test/api/test_components/test_circ_pump_mass.py similarity index 100% rename from pandapipes/test/api/test_components/test_circ_pump_mass.py rename to src/pandapipes/test/api/test_components/test_circ_pump_mass.py diff --git a/pandapipes/test/api/test_components/test_circ_pump_pressure.py b/src/pandapipes/test/api/test_components/test_circ_pump_pressure.py similarity index 100% rename from pandapipes/test/api/test_components/test_circ_pump_pressure.py rename to src/pandapipes/test/api/test_components/test_circ_pump_pressure.py diff --git a/pandapipes/test/api/test_components/test_compressor.py b/src/pandapipes/test/api/test_components/test_compressor.py similarity index 100% rename from pandapipes/test/api/test_components/test_compressor.py rename to src/pandapipes/test/api/test_components/test_compressor.py diff --git a/pandapipes/test/api/test_components/test_ext_grid.py b/src/pandapipes/test/api/test_components/test_ext_grid.py similarity index 100% rename from pandapipes/test/api/test_components/test_ext_grid.py rename to src/pandapipes/test/api/test_components/test_ext_grid.py diff --git a/pandapipes/test/api/test_components/test_flow_control.py b/src/pandapipes/test/api/test_components/test_flow_control.py similarity index 100% rename from pandapipes/test/api/test_components/test_flow_control.py rename to src/pandapipes/test/api/test_components/test_flow_control.py diff --git a/pandapipes/test/api/test_components/test_heat_exchanger.py b/src/pandapipes/test/api/test_components/test_heat_exchanger.py similarity index 100% rename from pandapipes/test/api/test_components/test_heat_exchanger.py rename to src/pandapipes/test/api/test_components/test_heat_exchanger.py diff --git a/pandapipes/test/api/test_components/test_mass_storage.py b/src/pandapipes/test/api/test_components/test_mass_storage.py similarity index 100% rename from pandapipes/test/api/test_components/test_mass_storage.py rename to src/pandapipes/test/api/test_components/test_mass_storage.py diff --git a/pandapipes/test/api/test_components/test_pipe_results.py b/src/pandapipes/test/api/test_components/test_pipe_results.py similarity index 100% rename from pandapipes/test/api/test_components/test_pipe_results.py rename to src/pandapipes/test/api/test_components/test_pipe_results.py diff --git a/pandapipes/test/api/test_components/test_pressure_control.py b/src/pandapipes/test/api/test_components/test_pressure_control.py similarity index 100% rename from pandapipes/test/api/test_components/test_pressure_control.py rename to src/pandapipes/test/api/test_components/test_pressure_control.py diff --git a/pandapipes/test/api/test_components/test_pump.py b/src/pandapipes/test/api/test_components/test_pump.py similarity index 100% rename from pandapipes/test/api/test_components/test_pump.py rename to src/pandapipes/test/api/test_components/test_pump.py diff --git a/pandapipes/test/api/test_components/test_valve.py b/src/pandapipes/test/api/test_components/test_valve.py similarity index 100% rename from pandapipes/test/api/test_components/test_valve.py rename to src/pandapipes/test/api/test_components/test_valve.py diff --git a/pandapipes/test/api/test_convert_format.py b/src/pandapipes/test/api/test_convert_format.py similarity index 100% rename from pandapipes/test/api/test_convert_format.py rename to src/pandapipes/test/api/test_convert_format.py diff --git a/pandapipes/test/api/test_create.py b/src/pandapipes/test/api/test_create.py similarity index 100% rename from pandapipes/test/api/test_create.py rename to src/pandapipes/test/api/test_create.py diff --git a/pandapipes/test/api/test_network_tables.py b/src/pandapipes/test/api/test_network_tables.py similarity index 100% rename from pandapipes/test/api/test_network_tables.py rename to src/pandapipes/test/api/test_network_tables.py diff --git a/pandapipes/test/api/test_special_networks.py b/src/pandapipes/test/api/test_special_networks.py similarity index 100% rename from pandapipes/test/api/test_special_networks.py rename to src/pandapipes/test/api/test_special_networks.py diff --git a/pandapipes/test/api/test_std_types.py b/src/pandapipes/test/api/test_std_types.py similarity index 100% rename from pandapipes/test/api/test_std_types.py rename to src/pandapipes/test/api/test_std_types.py diff --git a/pandapipes/test/api/test_time_series.py b/src/pandapipes/test/api/test_time_series.py similarity index 100% rename from pandapipes/test/api/test_time_series.py rename to src/pandapipes/test/api/test_time_series.py diff --git a/pandapipes/test/converter/__init__.py b/src/pandapipes/test/converter/__init__.py similarity index 100% rename from pandapipes/test/converter/__init__.py rename to src/pandapipes/test/converter/__init__.py diff --git a/pandapipes/test/converter/converter_test_files/Exampelonia_mini.csv b/src/pandapipes/test/converter/converter_test_files/Exampelonia_mini.csv similarity index 100% rename from pandapipes/test/converter/converter_test_files/Exampelonia_mini.csv rename to src/pandapipes/test/converter/converter_test_files/Exampelonia_mini.csv diff --git a/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_2valvepipe.csv b/src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_2valvepipe.csv similarity index 100% rename from pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_2valvepipe.csv rename to src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_2valvepipe.csv diff --git a/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_closed.csv b/src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_closed.csv similarity index 100% rename from pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_closed.csv rename to src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_closed.csv diff --git a/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_open.csv b/src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_open.csv similarity index 100% rename from pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_open.csv rename to src/pandapipes/test/converter/converter_test_files/Exampelonia_mini_with_valve_2sliders_open.csv diff --git a/pandapipes/test/converter/test_stanet_converter.py b/src/pandapipes/test/converter/test_stanet_converter.py similarity index 100% rename from pandapipes/test/converter/test_stanet_converter.py rename to src/pandapipes/test/converter/test_stanet_converter.py diff --git a/pandapipes/test/io/__init__.py b/src/pandapipes/test/io/__init__.py similarity index 100% rename from pandapipes/test/io/__init__.py rename to src/pandapipes/test/io/__init__.py diff --git a/pandapipes/test/io/test_file_io.py b/src/pandapipes/test/io/test_file_io.py similarity index 100% rename from pandapipes/test/io/test_file_io.py rename to src/pandapipes/test/io/test_file_io.py diff --git a/pandapipes/test/multinet/__init__.py b/src/pandapipes/test/multinet/__init__.py similarity index 100% rename from pandapipes/test/multinet/__init__.py rename to src/pandapipes/test/multinet/__init__.py diff --git a/pandapipes/test/multinet/test_control_multinet.py b/src/pandapipes/test/multinet/test_control_multinet.py similarity index 100% rename from pandapipes/test/multinet/test_control_multinet.py rename to src/pandapipes/test/multinet/test_control_multinet.py diff --git a/pandapipes/test/multinet/test_time_series_multinet.py b/src/pandapipes/test/multinet/test_time_series_multinet.py similarity index 100% rename from pandapipes/test/multinet/test_time_series_multinet.py rename to src/pandapipes/test/multinet/test_time_series_multinet.py diff --git a/pandapipes/test/networks/__init__.py b/src/pandapipes/test/networks/__init__.py similarity index 100% rename from pandapipes/test/networks/__init__.py rename to src/pandapipes/test/networks/__init__.py diff --git a/pandapipes/test/networks/test_networks.py b/src/pandapipes/test/networks/test_networks.py similarity index 100% rename from pandapipes/test/networks/test_networks.py rename to src/pandapipes/test/networks/test_networks.py diff --git a/pandapipes/test/openmodelica_comparison/__init__.py b/src/pandapipes/test/openmodelica_comparison/__init__.py similarity index 100% rename from pandapipes/test/openmodelica_comparison/__init__.py rename to src/pandapipes/test/openmodelica_comparison/__init__.py diff --git a/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py b/src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py similarity index 100% rename from pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py rename to src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py diff --git a/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py b/src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py similarity index 100% rename from pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py rename to src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py diff --git a/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py b/src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py similarity index 100% rename from pandapipes/test/openmodelica_comparison/test_water_openmodelica.py rename to src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py diff --git a/pandapipes/test/pipeflow_internals/__init__.py b/src/pandapipes/test/pipeflow_internals/__init__.py similarity index 100% rename from pandapipes/test/pipeflow_internals/__init__.py rename to src/pandapipes/test/pipeflow_internals/__init__.py diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_2zu_2ab_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_2zu_2ab_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_2zu_2ab_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_2zu_2ab_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_direction_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_direction_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_direction_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_masche_1load_direction_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_one_pipe_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_one_pipe_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_one_pipe_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_one_pipe_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_tee_2ab_1zu_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_tee_2ab_1zu_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_tee_2ab_1zu_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_tee_2ab_1zu_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/Temperature_tee_2zu_1ab_an.csv b/src/pandapipes/test/pipeflow_internals/data/Temperature_tee_2zu_1ab_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/Temperature_tee_2zu_1ab_an.csv rename to src/pandapipes/test/pipeflow_internals/data/Temperature_tee_2zu_1ab_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/ext_grid_p.csv b/src/pandapipes/test/pipeflow_internals/data/ext_grid_p.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/ext_grid_p.csv rename to src/pandapipes/test/pipeflow_internals/data/ext_grid_p.csv diff --git a/pandapipes/test/pipeflow_internals/data/gas_sections_an.csv b/src/pandapipes/test/pipeflow_internals/data/gas_sections_an.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/gas_sections_an.csv rename to src/pandapipes/test/pipeflow_internals/data/gas_sections_an.csv diff --git a/pandapipes/test/pipeflow_internals/data/heat_exchanger_test.csv b/src/pandapipes/test/pipeflow_internals/data/heat_exchanger_test.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/heat_exchanger_test.csv rename to src/pandapipes/test/pipeflow_internals/data/heat_exchanger_test.csv diff --git a/pandapipes/test/pipeflow_internals/data/hydraulics.csv b/src/pandapipes/test/pipeflow_internals/data/hydraulics.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/hydraulics.csv rename to src/pandapipes/test/pipeflow_internals/data/hydraulics.csv diff --git a/pandapipes/test/pipeflow_internals/data/pressure_control_test_analytical.csv b/src/pandapipes/test/pipeflow_internals/data/pressure_control_test_analytical.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/pressure_control_test_analytical.csv rename to src/pandapipes/test/pipeflow_internals/data/pressure_control_test_analytical.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_circ_pump_mass.csv b/src/pandapipes/test/pipeflow_internals/data/test_circ_pump_mass.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_circ_pump_mass.csv rename to src/pandapipes/test/pipeflow_internals/data/test_circ_pump_mass.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_circ_pump_pressure.csv b/src/pandapipes/test/pipeflow_internals/data/test_circ_pump_pressure.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_circ_pump_pressure.csv rename to src/pandapipes/test/pipeflow_internals/data/test_circ_pump_pressure.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_pressure_control.csv b/src/pandapipes/test/pipeflow_internals/data/test_pressure_control.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_pressure_control.csv rename to src/pandapipes/test/pipeflow_internals/data/test_pressure_control.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_pump.csv b/src/pandapipes/test/pipeflow_internals/data/test_pump.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_pump.csv rename to src/pandapipes/test/pipeflow_internals/data/test_pump.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_ext_grid/mdot_kg_per_s.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_ext_grid/mdot_kg_per_s.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_ext_grid/mdot_kg_per_s.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_ext_grid/mdot_kg_per_s.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_junction/p_bar.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_junction/p_bar.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_junction/p_bar.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_junction/p_bar.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/lambda.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/lambda.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/lambda.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/lambda.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/reynolds.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/reynolds.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/reynolds.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/reynolds.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/v_mean_m_per_s.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/v_mean_m_per_s.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/v_mean_m_per_s.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_pipe/v_mean_m_per_s.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_sink/mdot_kg_per_s.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_sink/mdot_kg_per_s.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_sink/mdot_kg_per_s.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_sink/mdot_kg_per_s.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_source/mdot_kg_per_s.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_source/mdot_kg_per_s.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_results/res_source/mdot_kg_per_s.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_results/res_source/mdot_kg_per_s.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_sink_profiles.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_sink_profiles.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_sink_profiles.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_sink_profiles.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_time_series_source_profiles.csv b/src/pandapipes/test/pipeflow_internals/data/test_time_series_source_profiles.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_time_series_source_profiles.csv rename to src/pandapipes/test/pipeflow_internals/data/test_time_series_source_profiles.csv diff --git a/pandapipes/test/pipeflow_internals/data/test_valve.csv b/src/pandapipes/test/pipeflow_internals/data/test_valve.csv similarity index 100% rename from pandapipes/test/pipeflow_internals/data/test_valve.csv rename to src/pandapipes/test/pipeflow_internals/data/test_valve.csv diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/src/pandapipes/test/pipeflow_internals/test_inservice.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_inservice.py rename to src/pandapipes/test/pipeflow_internals/test_inservice.py diff --git a/pandapipes/test/pipeflow_internals/test_non_convergence.py b/src/pandapipes/test/pipeflow_internals/test_non_convergence.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_non_convergence.py rename to src/pandapipes/test/pipeflow_internals/test_non_convergence.py diff --git a/pandapipes/test/pipeflow_internals/test_options.py b/src/pandapipes/test/pipeflow_internals/test_options.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_options.py rename to src/pandapipes/test/pipeflow_internals/test_options.py diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py b/src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py rename to src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py diff --git a/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py b/src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_pipeflow_modes.py rename to src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py diff --git a/pandapipes/test/pipeflow_internals/test_time_series.py b/src/pandapipes/test/pipeflow_internals/test_time_series.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_time_series.py rename to src/pandapipes/test/pipeflow_internals/test_time_series.py diff --git a/pandapipes/test/pipeflow_internals/test_update_matrix.py b/src/pandapipes/test/pipeflow_internals/test_update_matrix.py similarity index 100% rename from pandapipes/test/pipeflow_internals/test_update_matrix.py rename to src/pandapipes/test/pipeflow_internals/test_update_matrix.py diff --git a/pandapipes/test/plotting/__init__.py b/src/pandapipes/test/plotting/__init__.py similarity index 100% rename from pandapipes/test/plotting/__init__.py rename to src/pandapipes/test/plotting/__init__.py diff --git a/pandapipes/test/plotting/test_collections.py b/src/pandapipes/test/plotting/test_collections.py similarity index 100% rename from pandapipes/test/plotting/test_collections.py rename to src/pandapipes/test/plotting/test_collections.py diff --git a/pandapipes/test/plotting/test_generic_coordinates.py b/src/pandapipes/test/plotting/test_generic_coordinates.py similarity index 100% rename from pandapipes/test/plotting/test_generic_coordinates.py rename to src/pandapipes/test/plotting/test_generic_coordinates.py diff --git a/pandapipes/test/plotting/test_pipeflow_results.py b/src/pandapipes/test/plotting/test_pipeflow_results.py similarity index 100% rename from pandapipes/test/plotting/test_pipeflow_results.py rename to src/pandapipes/test/plotting/test_pipeflow_results.py diff --git a/pandapipes/test/plotting/test_simple_collections.py b/src/pandapipes/test/plotting/test_simple_collections.py similarity index 100% rename from pandapipes/test/plotting/test_simple_collections.py rename to src/pandapipes/test/plotting/test_simple_collections.py diff --git a/pandapipes/test/properties/__init__.py b/src/pandapipes/test/properties/__init__.py similarity index 100% rename from pandapipes/test/properties/__init__.py rename to src/pandapipes/test/properties/__init__.py diff --git a/pandapipes/test/properties/test_fluid_specials.py b/src/pandapipes/test/properties/test_fluid_specials.py similarity index 100% rename from pandapipes/test/properties/test_fluid_specials.py rename to src/pandapipes/test/properties/test_fluid_specials.py diff --git a/pandapipes/test/properties/test_properties_toolbox.py b/src/pandapipes/test/properties/test_properties_toolbox.py similarity index 100% rename from pandapipes/test/properties/test_properties_toolbox.py rename to src/pandapipes/test/properties/test_properties_toolbox.py diff --git a/pandapipes/test/pytest.ini b/src/pandapipes/test/pytest.ini similarity index 100% rename from pandapipes/test/pytest.ini rename to src/pandapipes/test/pytest.ini diff --git a/pandapipes/test/run_tests.py b/src/pandapipes/test/run_tests.py similarity index 100% rename from pandapipes/test/run_tests.py rename to src/pandapipes/test/run_tests.py diff --git a/pandapipes/test/stanet_comparison/__init__.py b/src/pandapipes/test/stanet_comparison/__init__.py similarity index 100% rename from pandapipes/test/stanet_comparison/__init__.py rename to src/pandapipes/test/stanet_comparison/__init__.py diff --git a/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py b/src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py similarity index 100% rename from pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py rename to src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py diff --git a/pandapipes/test/stanet_comparison/test_gas_stanet.py b/src/pandapipes/test/stanet_comparison/test_gas_stanet.py similarity index 100% rename from pandapipes/test/stanet_comparison/test_gas_stanet.py rename to src/pandapipes/test/stanet_comparison/test_gas_stanet.py diff --git a/pandapipes/test/stanet_comparison/test_water_stanet.py b/src/pandapipes/test/stanet_comparison/test_water_stanet.py similarity index 100% rename from pandapipes/test/stanet_comparison/test_water_stanet.py rename to src/pandapipes/test/stanet_comparison/test_water_stanet.py diff --git a/pandapipes/test/test_imports.py b/src/pandapipes/test/test_imports.py similarity index 100% rename from pandapipes/test/test_imports.py rename to src/pandapipes/test/test_imports.py diff --git a/pandapipes/test/test_toolbox.py b/src/pandapipes/test/test_toolbox.py similarity index 100% rename from pandapipes/test/test_toolbox.py rename to src/pandapipes/test/test_toolbox.py diff --git a/pandapipes/test/topology/__init__.py b/src/pandapipes/test/topology/__init__.py similarity index 100% rename from pandapipes/test/topology/__init__.py rename to src/pandapipes/test/topology/__init__.py diff --git a/pandapipes/test/topology/test_graph_searches.py b/src/pandapipes/test/topology/test_graph_searches.py similarity index 100% rename from pandapipes/test/topology/test_graph_searches.py rename to src/pandapipes/test/topology/test_graph_searches.py diff --git a/pandapipes/test/topology/test_nxgraph.py b/src/pandapipes/test/topology/test_nxgraph.py similarity index 100% rename from pandapipes/test/topology/test_nxgraph.py rename to src/pandapipes/test/topology/test_nxgraph.py diff --git a/pandapipes/timeseries/__init__.py b/src/pandapipes/timeseries/__init__.py similarity index 100% rename from pandapipes/timeseries/__init__.py rename to src/pandapipes/timeseries/__init__.py diff --git a/pandapipes/timeseries/run_time_series.py b/src/pandapipes/timeseries/run_time_series.py similarity index 100% rename from pandapipes/timeseries/run_time_series.py rename to src/pandapipes/timeseries/run_time_series.py diff --git a/pandapipes/toolbox.py b/src/pandapipes/toolbox.py similarity index 100% rename from pandapipes/toolbox.py rename to src/pandapipes/toolbox.py diff --git a/pandapipes/topology/__init__.py b/src/pandapipes/topology/__init__.py similarity index 100% rename from pandapipes/topology/__init__.py rename to src/pandapipes/topology/__init__.py diff --git a/pandapipes/topology/create_graph.py b/src/pandapipes/topology/create_graph.py similarity index 100% rename from pandapipes/topology/create_graph.py rename to src/pandapipes/topology/create_graph.py diff --git a/pandapipes/topology/graph_searches.py b/src/pandapipes/topology/graph_searches.py similarity index 100% rename from pandapipes/topology/graph_searches.py rename to src/pandapipes/topology/graph_searches.py From 893452481d923f02cd7044de1f9a95698228d3ab Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 15:01:19 +0100 Subject: [PATCH 101/126] removing pytest.ini, restructuring setup.py slighly and adapt MANIFEST.in to just consider all files in src --- MANIFEST.in | 8 ++------ pytest.ini | 3 --- setup.py | 7 ++++--- 3 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 pytest.ini diff --git a/MANIFEST.in b/MANIFEST.in index 4c6085d5a..9a3b2f780 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,7 +1,3 @@ -include LICENSE AUTHORS README.rst CHANGELOG.rst .github/**/*.yml -global-include *.json -global-include *.csv -global-include *.txt +graft src -prune doc* -prune tutorials* +include LICENSE AUTHORS README.rst CHANGELOG.rst .github/**/*.yml diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index a01d26adf..000000000 --- a/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -python_paths = . .. -site_dirs = . .. \ No newline at end of file diff --git a/setup.py b/setup.py index 5ad029dc3..46526a0b4 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +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. +import re + from setuptools import find_namespace_packages from setuptools import setup -import re with open('README.rst', 'rb') as f: install = f.read().decode('utf-8') @@ -40,7 +41,7 @@ 'jolando.kisse@uni-kassel.de', description='A pipeflow calculation tool that complements pandapower in the simulation of multi energy grids', long_description=long_description, - long_description_content_type='text/x-rst', + long_description_content_type='text/x-rst', url='http://www.pandapipes.org', license='BSD', install_requires=["pandapower>=2.11.1", "matplotlib", "shapely"], @@ -50,7 +51,7 @@ "all": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex", "plotly", "igraph", "pytest", "pytest-xdist", "nbmake"]}, packages=find_namespace_packages(where='src'), - package_dir={"":"src"}, + package_dir={"": "src"}, include_package_data=True, classifiers=classifiers ) From a70f32cd9d93926a944e9333d07e5a35c03d7db3 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 15:36:48 +0100 Subject: [PATCH 102/126] change pandapipes reference in tutorial test --- tutorials/standard_libraries.ipynb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tutorials/standard_libraries.ipynb b/tutorials/standard_libraries.ipynb index bad801240..2f4d2ef11 100644 --- a/tutorials/standard_libraries.ipynb +++ b/tutorials/standard_libraries.ipynb @@ -36,8 +36,13 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", + "\n", "from pandapipes.std_types.std_type_class import get_data\n", - "print(get_data(r'../pandapipes/std_types/library/Pipe.csv', 'pipe'))" + "from pandapipes import pp_dir\n", + "\n", + "path = os.path.join(pp_dir, 'std_types/library/Pipe.csv')\n", + "print(get_data(path, 'pipe'))" ] }, { @@ -124,7 +129,8 @@ "metadata": {}, "outputs": [], "source": [ - "print(get_data(r'../pandapipes/std_types/library/Pump/P1.csv', 'pump'))" + "path = os.path.join(pp_dir, 'std_types/library/Pump/P1.csv')\n", + "print(get_data(path, 'pump'))" ] }, { From b84a6b70f414c2b9f9dcdb425d4b33e67353a152 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Wed, 13 Dec 2023 16:14:22 +0100 Subject: [PATCH 103/126] remove pytest.ini from tutorials --- tutorials/pytest.ini | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 tutorials/pytest.ini diff --git a/tutorials/pytest.ini b/tutorials/pytest.ini deleted file mode 100644 index a01d26adf..000000000 --- a/tutorials/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -python_paths = . .. -site_dirs = . .. \ No newline at end of file From f1d9ba74413bd7f912f5f8446c00253f25cdf80d Mon Sep 17 00:00:00 2001 From: dlohmeier Date: Thu, 14 Dec 2023 16:05:17 +0100 Subject: [PATCH 104/126] switch pump junctions in DHN tutorial; closes #580 --- tutorials/circular_flow_in_a_district_heating_grid.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/circular_flow_in_a_district_heating_grid.ipynb b/tutorials/circular_flow_in_a_district_heating_grid.ipynb index 5fe99d839..a06e23669 100644 --- a/tutorials/circular_flow_in_a_district_heating_grid.ipynb +++ b/tutorials/circular_flow_in_a_district_heating_grid.ipynb @@ -71,7 +71,7 @@ "metadata": {}, "outputs": [], "source": [ - "pp.create_circ_pump_const_mass_flow(net, return_junction=j0, flow_junction=j3, p_flow_bar=5,\n", + "pp.create_circ_pump_const_mass_flow(net, return_junction=j3, flow_junction=j0, p_flow_bar=5,\n", " mdot_flow_kg_per_s=20, t_flow_k=273.15+35)" ] }, From 6fec1cf1545929ec74a2d1a15b597b3575f5827c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 15 Dec 2023 20:53:08 +0100 Subject: [PATCH 105/126] converged is explicit. Only under net defined. --- pandapipes/pf/pipeflow_setup.py | 2 +- pandapipes/pipeflow.py | 38 ++++++++------------ pandapipes/test/api/test_special_networks.py | 2 +- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 713f05be8..795fbabda 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -31,7 +31,7 @@ logger = logging.getLogger(__name__) -default_options = {"friction_model": "nikuradse", "converged": False, "tol_p": 1e-4, "tol_v": 1e-4, +default_options = {"friction_model": "nikuradse", "tol_p": 1e-4, "tol_v": 1e-4, "tol_T": 1e-3, "tol_res": 1e-3, "iter": 10, "error_flag": False, "alpha": 1, "nonlinear_method": "constant", "mode": "hydraulics", "ambient_temperature": 293, "check_connectivity": True, diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index aa9f49947..6f1184929 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -65,7 +65,7 @@ def pipeflow(net, sol_vec=None, **kwargs): init_options(net, local_params) # init result tables - net["converged"] = False + net.converged = False init_all_result_tables(net) create_lookups(net) @@ -90,8 +90,8 @@ def pipeflow(net, sol_vec=None, **kwargs): if calculate_hydraulics: reduce_pit(net, node_pit, branch_pit, mode="hydraulics") - converged, _ = hydraulics(net) - if not converged: + hydraulics(net) + if not net.converged: raise PipeflowNotConverged("The hydraulic calculation did not converge to a solution.") extract_results_active_pit(net, mode="hydraulics") @@ -99,8 +99,8 @@ def pipeflow(net, sol_vec=None, **kwargs): node_pit, branch_pit = net["_pit"]["node"], net["_pit"]["branch"] identify_active_nodes_branches(net, branch_pit, node_pit, False) reduce_pit(net, node_pit, branch_pit, mode="heat_transfer") - converged, _ = heat_transfer(net) - if not converged: + heat_transfer(net) + if not net.converged: raise PipeflowNotConverged("The heat transfer calculation did not converge to a " "solution.") extract_results_active_pit(net, mode="heat_transfer") @@ -125,7 +125,7 @@ def hydraulics(net): error_v, error_p, residual_norm = [], [], None # This loop is left as soon as the solver converged - while not get_net_option(net, "converged") and niter <= max_iter: + while not net.converged and niter <= max_iter: logger.debug("niter %d" % niter) # solve_hydraulics is where the calculation takes place @@ -145,17 +145,13 @@ def hydraulics(net): write_internal_results(net, iterations=niter, error_p=error_p[niter - 1], error_v=error_v[niter - 1], residual_norm=residual_norm) - converged = get_net_option(net, "converged") - net['converged'] = converged - if converged: + if net.converged: set_user_pf_options(net, hyd_flag=True) - log_final_results(net, converged, niter, residual_norm) + log_final_results(net, niter, residual_norm) if not get_net_option(net, "reuse_internal_data"): net.pop("_internal_data", None) - return converged, niter - def heat_transfer(net): max_iter, nonlinear_method, tol_t, tol_res = get_net_options( @@ -170,11 +166,11 @@ def heat_transfer(net): error_t, error_t_out, residual_norm = [], [], None - set_net_option(net, "converged", False) + net.converged = False niter = 0 # This loop is left as soon as the solver converged - while not get_net_option(net, "converged") and niter <= max_iter: + while not net.converged and niter <= max_iter: logger.debug("niter %d" % niter) # solve_hydraulics is where the calculation takes place @@ -198,11 +194,7 @@ def heat_transfer(net): write_internal_results(net, iterations_T=niter, error_T=error_t[niter - 1], residual_norm_T=residual_norm) - converged = get_net_option(net, "converged") - net['converged'] = converged - log_final_results(net, converged, niter, residual_norm, hyraulic_mode=False) - - return converged, niter + log_final_results(net, niter, residual_norm, hyraulic_mode=False) def solve_hydraulics(net): @@ -334,9 +326,9 @@ def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_me # Setting convergence flag if error_2[niter] <= tol_2 and error_1[niter] <= tol_1 and residual_norm < tol_res: if nonlinear_method != "automatic": - set_net_option(net, "converged", True) + net.converged = True elif get_net_option(net, "alpha") == 1: - set_net_option(net, "converged", True) + net.converged = True if hydraulic_mode: logger.debug("errorv: %s" % error_1[niter]) @@ -347,7 +339,7 @@ def finalize_iteration(net, niter, error_1, error_2, residual_norm, nonlinear_me logger.debug("alpha: %s" % get_net_option(net, "alpha")) -def log_final_results(net, converged, niter, residual_norm, hyraulic_mode=True): +def log_final_results(net, niter, residual_norm, hyraulic_mode=True): if hyraulic_mode: solver = "hydraulics" outputs = ["tol_p", "tol_v"] @@ -355,7 +347,7 @@ def log_final_results(net, converged, niter, residual_norm, hyraulic_mode=True): solver = "heat transfer" outputs = ["tol_T"] logger.debug("--------------------------------------------------------------------------------") - if not converged: + if not net.converged: logger.debug("Maximum number of iterations reached but %s solver did not converge." % solver) logger.debug("Norm of residual: %s" % residual_norm) diff --git a/pandapipes/test/api/test_special_networks.py b/pandapipes/test/api/test_special_networks.py index 0015844e4..1b09cd661 100644 --- a/pandapipes/test/api/test_special_networks.py +++ b/pandapipes/test/api/test_special_networks.py @@ -117,7 +117,7 @@ def test_wild_indexing(create_net_changed_indices): net = copy.deepcopy(create_net_changed_indices) pandapipes.pipeflow(net) - assert net["converged"] + assert net.converged if __name__ == "__main__": From 0c931724bff99fa5e137093030c926ee2272d0e4 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 19 Dec 2023 11:52:46 +0100 Subject: [PATCH 106/126] remove logger set level --- src/pandapipes/multinet/create_multinet.py | 1 - src/pandapipes/timeseries/run_time_series.py | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/pandapipes/multinet/create_multinet.py b/src/pandapipes/multinet/create_multinet.py index 4a5352a5c..64a31df44 100644 --- a/src/pandapipes/multinet/create_multinet.py +++ b/src/pandapipes/multinet/create_multinet.py @@ -12,7 +12,6 @@ import logging logger = logging.getLogger(__name__) -logger.setLevel(level=logging.WARNING) def create_empty_multinet(name=""): diff --git a/src/pandapipes/timeseries/run_time_series.py b/src/pandapipes/timeseries/run_time_series.py index beab805e1..60ca01cdc 100644 --- a/src/pandapipes/timeseries/run_time_series.py +++ b/src/pandapipes/timeseries/run_time_series.py @@ -4,12 +4,11 @@ import tempfile -from pandapower.control import NetCalculationNotConverged - from pandapipes.pipeflow import PipeflowNotConverged, pipeflow +from pandapower.control import NetCalculationNotConverged from pandapower.control.util.diagnostic import control_diagnostic from pandapower.timeseries.output_writer import OutputWriter -from pandapower.timeseries.run_time_series import init_time_series as init_time_series_pp, cleanup,\ +from pandapower.timeseries.run_time_series import init_time_series as init_time_series_pp, cleanup, \ run_loop try: @@ -18,7 +17,6 @@ import logging logger = logging.getLogger(__name__) -logger.setLevel(level=logging.WARNING) def init_default_outputwriter(net, time_steps, **kwargs): From 2d33bc975379a3e4bcdad7ec1e90e643257183d1 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 19 Dec 2023 13:11:33 +0100 Subject: [PATCH 107/126] - move Pipeflow Exception into pipeflow setup - improve pipeflow oos test - remove logger setups as they are not working --- pandapipes/pf/pipeflow_setup.py | 19 ++++++++++-- pandapipes/pipeflow.py | 19 +++--------- .../test/pipeflow_internals/test_inservice.py | 30 ++++++++++++------- pandapipes/timeseries/run_time_series.py | 7 ++--- 4 files changed, 42 insertions(+), 33 deletions(-) diff --git a/pandapipes/pf/pipeflow_setup.py b/pandapipes/pf/pipeflow_setup.py index 4034bbb39..1b314a462 100644 --- a/pandapipes/pf/pipeflow_setup.py +++ b/pandapipes/pf/pipeflow_setup.py @@ -6,6 +6,7 @@ import inspect import numpy as np +from pandapower.auxiliary import ppException from scipy.sparse import coo_matrix, csgraph from pandapipes.idx_branch import FROM_NODE, TO_NODE, branch_cols, \ @@ -22,6 +23,7 @@ numba_installed = True except ImportError: from pandapower.pf.no_numba import jit + numba_installed = False try: @@ -496,9 +498,13 @@ def identify_active_nodes_branches(net, branch_pit, node_pit, hydraulic=True): # here, any value between 0 and 1 should work, excluding 0 and 1) nodes_connected[fn_tn] = nodes_connected[fn_tn] & (flow > 0.1) mode = "hydraulics" if hydraulic else "heat_transfer" + if np.all(~nodes_connected): + mode = 'hydraulic' if hydraulic else 'heat transfer' + raise PipeflowNotConverged(" All nodes are set out of service. Probably they are not supplied." + " Therefore, the %s pipeflow did not converge. " + " Have you forgotten to define an external grid?" % mode) net["_lookups"]["node_active_" + mode] = nodes_connected net["_lookups"]["branch_active_" + mode] = branches_connected - return node_pit[nodes_connected], branch_pit[branches_connected] def branches_connected_flow(branch_pit): @@ -552,7 +558,7 @@ def check_connectivity(net, branch_pit, node_pit, mode="hydraulics"): else: active_branch_lookup = branches_connected_flow(branch_pit) \ & get_lookup(net, "branch", "active_hydraulics") - active_node_lookup = node_pit[:, ACTIVE_ND].astype(np.bool_)\ + active_node_lookup = node_pit[:, ACTIVE_ND].astype(np.bool_) \ & get_lookup(net, "node", "active_hydraulics") slacks = np.where((node_pit[:, NODE_TYPE_T] == T) & active_node_lookup)[0] @@ -635,7 +641,7 @@ def get_table_index_list(net, pit_array, pit_indices, pit_type="node"): tables = np.unique(int_pit[:, TABLE_IDX_ND]) table_lookup = get_lookup(net, pit_type, "table") return [(get_table_name(table_lookup, tbl), list(int_pit[int_pit[:, TABLE_IDX_ND] == tbl, - ELEMENT_IDX_ND].astype(np.int32))) + ELEMENT_IDX_ND].astype(np.int32))) for tbl in tables] @@ -710,3 +716,10 @@ def reduce_pit(net, node_pit, branch_pit, mode="hydraulics"): from_to_active_lookup[table] = (count, count + len_new) count += len_new net["_lookups"]["%s_from_to_active_%s" % (el, mode)] = from_to_active_lookup + + +class PipeflowNotConverged(ppException): + """ + Exception being raised in case pipeflow did not converge. + """ + pass diff --git a/pandapipes/pipeflow.py b/pandapipes/pipeflow.py index 886ed571e..4dab2f9f1 100644 --- a/pandapipes/pipeflow.py +++ b/pandapipes/pipeflow.py @@ -13,9 +13,8 @@ from pandapipes.pf.pipeflow_setup import get_net_option, get_net_options, set_net_option, \ init_options, create_internal_results, write_internal_results, get_lookup, create_lookups, \ initialize_pit, reduce_pit, set_user_pf_options, init_all_result_tables, \ - identify_active_nodes_branches + identify_active_nodes_branches, PipeflowNotConverged from pandapipes.pf.result_extraction import extract_all_results, extract_results_active_pit -from pandapower.auxiliary import ppException try: import pandaplan.core.pplog as logging @@ -80,12 +79,9 @@ def pipeflow(net, sol_vec=None, **kwargs): calculate_hydraulics = calculation_mode in ["hydraulics", "all"] calculate_heat = calculation_mode in ["heat", "all"] - active_node_pit, active_branch_pit = identify_active_nodes_branches(net, branch_pit, node_pit) - - if (len(active_node_pit) == 0): - logger.warning(" All nodes are out of service. Probably they are not supplied." - " Have you forgotten to define an external grid?") - return + # cannot be moved to calculate_hydraulics as the active node/branch hydraulics lookup is also required to + # determine the active node/branch heat transfer lookup + identify_active_nodes_branches(net, branch_pit, node_pit) if calculation_mode == "heat": if not net.user_pf_options["hyd_flag"]: @@ -364,10 +360,3 @@ def log_final_results(net, niter, residual_norm, hyraulic_mode=True): logger.debug("Norm of residual: %s" % residual_norm) for out in outputs: logger.debug("%s: %s" % (out, get_net_option(net, out))) - - -class PipeflowNotConverged(ppException): - """ - Exception being raised in case pipeflow did not converge. - """ - pass diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index 54acfaf78..d9dd025a6 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -126,7 +126,7 @@ def create_mixed_indexing_grid(): @pytest.fixture -def create_net_wo_external_hydraulic_grid(): +def create_net_wo_ext_grid(): net = pandapipes.create_empty_network("net", add_stdtypes=False) pandapipes.create_fluid_from_lib(net, "hgas", overwrite=True) pandapipes.create_junction(net, index=3, pn_bar=16, tfluid_k=283, height_m=0, @@ -144,7 +144,6 @@ def create_net_wo_external_hydraulic_grid(): pandapipes.create_source(net, junction=10, mdot_kg_per_s=0.04, name="Source 3") pandapipes.create_compressor(net, from_junction=9, to_junction=3, pressure_ratio=1.1, name="Compressor 0", index=None, in_service=True) - pandapipes.create_ext_grid(net, junction=3, t_k=300) return net @@ -606,15 +605,24 @@ def test_mixed_indexing_oos6(create_mixed_indexing_grid, use_numba): @pytest.mark.parametrize("use_numba", [True, False]) -def test_pipeflow_cancellation(create_net_wo_external_hydraulic_grid, use_numba): - net = create_net_wo_external_hydraulic_grid - pandapipes.pipeflow(net) - assert np.all(np.isnan(net.res_junction)) - assert np.all(np.isnan(net.res_pipe)) - assert np.all(np.isnan(net.res_ext_grid)) - assert np.all(np.isnan(net.res_sink)) - assert np.all(np.isnan(net.res_source)) - assert np.all(np.isnan(net.res_compressor)) +def test_pipeflow_all_oos(create_net_wo_ext_grid, use_numba): + net = create_net_wo_ext_grid + ex1 = pandapipes.create_ext_grid(net, junction=3, t_k=300) + ex2 = pandapipes.create_ext_grid(net, junction=3, p_bar=1) + with pytest.raises(PipeflowNotConverged): + net.ext_grid.at[ex2, 'in_service'] = False + pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", + use_numba=use_numba, check_connectivity=True) + net.ext_grid.at[ex1, 'in_service'] = False + net.ext_grid.at[ex2, 'in_service'] = True + + pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", + use_numba=use_numba, check_connectivity=True) + assert not np.all(np.isnan(net.res_junction.p_bar.values)) + + with pytest.raises(PipeflowNotConverged): + pandapipes.pipeflow(net, mode='all', iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", + use_numba=use_numba, check_connectivity=True) if __name__ == "__main__": diff --git a/pandapipes/timeseries/run_time_series.py b/pandapipes/timeseries/run_time_series.py index beab805e1..590608df4 100644 --- a/pandapipes/timeseries/run_time_series.py +++ b/pandapipes/timeseries/run_time_series.py @@ -5,20 +5,19 @@ import tempfile from pandapower.control import NetCalculationNotConverged - -from pandapipes.pipeflow import PipeflowNotConverged, pipeflow from pandapower.control.util.diagnostic import control_diagnostic from pandapower.timeseries.output_writer import OutputWriter -from pandapower.timeseries.run_time_series import init_time_series as init_time_series_pp, cleanup,\ +from pandapower.timeseries.run_time_series import init_time_series as init_time_series_pp, cleanup, \ run_loop +from pandapipes.pipeflow import PipeflowNotConverged, pipeflow + try: import pandaplan.core.pplog as logging except ImportError: import logging logger = logging.getLogger(__name__) -logger.setLevel(level=logging.WARNING) def init_default_outputwriter(net, time_steps, **kwargs): From fc285771305e16018f196bb2d8c228e2a8270c27 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Tue, 19 Dec 2023 13:19:56 +0100 Subject: [PATCH 108/126] - assert the net.converged is set correctly --- pandapipes/test/pipeflow_internals/test_inservice.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandapipes/test/pipeflow_internals/test_inservice.py b/pandapipes/test/pipeflow_internals/test_inservice.py index d9dd025a6..f7521d0db 100644 --- a/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/pandapipes/test/pipeflow_internals/test_inservice.py @@ -613,16 +613,19 @@ def test_pipeflow_all_oos(create_net_wo_ext_grid, use_numba): net.ext_grid.at[ex2, 'in_service'] = False pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", use_numba=use_numba, check_connectivity=True) + assert ~net.converged net.ext_grid.at[ex1, 'in_service'] = False net.ext_grid.at[ex2, 'in_service'] = True pandapipes.pipeflow(net, iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", use_numba=use_numba, check_connectivity=True) assert not np.all(np.isnan(net.res_junction.p_bar.values)) + assert net.converged with pytest.raises(PipeflowNotConverged): pandapipes.pipeflow(net, mode='all', iter=100, tol_p=1e-7, tol_v=1e-7, friction_model="nikuradse", use_numba=use_numba, check_connectivity=True) + assert ~net.converged if __name__ == "__main__": From 60761fb7454c4520134096d8daa51bd8cc1ff877 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 12:53:12 +0100 Subject: [PATCH 109/126] clean repo and adapt changelog slightly --- CHANGELOG.rst | 1 + .../multinet/timeseries/run_time_series_multinet.py | 11 ++++++----- .../biomethane_pure/lower_heating_value.txt | 0 .../biomethane_treated/lower_heating_value.txt | 0 4 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 src/pandapipes/properties/biomethane_pure/lower_heating_value.txt delete mode 100644 src/pandapipes/properties/biomethane_treated/lower_heating_value.txt diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 58ff9bc6f..cd80ea5df 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,7 @@ Change Log ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) +- [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service (heat and hydraulic) - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables diff --git a/src/pandapipes/multinet/timeseries/run_time_series_multinet.py b/src/pandapipes/multinet/timeseries/run_time_series_multinet.py index 7394a7780..f3697022c 100644 --- a/src/pandapipes/multinet/timeseries/run_time_series_multinet.py +++ b/src/pandapipes/multinet/timeseries/run_time_series_multinet.py @@ -3,6 +3,8 @@ # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. import tqdm +from pandapipes.multinet.control.run_control_multinet import prepare_run_ctrl, run_control +from pandapipes.timeseries.run_time_series import init_default_outputwriter as init_default_ow_pps from pandapower import pandapowerNet from pandapower.control.util.diagnostic import control_diagnostic from pandapower.timeseries.run_time_series import get_recycle_settings, init_time_steps, \ @@ -10,8 +12,6 @@ init_output_writer from pandapipes import pandapipesNet -from pandapipes.multinet.control.run_control_multinet import prepare_run_ctrl, run_control -from pandapipes.timeseries.run_time_series import init_default_outputwriter as init_default_ow_pps try: import pandaplan.core.pplog as pplog @@ -19,7 +19,6 @@ import logging as pplog logger = pplog.getLogger(__name__) -logger.setLevel(level=pplog.WARNING) def _call_output_writer(multinet, time_step, pf_converged, ctrl_converged, ts_variables): @@ -41,7 +40,8 @@ def _call_output_writer(multinet, time_step, pf_converged, ctrl_converged, ts_va """ for net_name in multinet['nets'].keys(): net = multinet['nets'][net_name] - output_writer_routine(net, time_step, pf_converged, ctrl_converged, ts_variables['nets'][net_name]["recycle_options"]) + output_writer_routine(net, time_step, pf_converged, ctrl_converged, + ts_variables['nets'][net_name]["recycle_options"]) def init_time_series(multinet, time_steps, continue_on_divergence=False, verbose=True, @@ -81,7 +81,8 @@ def init_time_series(multinet, time_steps, continue_on_divergence=False, verbose if hasattr(run, "__name__") and run.__name__ == "runpp": # use faster runpp options if possible recycle_options = get_recycle_settings(net, **kwargs) - ts_variables['nets'][net_name]['run'] = run[net_name] if run is not None else ts_variables['nets'][net_name]['run'] + ts_variables['nets'][net_name]['run'] = run[ + net_name] if run is not None else ts_variables['nets'][net_name]['run'] ts_variables['nets'][net_name]['recycle_options'] = recycle_options init_output_writer(net, time_steps) diff --git a/src/pandapipes/properties/biomethane_pure/lower_heating_value.txt b/src/pandapipes/properties/biomethane_pure/lower_heating_value.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/pandapipes/properties/biomethane_treated/lower_heating_value.txt b/src/pandapipes/properties/biomethane_treated/lower_heating_value.txt deleted file mode 100644 index e69de29bb..000000000 From 9ee69d823458367719020b2598ccec18940eb1bc Mon Sep 17 00:00:00 2001 From: eprade Date: Thu, 21 Dec 2023 13:17:01 +0100 Subject: [PATCH 110/126] -changed copyright year --- doc/source/conf.py | 2 +- setup.py | 2 +- src/pandapipes/__init__.py | 2 +- src/pandapipes/component_models/__init__.py | 2 +- .../component_models/circulation_pump_mass_component.py | 2 +- .../component_models/circulation_pump_pressure_component.py | 2 +- src/pandapipes/component_models/component_toolbox.py | 2 +- src/pandapipes/component_models/compressor_component.py | 2 +- src/pandapipes/component_models/ext_grid_component.py | 2 +- src/pandapipes/component_models/flow_control_component.py | 2 +- src/pandapipes/component_models/heat_exchanger_component.py | 2 +- src/pandapipes/component_models/junction_component.py | 2 +- src/pandapipes/component_models/mass_storage_component.py | 2 +- src/pandapipes/component_models/pipe_component.py | 2 +- src/pandapipes/component_models/pressure_control_component.py | 2 +- src/pandapipes/component_models/pump_component.py | 2 +- src/pandapipes/component_models/sink_component.py | 2 +- src/pandapipes/component_models/source_component.py | 2 +- src/pandapipes/component_models/valve_component.py | 2 +- src/pandapipes/constants.py | 2 +- src/pandapipes/control/__init__.py | 2 +- src/pandapipes/control/run_control.py | 2 +- src/pandapipes/converter/__init__.py | 2 +- src/pandapipes/create.py | 2 +- src/pandapipes/idx_branch.py | 2 +- src/pandapipes/idx_node.py | 2 +- src/pandapipes/io/__init__.py | 2 +- src/pandapipes/io/convert_format.py | 2 +- src/pandapipes/io/file_io.py | 2 +- src/pandapipes/io/io_utils.py | 2 +- src/pandapipes/multinet/__init__.py | 2 +- src/pandapipes/multinet/control/__init__.py | 2 +- src/pandapipes/multinet/control/run_control_multinet.py | 2 +- src/pandapipes/multinet/create_multinet.py | 2 +- src/pandapipes/multinet/multinet.py | 2 +- src/pandapipes/multinet/timeseries/__init__.py | 2 +- src/pandapipes/multinet/timeseries/run_time_series_multinet.py | 2 +- src/pandapipes/networks/nw_aux.py | 2 +- src/pandapipes/networks/simple_gas_networks.py | 2 +- src/pandapipes/networks/simple_heat_transfer_networks.py | 2 +- src/pandapipes/pandapipes_net.py | 2 +- src/pandapipes/pf/__init__.py | 2 +- src/pandapipes/pf/build_system_matrix.py | 2 +- src/pandapipes/pf/derivative_toolbox.py | 2 +- src/pandapipes/pf/internals_toolbox.py | 2 +- src/pandapipes/pf/pipeflow_setup.py | 2 +- src/pandapipes/pipeflow.py | 2 +- src/pandapipes/plotting/generic_geodata.py | 2 +- src/pandapipes/plotting/patch_makers.py | 2 +- src/pandapipes/plotting/pipeflow_results.py | 2 +- src/pandapipes/properties/__init__.py | 2 +- src/pandapipes/properties/properties_toolbox.py | 2 +- src/pandapipes/test/__init__.py | 2 +- src/pandapipes/test/api/__init__.py | 2 +- src/pandapipes/test/api/test_aux_function.py | 2 +- src/pandapipes/test/api/test_convert_format.py | 2 +- src/pandapipes/test/api/test_create.py | 2 +- src/pandapipes/test/api/test_network_tables.py | 2 +- src/pandapipes/test/api/test_special_networks.py | 2 +- src/pandapipes/test/api/test_std_types.py | 2 +- src/pandapipes/test/io/__init__.py | 2 +- src/pandapipes/test/io/test_file_io.py | 2 +- src/pandapipes/test/multinet/__init__.py | 2 +- src/pandapipes/test/multinet/test_control_multinet.py | 2 +- src/pandapipes/test/multinet/test_time_series_multinet.py | 2 +- src/pandapipes/test/networks/__init__.py | 2 +- src/pandapipes/test/networks/test_networks.py | 2 +- src/pandapipes/test/openmodelica_comparison/__init__.py | 2 +- .../openmodelica_comparison/pipeflow_openmodelica_comparison.py | 2 +- .../openmodelica_comparison/test_heat_transfer_openmodelica.py | 2 +- .../test/openmodelica_comparison/test_water_openmodelica.py | 2 +- src/pandapipes/test/pipeflow_internals/__init__.py | 2 +- src/pandapipes/test/pipeflow_internals/test_inservice.py | 2 +- src/pandapipes/test/pipeflow_internals/test_non_convergence.py | 2 +- src/pandapipes/test/pipeflow_internals/test_options.py | 2 +- .../pipeflow_internals/test_pipeflow_analytic_comparison.py | 2 +- src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py | 2 +- src/pandapipes/test/pipeflow_internals/test_time_series.py | 2 +- src/pandapipes/test/pipeflow_internals/test_update_matrix.py | 2 +- src/pandapipes/test/plotting/__init__.py | 2 +- src/pandapipes/test/plotting/test_collections.py | 2 +- src/pandapipes/test/plotting/test_generic_coordinates.py | 2 +- src/pandapipes/test/plotting/test_pipeflow_results.py | 2 +- src/pandapipes/test/plotting/test_simple_collections.py | 2 +- src/pandapipes/test/properties/__init__.py | 2 +- src/pandapipes/test/properties/test_fluid_specials.py | 2 +- src/pandapipes/test/properties/test_properties_toolbox.py | 2 +- src/pandapipes/test/run_tests.py | 2 +- src/pandapipes/test/stanet_comparison/__init__.py | 2 +- .../test/stanet_comparison/pipeflow_stanet_comparison.py | 2 +- src/pandapipes/test/stanet_comparison/test_gas_stanet.py | 2 +- src/pandapipes/test/stanet_comparison/test_water_stanet.py | 2 +- src/pandapipes/test/test_imports.py | 2 +- src/pandapipes/test/test_toolbox.py | 2 +- src/pandapipes/test/topology/__init__.py | 2 +- src/pandapipes/test/topology/test_graph_searches.py | 2 +- src/pandapipes/test/topology/test_nxgraph.py | 2 +- src/pandapipes/timeseries/__init__.py | 2 +- src/pandapipes/timeseries/run_time_series.py | 2 +- src/pandapipes/toolbox.py | 2 +- 100 files changed, 100 insertions(+), 100 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 5738f187f..f838d1fe1 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -23,7 +23,7 @@ # -- Project information ----------------------------------------------------- project = 'pandapipes' -copyright = '2020-2023 by Fraunhofer Institute for Energy Economics \ +copyright = '2020-2024 by Fraunhofer Institute for Energy Economics \ and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved.' diff --git a/setup.py b/setup.py index 46526a0b4..0a230161e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/__init__.py b/src/pandapipes/__init__.py index 371d6941b..045b0804e 100644 --- a/src/pandapipes/__init__.py +++ b/src/pandapipes/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/__init__.py b/src/pandapipes/component_models/__init__.py index 279803d28..3437b0c3a 100644 --- a/src/pandapipes/component_models/__init__.py +++ b/src/pandapipes/component_models/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/circulation_pump_mass_component.py b/src/pandapipes/component_models/circulation_pump_mass_component.py index 699d1e416..39cdb217b 100644 --- a/src/pandapipes/component_models/circulation_pump_mass_component.py +++ b/src/pandapipes/component_models/circulation_pump_mass_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/circulation_pump_pressure_component.py b/src/pandapipes/component_models/circulation_pump_pressure_component.py index 6cfbf2eb9..fb7ff2af3 100644 --- a/src/pandapipes/component_models/circulation_pump_pressure_component.py +++ b/src/pandapipes/component_models/circulation_pump_pressure_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/component_toolbox.py b/src/pandapipes/component_models/component_toolbox.py index 305261437..840929bc4 100644 --- a/src/pandapipes/component_models/component_toolbox.py +++ b/src/pandapipes/component_models/component_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/compressor_component.py b/src/pandapipes/component_models/compressor_component.py index d9d5e8113..a65372d7a 100644 --- a/src/pandapipes/component_models/compressor_component.py +++ b/src/pandapipes/component_models/compressor_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/ext_grid_component.py b/src/pandapipes/component_models/ext_grid_component.py index d78028320..2e1d9e792 100644 --- a/src/pandapipes/component_models/ext_grid_component.py +++ b/src/pandapipes/component_models/ext_grid_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/flow_control_component.py b/src/pandapipes/component_models/flow_control_component.py index 67e25487e..f4b88388b 100644 --- a/src/pandapipes/component_models/flow_control_component.py +++ b/src/pandapipes/component_models/flow_control_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/component_models/heat_exchanger_component.py b/src/pandapipes/component_models/heat_exchanger_component.py index d958fda94..92c8b4b9b 100644 --- a/src/pandapipes/component_models/heat_exchanger_component.py +++ b/src/pandapipes/component_models/heat_exchanger_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/junction_component.py b/src/pandapipes/component_models/junction_component.py index fdf2a22ab..7a1cce558 100644 --- a/src/pandapipes/component_models/junction_component.py +++ b/src/pandapipes/component_models/junction_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/mass_storage_component.py b/src/pandapipes/component_models/mass_storage_component.py index 8ece4255b..234bf23e9 100644 --- a/src/pandapipes/component_models/mass_storage_component.py +++ b/src/pandapipes/component_models/mass_storage_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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.junction_component import Junction diff --git a/src/pandapipes/component_models/pipe_component.py b/src/pandapipes/component_models/pipe_component.py index 99b2f098a..550eb1ff1 100644 --- a/src/pandapipes/component_models/pipe_component.py +++ b/src/pandapipes/component_models/pipe_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/pressure_control_component.py b/src/pandapipes/component_models/pressure_control_component.py index e582925bb..1c5aad2e7 100644 --- a/src/pandapipes/component_models/pressure_control_component.py +++ b/src/pandapipes/component_models/pressure_control_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/component_models/pump_component.py b/src/pandapipes/component_models/pump_component.py index 715332f69..411209a2b 100644 --- a/src/pandapipes/component_models/pump_component.py +++ b/src/pandapipes/component_models/pump_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/sink_component.py b/src/pandapipes/component_models/sink_component.py index 3b0e30d90..0f016e367 100644 --- a/src/pandapipes/component_models/sink_component.py +++ b/src/pandapipes/component_models/sink_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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.junction_component import Junction diff --git a/src/pandapipes/component_models/source_component.py b/src/pandapipes/component_models/source_component.py index 54ade9cd8..f93755a83 100644 --- a/src/pandapipes/component_models/source_component.py +++ b/src/pandapipes/component_models/source_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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.junction_component import Junction diff --git a/src/pandapipes/component_models/valve_component.py b/src/pandapipes/component_models/valve_component.py index ff2b9451e..b88403361 100644 --- a/src/pandapipes/component_models/valve_component.py +++ b/src/pandapipes/component_models/valve_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/constants.py b/src/pandapipes/constants.py index 0b3c5575e..333f17a2b 100644 --- a/src/pandapipes/constants.py +++ b/src/pandapipes/constants.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/control/__init__.py b/src/pandapipes/control/__init__.py index 8446d8ec5..5970c1f92 100644 --- a/src/pandapipes/control/__init__.py +++ b/src/pandapipes/control/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/control/run_control.py b/src/pandapipes/control/run_control.py index dbd631345..4b5ac1671 100644 --- a/src/pandapipes/control/run_control.py +++ b/src/pandapipes/control/run_control.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/__init__.py b/src/pandapipes/converter/__init__.py index d49f669e0..88d36891d 100644 --- a/src/pandapipes/converter/__init__.py +++ b/src/pandapipes/converter/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/create.py b/src/pandapipes/create.py index dd3746ff5..777265c3b 100644 --- a/src/pandapipes/create.py +++ b/src/pandapipes/create.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/idx_branch.py b/src/pandapipes/idx_branch.py index c4e3c1632..5104ea279 100644 --- a/src/pandapipes/idx_branch.py +++ b/src/pandapipes/idx_branch.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/idx_node.py b/src/pandapipes/idx_node.py index 0cf71b5a2..49726cf30 100644 --- a/src/pandapipes/idx_node.py +++ b/src/pandapipes/idx_node.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/io/__init__.py b/src/pandapipes/io/__init__.py index 3d30a8959..c3be3a4de 100644 --- a/src/pandapipes/io/__init__.py +++ b/src/pandapipes/io/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/io/convert_format.py b/src/pandapipes/io/convert_format.py index ce13afa07..a4c8b0a45 100644 --- a/src/pandapipes/io/convert_format.py +++ b/src/pandapipes/io/convert_format.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/io/file_io.py b/src/pandapipes/io/file_io.py index a1aa0a86c..d50b59f10 100644 --- a/src/pandapipes/io/file_io.py +++ b/src/pandapipes/io/file_io.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/io/io_utils.py b/src/pandapipes/io/io_utils.py index 745ee3d1b..54afe4f6c 100644 --- a/src/pandapipes/io/io_utils.py +++ b/src/pandapipes/io/io_utils.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/__init__.py b/src/pandapipes/multinet/__init__.py index b4e3f9260..cc2498984 100644 --- a/src/pandapipes/multinet/__init__.py +++ b/src/pandapipes/multinet/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/control/__init__.py b/src/pandapipes/multinet/control/__init__.py index dcd809478..9fff6cee5 100644 --- a/src/pandapipes/multinet/control/__init__.py +++ b/src/pandapipes/multinet/control/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/control/run_control_multinet.py b/src/pandapipes/multinet/control/run_control_multinet.py index 9debef933..a68c94c21 100644 --- a/src/pandapipes/multinet/control/run_control_multinet.py +++ b/src/pandapipes/multinet/control/run_control_multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/multinet/create_multinet.py b/src/pandapipes/multinet/create_multinet.py index 64a31df44..98e19e093 100644 --- a/src/pandapipes/multinet/create_multinet.py +++ b/src/pandapipes/multinet/create_multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/multinet/multinet.py b/src/pandapipes/multinet/multinet.py index 0894fde1e..6468bb5f6 100644 --- a/src/pandapipes/multinet/multinet.py +++ b/src/pandapipes/multinet/multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/multinet/timeseries/__init__.py b/src/pandapipes/multinet/timeseries/__init__.py index d29dcf849..ca4ee1afb 100644 --- a/src/pandapipes/multinet/timeseries/__init__.py +++ b/src/pandapipes/multinet/timeseries/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/timeseries/run_time_series_multinet.py b/src/pandapipes/multinet/timeseries/run_time_series_multinet.py index f3697022c..2eb9a22b8 100644 --- a/src/pandapipes/multinet/timeseries/run_time_series_multinet.py +++ b/src/pandapipes/multinet/timeseries/run_time_series_multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/networks/nw_aux.py b/src/pandapipes/networks/nw_aux.py index 88e3a512d..ce1c58e04 100644 --- a/src/pandapipes/networks/nw_aux.py +++ b/src/pandapipes/networks/nw_aux.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/networks/simple_gas_networks.py b/src/pandapipes/networks/simple_gas_networks.py index b7e6003c3..55065d650 100644 --- a/src/pandapipes/networks/simple_gas_networks.py +++ b/src/pandapipes/networks/simple_gas_networks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/networks/simple_heat_transfer_networks.py b/src/pandapipes/networks/simple_heat_transfer_networks.py index a7380448d..f46566648 100644 --- a/src/pandapipes/networks/simple_heat_transfer_networks.py +++ b/src/pandapipes/networks/simple_heat_transfer_networks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pandapipes_net.py b/src/pandapipes/pandapipes_net.py index 8d4a7488d..bcd4be389 100644 --- a/src/pandapipes/pandapipes_net.py +++ b/src/pandapipes/pandapipes_net.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pf/__init__.py b/src/pandapipes/pf/__init__.py index 1b5988cb0..df963e35b 100644 --- a/src/pandapipes/pf/__init__.py +++ b/src/pandapipes/pf/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pf/build_system_matrix.py b/src/pandapipes/pf/build_system_matrix.py index 454e9b771..e388d2f84 100644 --- a/src/pandapipes/pf/build_system_matrix.py +++ b/src/pandapipes/pf/build_system_matrix.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pf/derivative_toolbox.py b/src/pandapipes/pf/derivative_toolbox.py index 8ee435712..bbfd7dadb 100644 --- a/src/pandapipes/pf/derivative_toolbox.py +++ b/src/pandapipes/pf/derivative_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pf/internals_toolbox.py b/src/pandapipes/pf/internals_toolbox.py index 5732ad2f4..8e094476f 100644 --- a/src/pandapipes/pf/internals_toolbox.py +++ b/src/pandapipes/pf/internals_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pf/pipeflow_setup.py b/src/pandapipes/pf/pipeflow_setup.py index 1b314a462..91c2c6b25 100644 --- a/src/pandapipes/pf/pipeflow_setup.py +++ b/src/pandapipes/pf/pipeflow_setup.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/pipeflow.py b/src/pandapipes/pipeflow.py index 4dab2f9f1..9d78a84e5 100644 --- a/src/pandapipes/pipeflow.py +++ b/src/pandapipes/pipeflow.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/generic_geodata.py b/src/pandapipes/plotting/generic_geodata.py index a158651d8..51bc2cd2d 100644 --- a/src/pandapipes/plotting/generic_geodata.py +++ b/src/pandapipes/plotting/generic_geodata.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/patch_makers.py b/src/pandapipes/plotting/patch_makers.py index 29bf4bacd..3c6950ca0 100644 --- a/src/pandapipes/plotting/patch_makers.py +++ b/src/pandapipes/plotting/patch_makers.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/pipeflow_results.py b/src/pandapipes/plotting/pipeflow_results.py index f9ac2f78d..520c2cb5f 100644 --- a/src/pandapipes/plotting/pipeflow_results.py +++ b/src/pandapipes/plotting/pipeflow_results.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/properties/__init__.py b/src/pandapipes/properties/__init__.py index 9274adeeb..9c85266f4 100644 --- a/src/pandapipes/properties/__init__.py +++ b/src/pandapipes/properties/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/properties/properties_toolbox.py b/src/pandapipes/properties/properties_toolbox.py index 4c34690d5..52b9b85eb 100644 --- a/src/pandapipes/properties/properties_toolbox.py +++ b/src/pandapipes/properties/properties_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/__init__.py b/src/pandapipes/test/__init__.py index 32bfcc872..c22811717 100644 --- a/src/pandapipes/test/__init__.py +++ b/src/pandapipes/test/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/__init__.py b/src/pandapipes/test/api/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/api/__init__.py +++ b/src/pandapipes/test/api/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_aux_function.py b/src/pandapipes/test/api/test_aux_function.py index e677bf10d..7fb1fa305 100644 --- a/src/pandapipes/test/api/test_aux_function.py +++ b/src/pandapipes/test/api/test_aux_function.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_convert_format.py b/src/pandapipes/test/api/test_convert_format.py index b58fbe03a..f96b2b0b9 100644 --- a/src/pandapipes/test/api/test_convert_format.py +++ b/src/pandapipes/test/api/test_convert_format.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_create.py b/src/pandapipes/test/api/test_create.py index b2dff8c97..50fe21f6b 100644 --- a/src/pandapipes/test/api/test_create.py +++ b/src/pandapipes/test/api/test_create.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_network_tables.py b/src/pandapipes/test/api/test_network_tables.py index 899f1bacd..8ee1510bf 100644 --- a/src/pandapipes/test/api/test_network_tables.py +++ b/src/pandapipes/test/api/test_network_tables.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_special_networks.py b/src/pandapipes/test/api/test_special_networks.py index 1b09cd661..f577a846b 100644 --- a/src/pandapipes/test/api/test_special_networks.py +++ b/src/pandapipes/test/api/test_special_networks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_std_types.py b/src/pandapipes/test/api/test_std_types.py index e1bfcca12..b65da82d9 100644 --- a/src/pandapipes/test/api/test_std_types.py +++ b/src/pandapipes/test/api/test_std_types.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/io/__init__.py b/src/pandapipes/test/io/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/io/__init__.py +++ b/src/pandapipes/test/io/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/io/test_file_io.py b/src/pandapipes/test/io/test_file_io.py index a3c3299c0..de3b042f8 100644 --- a/src/pandapipes/test/io/test_file_io.py +++ b/src/pandapipes/test/io/test_file_io.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/multinet/__init__.py b/src/pandapipes/test/multinet/__init__.py index a42db6204..007099182 100644 --- a/src/pandapipes/test/multinet/__init__.py +++ b/src/pandapipes/test/multinet/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/test/multinet/test_control_multinet.py b/src/pandapipes/test/multinet/test_control_multinet.py index d7540c7ce..8bfc88fa9 100644 --- a/src/pandapipes/test/multinet/test_control_multinet.py +++ b/src/pandapipes/test/multinet/test_control_multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/test/multinet/test_time_series_multinet.py b/src/pandapipes/test/multinet/test_time_series_multinet.py index 32deb3597..63ac5348b 100644 --- a/src/pandapipes/test/multinet/test_time_series_multinet.py +++ b/src/pandapipes/test/multinet/test_time_series_multinet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/test/networks/__init__.py b/src/pandapipes/test/networks/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/networks/__init__.py +++ b/src/pandapipes/test/networks/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/networks/test_networks.py b/src/pandapipes/test/networks/test_networks.py index 5d50c1d6d..0aae9dea8 100644 --- a/src/pandapipes/test/networks/test_networks.py +++ b/src/pandapipes/test/networks/test_networks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/openmodelica_comparison/__init__.py b/src/pandapipes/test/openmodelica_comparison/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/openmodelica_comparison/__init__.py +++ b/src/pandapipes/test/openmodelica_comparison/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py b/src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py index 28c021296..0fe9eb95d 100644 --- a/src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py +++ b/src/pandapipes/test/openmodelica_comparison/pipeflow_openmodelica_comparison.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py b/src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py index 713866c8b..b7ccd6dc6 100644 --- a/src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py +++ b/src/pandapipes/test/openmodelica_comparison/test_heat_transfer_openmodelica.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py b/src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py index 8d9f27c0b..7f9c54827 100644 --- a/src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py +++ b/src/pandapipes/test/openmodelica_comparison/test_water_openmodelica.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/__init__.py b/src/pandapipes/test/pipeflow_internals/__init__.py index 103517367..1d23cb89e 100644 --- a/src/pandapipes/test/pipeflow_internals/__init__.py +++ b/src/pandapipes/test/pipeflow_internals/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_inservice.py b/src/pandapipes/test/pipeflow_internals/test_inservice.py index 1a5fd17a8..2768f1ea8 100644 --- a/src/pandapipes/test/pipeflow_internals/test_inservice.py +++ b/src/pandapipes/test/pipeflow_internals/test_inservice.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_non_convergence.py b/src/pandapipes/test/pipeflow_internals/test_non_convergence.py index 89f2e9de6..4c365d650 100644 --- a/src/pandapipes/test/pipeflow_internals/test_non_convergence.py +++ b/src/pandapipes/test/pipeflow_internals/test_non_convergence.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import numpy as np diff --git a/src/pandapipes/test/pipeflow_internals/test_options.py b/src/pandapipes/test/pipeflow_internals/test_options.py index 1e47b2508..3765a32df 100644 --- a/src/pandapipes/test/pipeflow_internals/test_options.py +++ b/src/pandapipes/test/pipeflow_internals/test_options.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py b/src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py index 3ad196701..de52ce872 100644 --- a/src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py +++ b/src/pandapipes/test/pipeflow_internals/test_pipeflow_analytic_comparison.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py b/src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py index d722711ab..267dec5db 100644 --- a/src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py +++ b/src/pandapipes/test/pipeflow_internals/test_pipeflow_modes.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_time_series.py b/src/pandapipes/test/pipeflow_internals/test_time_series.py index afb0276da..30ff113e6 100644 --- a/src/pandapipes/test/pipeflow_internals/test_time_series.py +++ b/src/pandapipes/test/pipeflow_internals/test_time_series.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/pipeflow_internals/test_update_matrix.py b/src/pandapipes/test/pipeflow_internals/test_update_matrix.py index 38c16e6a3..e0e5ee1f4 100644 --- a/src/pandapipes/test/pipeflow_internals/test_update_matrix.py +++ b/src/pandapipes/test/pipeflow_internals/test_update_matrix.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/plotting/__init__.py b/src/pandapipes/test/plotting/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/plotting/__init__.py +++ b/src/pandapipes/test/plotting/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/plotting/test_collections.py b/src/pandapipes/test/plotting/test_collections.py index 19011d6c6..5c3cd9014 100644 --- a/src/pandapipes/test/plotting/test_collections.py +++ b/src/pandapipes/test/plotting/test_collections.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/plotting/test_generic_coordinates.py b/src/pandapipes/test/plotting/test_generic_coordinates.py index 5a78800f0..9c18a0738 100644 --- a/src/pandapipes/test/plotting/test_generic_coordinates.py +++ b/src/pandapipes/test/plotting/test_generic_coordinates.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/plotting/test_pipeflow_results.py b/src/pandapipes/test/plotting/test_pipeflow_results.py index 5e288938f..05fa3558e 100644 --- a/src/pandapipes/test/plotting/test_pipeflow_results.py +++ b/src/pandapipes/test/plotting/test_pipeflow_results.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/plotting/test_simple_collections.py b/src/pandapipes/test/plotting/test_simple_collections.py index a1d231b95..5de8829bd 100644 --- a/src/pandapipes/test/plotting/test_simple_collections.py +++ b/src/pandapipes/test/plotting/test_simple_collections.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/properties/__init__.py b/src/pandapipes/test/properties/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/properties/__init__.py +++ b/src/pandapipes/test/properties/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/properties/test_fluid_specials.py b/src/pandapipes/test/properties/test_fluid_specials.py index faa1ca14a..56cd2f5ac 100644 --- a/src/pandapipes/test/properties/test_fluid_specials.py +++ b/src/pandapipes/test/properties/test_fluid_specials.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/properties/test_properties_toolbox.py b/src/pandapipes/test/properties/test_properties_toolbox.py index 4a1de2ab6..db6d0ecd6 100644 --- a/src/pandapipes/test/properties/test_properties_toolbox.py +++ b/src/pandapipes/test/properties/test_properties_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/run_tests.py b/src/pandapipes/test/run_tests.py index 25d0531fe..59acfcd37 100644 --- a/src/pandapipes/test/run_tests.py +++ b/src/pandapipes/test/run_tests.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/stanet_comparison/__init__.py b/src/pandapipes/test/stanet_comparison/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/stanet_comparison/__init__.py +++ b/src/pandapipes/test/stanet_comparison/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py b/src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py index 9556a3c98..451d9c3af 100644 --- a/src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py +++ b/src/pandapipes/test/stanet_comparison/pipeflow_stanet_comparison.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/stanet_comparison/test_gas_stanet.py b/src/pandapipes/test/stanet_comparison/test_gas_stanet.py index 0e37afd3d..0abdd70ca 100644 --- a/src/pandapipes/test/stanet_comparison/test_gas_stanet.py +++ b/src/pandapipes/test/stanet_comparison/test_gas_stanet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/stanet_comparison/test_water_stanet.py b/src/pandapipes/test/stanet_comparison/test_water_stanet.py index 0b5cf66d6..0c7976e25 100644 --- a/src/pandapipes/test/stanet_comparison/test_water_stanet.py +++ b/src/pandapipes/test/stanet_comparison/test_water_stanet.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/test_imports.py b/src/pandapipes/test/test_imports.py index 865507b01..ce19339d8 100644 --- a/src/pandapipes/test/test_imports.py +++ b/src/pandapipes/test/test_imports.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/test_toolbox.py b/src/pandapipes/test/test_toolbox.py index 2c5bc1ae6..973d30895 100644 --- a/src/pandapipes/test/test_toolbox.py +++ b/src/pandapipes/test/test_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/topology/__init__.py b/src/pandapipes/test/topology/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/topology/__init__.py +++ b/src/pandapipes/test/topology/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/topology/test_graph_searches.py b/src/pandapipes/test/topology/test_graph_searches.py index caadb48cf..404e5c889 100644 --- a/src/pandapipes/test/topology/test_graph_searches.py +++ b/src/pandapipes/test/topology/test_graph_searches.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/topology/test_nxgraph.py b/src/pandapipes/test/topology/test_nxgraph.py index 62a7e12ab..29bed573f 100644 --- a/src/pandapipes/test/topology/test_nxgraph.py +++ b/src/pandapipes/test/topology/test_nxgraph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/timeseries/__init__.py b/src/pandapipes/timeseries/__init__.py index 83f8d986a..07b604ed8 100644 --- a/src/pandapipes/timeseries/__init__.py +++ b/src/pandapipes/timeseries/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/timeseries/run_time_series.py b/src/pandapipes/timeseries/run_time_series.py index 590608df4..03ff9dd77 100644 --- a/src/pandapipes/timeseries/run_time_series.py +++ b/src/pandapipes/timeseries/run_time_series.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/toolbox.py b/src/pandapipes/toolbox.py index 7f6c1fb53..e0b5d2565 100644 --- a/src/pandapipes/toolbox.py +++ b/src/pandapipes/toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import copy From cd2f27d896bf38bc1b6deef60d5a31eb62772cf6 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 13:21:47 +0100 Subject: [PATCH 111/126] using always python -m in workflows --- .github/workflows/release.yml | 6 +++--- .github/workflows/run_tests_develop.yml | 14 +++++++------- .github/workflows/run_tests_master.yml | 14 +++++++------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 30a659782..a583ac9a5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -90,14 +90,14 @@ jobs: - name: Install pandapipes from TestPyPI if: ${{ inputs.upload_server == 'testpypi'}} run: | - pip install --no-cache-dir -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pandapipes + python -m pip install --no-cache-dir -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pandapipes - name: Install pandapipes from PyPI if: ${{ inputs.upload_server == 'pypi'}} run: | - pip install pandapipes + python -m pip install pandapipes - name: List all installed packages run: | - pip list + python -m pip list - name: Test with pytest run: | pytest --pyargs pandapipes.test diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index d1ea95dbf..b0bcb60e2 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -32,19 +32,19 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + python -m pip install . - name: List all installed packages run: | - pip list + python -m pip list - name: Test with pytest if: ${{ matrix.python-version != '3.9' }} run: | - pytest + python -m pytest - name: Test with pytest and Codecov if: ${{ matrix.python-version == '3.9' }} run: | python -m pip install pytest-cov - pytest --cov=./ --cov-report=xml + python -m pytest --cov=./ --cov-report=xml - name: Upload coverage to Codecov if: ${{ matrix.python-version == '3.9' }} uses: codecov/codecov-action@v1 @@ -70,10 +70,10 @@ jobs: 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 - pip install . + python -m pip install . - name: List all installed packages run: | - pip list + python -m pip list - name: Lint with flake8 (syntax errors and undefinded names) run: | # stop the build if there are Python syntax errors or undefined names @@ -104,7 +104,7 @@ jobs: python -m pip install . - name: List all installed packages run: | - pip list + python -m pip list - name: Test with pytest run: | python -m pytest --nbmake -n=auto "./tutorials" diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index ad856db14..153a78694 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -32,19 +32,19 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + python -m pip install . - name: List all installed packages run: | - pip list + python -m pip list - name: Test with pytest if: ${{ matrix.python-version != '3.9' }} run: | - pytest + python -m pytest - name: Test with pytest and Codecov if: ${{ matrix.python-version == '3.9' }} run: | python -m pip install pytest-cov - pytest --cov=./ --cov-report=xml + python -m pytest --cov=./ --cov-report=xml - name: Upload coverage to Codecov if: ${{ matrix.python-version == '3.9' }} uses: codecov/codecov-action@v1 @@ -69,13 +69,13 @@ jobs: if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi 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 . + python -m pip install . - name: List all installed packages run: | - pip list + python -m pip list - name: Test with pytest run: | - pytest --nbmake -n=auto "./tutorials" + python -m pytest --nbmake -n=auto "./tutorials" docs_check: runs-on: ubuntu-latest From c38ed6cd40fb163528b7b02c2864370dc768d65d Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 13:22:28 +0100 Subject: [PATCH 112/126] adapting version tag --- CHANGELOG.rst | 2 +- setup.py | 2 +- src/pandapipes/__init__.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cd80ea5df..185dacee5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,7 +1,7 @@ Change Log ============= -[upcoming release] - 2023-..-.. +[0.9.0] - 2023-12-22 ------------------------------- - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) diff --git a/setup.py b/setup.py index 46526a0b4..bd9f12576 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='pandapipes', - version='0.8.5', + version='0.9.0', author='Simon Ruben Drauz-Mauel, Daniel Lohmeier, Jolando Marius Kisse', author_email='simon.ruben.drauz-mauel@iee.fraunhofer.de, daniel.lohmeier@retoflow.de, ' 'jolando.kisse@uni-kassel.de', diff --git a/src/pandapipes/__init__.py b/src/pandapipes/__init__.py index 371d6941b..edec97fd7 100644 --- a/src/pandapipes/__init__.py +++ b/src/pandapipes/__init__.py @@ -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.5' +__version__ = '0.9.0' __format_version__ = '0.8.0' import pandas as pd From 2f74032c762dd6faa21d0f2a11c174d88aa24d05 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 13:22:53 +0100 Subject: [PATCH 113/126] changing author name --- AUTHORS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index b0fe8adbf..4670fec3b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -3,7 +3,7 @@ and Energy System Technology (IEE), Kassel, and University of Kassel. All rights Lead Developers: - Daniel Lohmeier - - Simon Ruben Drauz + - Simon Ruben Drauz-Mauel - Jolando Marius Kisse Main Contributors: From b461ce4b8a324da6857af239c8e8db45c67b14a8 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 13:23:08 +0100 Subject: [PATCH 114/126] adding src layout info in changelog --- CHANGELOG.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 185dacee5..de161c8fc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -11,6 +11,7 @@ Change Log - [CHANGED] dynamic creation of lookups for getting pit as pandas tables - [CHANGED] components can have their own internal arrays for specific calculations (e.g. for compressor pressure ratio), so that the pit does not need to include such component specific entries - [CHANGED] .readthedocs.yml due to deprecation +- [CHANGED] changing from setuptools flat-layout into src-layout - [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added - [REMOVED] broken travis badge removed from readme From 882c9143373121a4d8822b6f7db72dc8210ebbb4 Mon Sep 17 00:00:00 2001 From: eprade Date: Thu, 21 Dec 2023 13:50:59 +0100 Subject: [PATCH 115/126] -changed copyright year 2 --- AUTHORS | 2 +- CHANGELOG.rst | 1 + LICENSE | 2 +- src/pandapipes/component_models/abstract_models/__init__.py | 2 +- .../component_models/abstract_models/base_component.py | 2 +- .../component_models/abstract_models/branch_models.py | 2 +- .../abstract_models/branch_w_internals_models.py | 2 +- .../abstract_models/branch_wo_internals_models.py | 2 +- .../abstract_models/branch_wzerolength_models.py | 2 +- .../component_models/abstract_models/circulation_pump.py | 2 +- .../component_models/abstract_models/const_flow_models.py | 2 +- .../component_models/abstract_models/node_element_models.py | 2 +- src/pandapipes/component_models/abstract_models/node_models.py | 2 +- src/pandapipes/converter/stanet/__init__.py | 2 +- src/pandapipes/converter/stanet/data_cleaning.py | 2 +- src/pandapipes/converter/stanet/preparing_steps.py | 2 +- src/pandapipes/converter/stanet/stanet2pandapipes.py | 2 +- src/pandapipes/converter/stanet/table_creation.py | 2 +- .../converter/stanet/valve_pipe_component/__init__.py | 2 +- .../converter/stanet/valve_pipe_component/create_valve_pipe.py | 2 +- .../stanet/valve_pipe_component/valve_pipe_component.py | 2 +- .../stanet/valve_pipe_component/valve_pipe_plotting.py | 2 +- src/pandapipes/multinet/control/controller/__init__.py | 2 +- src/pandapipes/multinet/control/controller/multinet_control.py | 2 +- src/pandapipes/networks/__init__.py | 2 +- src/pandapipes/networks/simple_water_networks.py | 2 +- src/pandapipes/plotting/__init__.py | 2 +- src/pandapipes/plotting/collections.py | 2 +- src/pandapipes/plotting/geo.py | 2 +- src/pandapipes/plotting/plotting_toolbox.py | 2 +- src/pandapipes/plotting/simple_plot.py | 2 +- src/pandapipes/properties/fluids.py | 2 +- src/pandapipes/std_types/__init__.py | 2 +- src/pandapipes/std_types/std_type_class.py | 2 +- src/pandapipes/std_types/std_types.py | 2 +- .../test/api/release_cycle/release_control_test_network.py | 2 +- src/pandapipes/test/api/test_components/__init__.py | 2 +- src/pandapipes/test/api/test_components/test_circ_pump_mass.py | 2 +- .../test/api/test_components/test_circ_pump_pressure.py | 2 +- src/pandapipes/test/api/test_components/test_compressor.py | 2 +- src/pandapipes/test/api/test_components/test_ext_grid.py | 2 +- src/pandapipes/test/api/test_components/test_heat_exchanger.py | 2 +- src/pandapipes/test/api/test_components/test_mass_storage.py | 2 +- src/pandapipes/test/api/test_components/test_pipe_results.py | 2 +- .../test/api/test_components/test_pressure_control.py | 2 +- src/pandapipes/test/api/test_components/test_pump.py | 2 +- src/pandapipes/test/api/test_components/test_valve.py | 2 +- src/pandapipes/test/converter/test_stanet_converter.py | 2 +- src/pandapipes/topology/__init__.py | 2 +- src/pandapipes/topology/create_graph.py | 2 +- src/pandapipes/topology/graph_searches.py | 2 +- 51 files changed, 51 insertions(+), 50 deletions(-) diff --git a/AUTHORS b/AUTHORS index b0fe8adbf..07a8ee3a2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics and Energy System Technology (IEE), Kassel, and University of Kassel. All rights reserved. Lead Developers: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cd80ea5df..27cdd68c9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,7 @@ Change Log [upcoming release] - 2023-..-.. ------------------------------- + - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) - [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service (heat and hydraulic) diff --git a/LICENSE b/LICENSE index 29e1621fc..5eac7ca2b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics and Energy System Technology (IEE), Kassel, and University of Kassel. Further contributions by individual contributors (see AUTHORS file for details). All rights reserved. diff --git a/src/pandapipes/component_models/abstract_models/__init__.py b/src/pandapipes/component_models/abstract_models/__init__.py index d0a791b81..2e1e01892 100644 --- a/src/pandapipes/component_models/abstract_models/__init__.py +++ b/src/pandapipes/component_models/abstract_models/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/base_component.py b/src/pandapipes/component_models/abstract_models/base_component.py index 105035f3d..50d6f5556 100644 --- a/src/pandapipes/component_models/abstract_models/base_component.py +++ b/src/pandapipes/component_models/abstract_models/base_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/branch_models.py b/src/pandapipes/component_models/abstract_models/branch_models.py index f9d98d6e8..9516dcbb6 100644 --- a/src/pandapipes/component_models/abstract_models/branch_models.py +++ b/src/pandapipes/component_models/abstract_models/branch_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/branch_w_internals_models.py b/src/pandapipes/component_models/abstract_models/branch_w_internals_models.py index 0478254a9..c21d7d582 100644 --- a/src/pandapipes/component_models/abstract_models/branch_w_internals_models.py +++ b/src/pandapipes/component_models/abstract_models/branch_w_internals_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py b/src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py index 2867c241b..1ec2589ab 100644 --- a/src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py +++ b/src/pandapipes/component_models/abstract_models/branch_wo_internals_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py b/src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py index b9da3028f..a1668ab38 100644 --- a/src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py +++ b/src/pandapipes/component_models/abstract_models/branch_wzerolength_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/circulation_pump.py b/src/pandapipes/component_models/abstract_models/circulation_pump.py index 3c3e338de..dd18a9b6f 100644 --- a/src/pandapipes/component_models/abstract_models/circulation_pump.py +++ b/src/pandapipes/component_models/abstract_models/circulation_pump.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/const_flow_models.py b/src/pandapipes/component_models/abstract_models/const_flow_models.py index a10a4d0e4..665ba7046 100644 --- a/src/pandapipes/component_models/abstract_models/const_flow_models.py +++ b/src/pandapipes/component_models/abstract_models/const_flow_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/node_element_models.py b/src/pandapipes/component_models/abstract_models/node_element_models.py index 0792fa531..32db81212 100644 --- a/src/pandapipes/component_models/abstract_models/node_element_models.py +++ b/src/pandapipes/component_models/abstract_models/node_element_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/component_models/abstract_models/node_models.py b/src/pandapipes/component_models/abstract_models/node_models.py index 0ce18e4a9..7adc3ab2c 100644 --- a/src/pandapipes/component_models/abstract_models/node_models.py +++ b/src/pandapipes/component_models/abstract_models/node_models.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/__init__.py b/src/pandapipes/converter/stanet/__init__.py index 219b32db7..2b3f44de5 100644 --- a/src/pandapipes/converter/stanet/__init__.py +++ b/src/pandapipes/converter/stanet/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/data_cleaning.py b/src/pandapipes/converter/stanet/data_cleaning.py index f440be9c5..aa7389530 100644 --- a/src/pandapipes/converter/stanet/data_cleaning.py +++ b/src/pandapipes/converter/stanet/data_cleaning.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/preparing_steps.py b/src/pandapipes/converter/stanet/preparing_steps.py index 91e8b5b5e..43c190ffb 100644 --- a/src/pandapipes/converter/stanet/preparing_steps.py +++ b/src/pandapipes/converter/stanet/preparing_steps.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/stanet2pandapipes.py b/src/pandapipes/converter/stanet/stanet2pandapipes.py index ed644f9f9..6bd2484d2 100644 --- a/src/pandapipes/converter/stanet/stanet2pandapipes.py +++ b/src/pandapipes/converter/stanet/stanet2pandapipes.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/table_creation.py b/src/pandapipes/converter/stanet/table_creation.py index 7678b4c5d..280d3a64a 100644 --- a/src/pandapipes/converter/stanet/table_creation.py +++ b/src/pandapipes/converter/stanet/table_creation.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/valve_pipe_component/__init__.py b/src/pandapipes/converter/stanet/valve_pipe_component/__init__.py index 875194cc9..dac40f186 100644 --- a/src/pandapipes/converter/stanet/valve_pipe_component/__init__.py +++ b/src/pandapipes/converter/stanet/valve_pipe_component/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py b/src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py index 9b6586dfb..8ab3fe6eb 100644 --- a/src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py +++ b/src/pandapipes/converter/stanet/valve_pipe_component/create_valve_pipe.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py index 6b7a5ed85..4dc085eb4 100644 --- a/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py +++ b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_component.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py index 7b3d780d9..16592eda6 100644 --- a/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py +++ b/src/pandapipes/converter/stanet/valve_pipe_component/valve_pipe_plotting.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/control/controller/__init__.py b/src/pandapipes/multinet/control/controller/__init__.py index 835acc1d4..f03f3e1df 100644 --- a/src/pandapipes/multinet/control/controller/__init__.py +++ b/src/pandapipes/multinet/control/controller/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/multinet/control/controller/multinet_control.py b/src/pandapipes/multinet/control/controller/multinet_control.py index 72300b93b..0dedb94a8 100644 --- a/src/pandapipes/multinet/control/controller/multinet_control.py +++ b/src/pandapipes/multinet/control/controller/multinet_control.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/networks/__init__.py b/src/pandapipes/networks/__init__.py index 562561b5c..ba400eca3 100644 --- a/src/pandapipes/networks/__init__.py +++ b/src/pandapipes/networks/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/networks/simple_water_networks.py b/src/pandapipes/networks/simple_water_networks.py index 629bb0cd4..b0e8bd394 100644 --- a/src/pandapipes/networks/simple_water_networks.py +++ b/src/pandapipes/networks/simple_water_networks.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/__init__.py b/src/pandapipes/plotting/__init__.py index 2eb4217ad..e37afd30a 100644 --- a/src/pandapipes/plotting/__init__.py +++ b/src/pandapipes/plotting/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/collections.py b/src/pandapipes/plotting/collections.py index dccea2017..144b64d63 100644 --- a/src/pandapipes/plotting/collections.py +++ b/src/pandapipes/plotting/collections.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/geo.py b/src/pandapipes/plotting/geo.py index 2c03da5f9..a3c63c427 100644 --- a/src/pandapipes/plotting/geo.py +++ b/src/pandapipes/plotting/geo.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/plotting_toolbox.py b/src/pandapipes/plotting/plotting_toolbox.py index e8b8b5b44..23b5817ec 100644 --- a/src/pandapipes/plotting/plotting_toolbox.py +++ b/src/pandapipes/plotting/plotting_toolbox.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/plotting/simple_plot.py b/src/pandapipes/plotting/simple_plot.py index 2dac028f8..1d0902369 100644 --- a/src/pandapipes/plotting/simple_plot.py +++ b/src/pandapipes/plotting/simple_plot.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/properties/fluids.py b/src/pandapipes/properties/fluids.py index 7917b2e1d..763d7c22d 100644 --- a/src/pandapipes/properties/fluids.py +++ b/src/pandapipes/properties/fluids.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/std_types/__init__.py b/src/pandapipes/std_types/__init__.py index 78defc350..2eb6cdd26 100644 --- a/src/pandapipes/std_types/__init__.py +++ b/src/pandapipes/std_types/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/std_types/std_type_class.py b/src/pandapipes/std_types/std_type_class.py index 28c50857b..b503d369c 100644 --- a/src/pandapipes/std_types/std_type_class.py +++ b/src/pandapipes/std_types/std_type_class.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/std_types/std_types.py b/src/pandapipes/std_types/std_types.py index 9105126b3..d644db02a 100644 --- a/src/pandapipes/std_types/std_types.py +++ b/src/pandapipes/std_types/std_types.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/release_cycle/release_control_test_network.py b/src/pandapipes/test/api/release_cycle/release_control_test_network.py index 65e5b6816..148aaaec4 100644 --- a/src/pandapipes/test/api/release_cycle/release_control_test_network.py +++ b/src/pandapipes/test/api/release_cycle/release_control_test_network.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/__init__.py b/src/pandapipes/test/api/test_components/__init__.py index fe22a75dc..ff738bbca 100644 --- a/src/pandapipes/test/api/test_components/__init__.py +++ b/src/pandapipes/test/api/test_components/__init__.py @@ -1,3 +1,3 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_circ_pump_mass.py b/src/pandapipes/test/api/test_components/test_circ_pump_mass.py index 0d643e685..3ade57c4e 100644 --- a/src/pandapipes/test/api/test_components/test_circ_pump_mass.py +++ b/src/pandapipes/test/api/test_components/test_circ_pump_mass.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_circ_pump_pressure.py b/src/pandapipes/test/api/test_components/test_circ_pump_pressure.py index 349a7bc6c..9e9cdbe6b 100644 --- a/src/pandapipes/test/api/test_components/test_circ_pump_pressure.py +++ b/src/pandapipes/test/api/test_components/test_circ_pump_pressure.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import os diff --git a/src/pandapipes/test/api/test_components/test_compressor.py b/src/pandapipes/test/api/test_components/test_compressor.py index 6d6407162..791422022 100644 --- a/src/pandapipes/test/api/test_components/test_compressor.py +++ b/src/pandapipes/test/api/test_components/test_compressor.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_ext_grid.py b/src/pandapipes/test/api/test_components/test_ext_grid.py index d6945dd55..fa39eb0e3 100644 --- a/src/pandapipes/test/api/test_components/test_ext_grid.py +++ b/src/pandapipes/test/api/test_components/test_ext_grid.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_heat_exchanger.py b/src/pandapipes/test/api/test_components/test_heat_exchanger.py index 5bb932be2..08d946778 100644 --- a/src/pandapipes/test/api/test_components/test_heat_exchanger.py +++ b/src/pandapipes/test/api/test_components/test_heat_exchanger.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import os diff --git a/src/pandapipes/test/api/test_components/test_mass_storage.py b/src/pandapipes/test/api/test_components/test_mass_storage.py index 29789e8ca..9b8707702 100644 --- a/src/pandapipes/test/api/test_components/test_mass_storage.py +++ b/src/pandapipes/test/api/test_components/test_mass_storage.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_pipe_results.py b/src/pandapipes/test/api/test_components/test_pipe_results.py index bf58d84bc..6ba8d0cb6 100644 --- a/src/pandapipes/test/api/test_components/test_pipe_results.py +++ b/src/pandapipes/test/api/test_components/test_pipe_results.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import numpy as np diff --git a/src/pandapipes/test/api/test_components/test_pressure_control.py b/src/pandapipes/test/api/test_components/test_pressure_control.py index e770716fb..e1fa1835f 100644 --- a/src/pandapipes/test/api/test_components/test_pressure_control.py +++ b/src/pandapipes/test/api/test_components/test_pressure_control.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # and Energy System Technology (IEE), Kassel. All rights reserved. # Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. diff --git a/src/pandapipes/test/api/test_components/test_pump.py b/src/pandapipes/test/api/test_components/test_pump.py index 0cf9ce61c..bd974e5a2 100644 --- a/src/pandapipes/test/api/test_components/test_pump.py +++ b/src/pandapipes/test/api/test_components/test_pump.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/test/api/test_components/test_valve.py b/src/pandapipes/test/api/test_components/test_valve.py index dbd737652..bef0df3ae 100644 --- a/src/pandapipes/test/api/test_components/test_valve.py +++ b/src/pandapipes/test/api/test_components/test_valve.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. import os diff --git a/src/pandapipes/test/converter/test_stanet_converter.py b/src/pandapipes/test/converter/test_stanet_converter.py index 2d713b448..83bd32d54 100644 --- a/src/pandapipes/test/converter/test_stanet_converter.py +++ b/src/pandapipes/test/converter/test_stanet_converter.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/topology/__init__.py b/src/pandapipes/topology/__init__.py index ad6a36ed9..7942e6754 100644 --- a/src/pandapipes/topology/__init__.py +++ b/src/pandapipes/topology/__init__.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/topology/create_graph.py b/src/pandapipes/topology/create_graph.py index 96b0a3132..4741aa916 100644 --- a/src/pandapipes/topology/create_graph.py +++ b/src/pandapipes/topology/create_graph.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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. diff --git a/src/pandapipes/topology/graph_searches.py b/src/pandapipes/topology/graph_searches.py index 2d5fdbccd..ac06a73bc 100644 --- a/src/pandapipes/topology/graph_searches.py +++ b/src/pandapipes/topology/graph_searches.py @@ -1,4 +1,4 @@ -# Copyright (c) 2020-2023 by Fraunhofer Institute for Energy Economics +# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics # 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 69e2ad5b4f0b39047713e5986e93a19e352ae22b Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:06:27 +0100 Subject: [PATCH 116/126] removing init from converter folder --- src/pandapipes/converter/__init__.py | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 src/pandapipes/converter/__init__.py diff --git a/src/pandapipes/converter/__init__.py b/src/pandapipes/converter/__init__.py deleted file mode 100644 index 88d36891d..000000000 --- a/src/pandapipes/converter/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2020-2024 by Fraunhofer Institute for Energy Economics -# 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.converter.stanet.stanet2pandapipes import stanet_to_pandapipes From a57fa81315fd516331c89c29ff27df464d19037b Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:06:37 +0100 Subject: [PATCH 117/126] adapting CHANGELOG.rst --- CHANGELOG.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index de161c8fc..1638b2f37 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,14 +6,25 @@ Change Log - [ADDED] multiple creation of heat exchanger - [ADDED] support Python 3.11 (now included in test pipeline) - [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service (heat and hydraulic) +- [ADDED] adding biomethane (pure and treated) as additonal fluid +- [ADDED] results tables can be assembled modularly - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables - [CHANGED] components can have their own internal arrays for specific calculations (e.g. for compressor pressure ratio), so that the pit does not need to include such component specific entries - [CHANGED] .readthedocs.yml due to deprecation - [CHANGED] changing from setuptools flat-layout into src-layout +- [CHANGED] calculate thermal derivative globally, adaptions before/after can be done component-wise +- [CHANGED] moving PipeflowNotConverged error from pipeflow to pipeflow_setup +- [CHANGED] moving 'result_extraction' under pf folder - [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added +- [FIXED] build igraph considers all components +- [FIXED] creating nxgraph and considering pressure circulation pumps +- [FIXED] error in tutorial 'circular flow in a district heating grid' +- [FIXED] caused error during 'pip install pandapipes' - [REMOVED] broken travis badge removed from readme +- [REMOVED] branch TINIT removed as it is not a solution variable, temperature determined on the fly +- [REMOVED] 'converged' setting from options [0.8.5] - 2023-06-19 ------------------------------- From 941f1a5ce35f0b2b41bf3de7d8c35352ac7da540 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:21:23 +0100 Subject: [PATCH 118/126] small adaptions CHANGELOG.rst --- CHANGELOG.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1638b2f37..739eb92fc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,7 +7,7 @@ Change Log - [ADDED] support Python 3.11 (now included in test pipeline) - [ADDED] after the connectivity check, intercept the pipeflow if no more nodes are in-service (heat and hydraulic) - [ADDED] adding biomethane (pure and treated) as additonal fluid -- [ADDED] results tables can be assembled modularly +- [ADDED] result tables can be assembled modularly - [CHANGED] dropped support for Python 3.7 (no longer included in test pipeline) - [CHANGED] connectivity check now separated by hydraulics and heat_transfer calculation, so that also results can differ in some rows (NaN or not) - [CHANGED] dynamic creation of lookups for getting pit as pandas tables @@ -15,11 +15,11 @@ Change Log - [CHANGED] .readthedocs.yml due to deprecation - [CHANGED] changing from setuptools flat-layout into src-layout - [CHANGED] calculate thermal derivative globally, adaptions before/after can be done component-wise -- [CHANGED] moving PipeflowNotConverged error from pipeflow to pipeflow_setup +- [CHANGED] moving 'PipeflowNotConverged' error from pipeflow to pipeflow_setup - [CHANGED] moving 'result_extraction' under pf folder - [FIXED] in STANET converter: bug fix for heat exchanger creation and external temperatures of pipes added - [FIXED] build igraph considers all components -- [FIXED] creating nxgraph and considering pressure circulation pumps +- [FIXED] creating nxgraph and considering pressure circulation pumps correctly - [FIXED] error in tutorial 'circular flow in a district heating grid' - [FIXED] caused error during 'pip install pandapipes' - [REMOVED] broken travis badge removed from readme From 201f966d955cede2b9b63962e104e712a919c6c7 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:32:50 +0100 Subject: [PATCH 119/126] changing tag in doc conf --- doc/source/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f838d1fe1..f534b111f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -47,9 +47,9 @@ # built documents. # # The short X.Y version. -version = "0.8" +version = "0.9" # The full version, including alpha/beta/rc tags. -release = "0.8.5" +release = "0.9.0" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From 40d85789004004bae491e9c95252060577ba3d1b Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:33:05 +0100 Subject: [PATCH 120/126] changing pandapower dependency --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index d30060da5..cad8d74c7 100644 --- a/setup.py +++ b/setup.py @@ -44,7 +44,7 @@ long_description_content_type='text/x-rst', url='http://www.pandapipes.org', license='BSD', - install_requires=["pandapower>=2.11.1", "matplotlib", "shapely"], + install_requires=["pandapower>=2.13.1", "matplotlib", "shapely"], extras_require={"docs": ["numpydoc", "sphinx", "sphinx_rtd_theme", "sphinxcontrib.bibtex"], "plotting": ["plotly", "igraph"], "test": ["pytest", "pytest-xdist", "nbmake"], From fcb97acbdedab9872b42b35331fc7d62d9b25740 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Thu, 21 Dec 2023 14:33:31 +0100 Subject: [PATCH 121/126] adding example grids water and gas 0.9.0 --- .../api/old_versions/example_0.9.0_gas.json | 458 +++++++++++++++ .../api/old_versions/example_0.9.0_water.json | 520 ++++++++++++++++++ 2 files changed, 978 insertions(+) create mode 100644 src/pandapipes/test/api/old_versions/example_0.9.0_gas.json create mode 100644 src/pandapipes/test/api/old_versions/example_0.9.0_water.json diff --git a/src/pandapipes/test/api/old_versions/example_0.9.0_gas.json b/src/pandapipes/test/api/old_versions/example_0.9.0_gas.json new file mode 100644 index 000000000..041871129 --- /dev/null +++ b/src/pandapipes/test/api/old_versions/example_0.9.0_gas.json @@ -0,0 +1,458 @@ +{ + "_module": "pandapipes.pandapipes_net", + "_class": "pandapipesNet", + "_object": { + "fluid": { + "_module": "pandapipes.properties.fluids", + "_class": "Fluid", + "_object": "{\"name\": \"hgas\", \"fluid_type\": \"gas\", \"is_gas\": true, \"all_properties\": {\"density\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyInterExtra\", \"_object\": \"{\\\"x\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 263.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 273.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 283.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 293.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 303.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 313.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 323.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 333.0}], \\\"dtype\\\": \\\"float64\\\"}, \\\"y\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.7614762591064257}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.733332277439119}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.7072104923835694}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.6828947600611692}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.660205611537355}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.6389854855679075}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.6190946329317856}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 0.6004074588524487}], \\\"dtype\\\": \\\"float64\\\"}, \\\"_fill_value_orig\\\": \\\"extrapolate\\\"}\"}, \"viscosity\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyInterExtra\", \"_object\": \"{\\\"x\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 263.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 273.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 283.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 293.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 303.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 313.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 323.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 333.0}], \\\"dtype\\\": \\\"float64\\\"}, \\\"y\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.0047118361853041e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.04021750220461e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.0704866480048474e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.1007402297863992e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.1337005139349375e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.170765177634217e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.2010332619395079e-05}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.231274052527204e-05}], \\\"dtype\\\": \\\"float64\\\"}, \\\"_fill_value_orig\\\": \\\"extrapolate\\\"}\"}, \"heat_capacity\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyInterExtra\", \"_object\": \"{\\\"x\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 263.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 273.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 283.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 293.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 303.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 313.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 323.0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 333.0}], \\\"dtype\\\": \\\"float64\\\"}, \\\"y\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2111.7430409177705}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2129.19525821288}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2148.5756908384515}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2169.8204812997346}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2192.8111461983763}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2217.455354914997}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2243.67904088272}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 2271.295613279192}], \\\"dtype\\\": \\\"float64\\\"}, \\\"_fill_value_orig\\\": \\\"extrapolate\\\"}\"}, \"molar_mass\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyConstant\", \"_object\": \"{\\\"value\\\": 16.604497, \\\"warn_dependent_variables\\\": false}\"}, \"der_compressibility\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyConstant\", \"_object\": \"{\\\"value\\\": -0.0022, \\\"warn_dependent_variables\\\": false}\"}, \"compressibility\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyLinear\", \"_object\": \"{\\\"slope\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": -0.0022}, \\\"offset\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"float64\\\", \\\"_object\\\": 1.0}}\"}, \"lhv\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyConstant\", \"_object\": \"{\\\"value\\\": 13.20179, \\\"warn_dependent_variables\\\": false}\"}, \"hhv\": {\"_module\": \"pandapipes.properties.fluids\", \"_class\": \"FluidPropertyConstant\", \"_object\": \"{\\\"value\\\": 14.62197, \\\"warn_dependent_variables\\\": false}\"}}}" + }, + "converged": true, + "name": "net", + "version": "0.9.0", + "format_version": "0.8.0", + "component_list": [ + { + "_module": "pandapipes.component_models.junction_component", + "_class": "Junction", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.pipe_component", + "_class": "Pipe", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.ext_grid_component", + "_class": "ExtGrid", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.sink_component", + "_class": "Sink", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.source_component", + "_class": "Source", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.mass_storage_component", + "_class": "MassStorage", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.valve_component", + "_class": "Valve", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.flow_control_component", + "_class": "FlowControlComponent", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.pressure_control_component", + "_class": "PressureControlComponent", + "_object": "{}" + }, + { + "_module": "pandapipes.component_models.compressor_component", + "_class": "Compressor", + "_object": "{}" + } + ], + "junction": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"pn_bar\",\"tfluid_k\",\"height_m\",\"in_service\",\"type\"],\"index\":[0,1,2,3,4,5,6,7,8,9,10,11,12],\"data\":[[\"Junction 0\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 1\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 2\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 3\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 4\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 5\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 6\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 7\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 8\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 9\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 10\",16.0,283.0,0.0,true,\"junction\"],[\"Junction 11\",0.7,283.0,0.0,true,\"junction\"],[\"Junction 12\",0.7,283.0,0.0,true,\"junction\"]]}", + "orient": "split", + "dtype": { + "name": "object", + "pn_bar": "float64", + "tfluid_k": "float64", + "height_m": "float64", + "in_service": "bool", + "type": "object" + }, + "is_multiindex": false, + "is_multicolumn": false + }, + "junction_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"x\",\"y\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "x": "float64", + "y": "float64" + }, + "is_multiindex": false, + "is_multicolumn": false + }, + "pipe": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"from_junction\",\"to_junction\",\"std_type\",\"length_km\",\"diameter_m\",\"k_mm\",\"loss_coefficient\",\"alpha_w_per_m2k\",\"text_k\",\"qext_w\",\"sections\",\"in_service\",\"type\"],\"index\":[0,1,2,3,4,5,6,7],\"data\":[[\"Pipe 0\",0,1,null,3.0,0.1,1.0,0.0,10.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 1\",2,3,null,6.0,0.075,0.1,0.0,3.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 2\",3,4,null,5.0,0.06,0.1,0.0,20.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 3\",4,5,null,0.1,0.07,0.1,0.0,2.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 4\",5,6,null,4.5,0.085,0.1,0.0,2.5,293.0,0.0,10,true,\"pipe\"],[\"Pipe 5\",8,7,null,4.0,0.03,0.1,0.0,1.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 6\",9,10,null,1.0,0.03,0.1,0.0,1.0,293.0,0.0,10,true,\"pipe\"],[\"Pipe 7\",11,12,null,1.5,0.09,0.1,0.0,3.0,293.0,0.0,10,true,\"pipe\"]]}", + "orient": "split", + "dtype": { + "name": "object", + "from_junction": "uint32", + "to_junction": "uint32", + "std_type": "object", + "length_km": "float64", + "diameter_m": "float64", + "k_mm": "float64", + "loss_coefficient": "float64", + "alpha_w_per_m2k": "float64", + "text_k": "float64", + "qext_w": "float64", + "sections": "uint32", + "in_service": "bool", + "type": "object" + }, + "is_multiindex": false, + "is_multicolumn": false + }, + "pipe_geodata": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"coords\"],\"index\":[],\"data\":[]}", + "orient": "split", + "dtype": { + "coords": "object" + }, + "is_multiindex": false, + "is_multicolumn": false + }, + "ext_grid": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"name\",\"junction\",\"p_bar\",\"t_k\",\"in_service\",\"type\"],\"index\":[0,1],\"data\":[[\"External Grid 0\",0,16.0,280.0,true,\"pt\"],[\"External Grid 1\",8,15.0,285.0,true,\"pt\"]]}", + "orient": "split", + "dtype": { + "name": "object", + "junction": "uint32", + "p_bar": "float64", + "t_k": "float64", + "in_service": "bool", + "type": "object" + }, + "is_multiindex": false, + "is_multicolumn": false + }, + "controller": { + "_module": "pandas.core.frame", + "_class": "DataFrame", + "_object": "{\"columns\":[\"object\",\"in_service\",\"order\",\"level\",\"initial_run\",\"recycle\"],\"index\":[0,1],\"data\":[[{\"_module\":\"pandapower.control.controller.const_control\",\"_class\":\"ConstControl\",\"_object\":\"{\\\"index\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 0}, \\\"matching_params\\\": {\\\"element\\\": \\\"sink\\\", \\\"variable\\\": \\\"mdot_kg_per_s\\\", \\\"element_index\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 1}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 2}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 3}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 4}], \\\"dtype\\\": \\\"int64\\\"}}, \\\"data_source\\\": {\\\"_module\\\": \\\"pandapower.timeseries.data_sources.frame_data\\\", \\\"_class\\\": \\\"DFData\\\", \\\"_object\\\": \\\"{\\\\\\\"df\\\\\\\": {\\\\\\\"_module\\\\\\\": \\\\\\\"pandas.core.frame\\\\\\\", \\\\\\\"_class\\\\\\\": \\\\\\\"DataFrame\\\\\\\", \\\\\\\"_object\\\\\\\": \\\\\\\"{\\\\\\\\\\\\\\\"columns\\\\\\\\\\\\\\\":[\\\\\\\\\\\\\\\"0\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"1\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"3\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"4\\\\\\\\\\\\\\\",\\\\\\\\\\\\\\\"5\\\\\\\\\\\\\\\"],\\\\\\\\\\\\\\\"index\\\\\\\\\\\\\\\":[0,1,2,3],\\\\\\\\\\\\\\\"data\\\\\\\\\\\\\\\":[[0.2,0.1,0.5,0.07,0.09,0.1],[0.3,0.2,0.6,0.08,0.1,0.2],[0.4,0.3,0.7,0.09,0.11,0.3],[0.5,0.4,0.8,0.1,0.12,0.4]]}\\\\\\\", \\\\\\\"orient\\\\\\\": \\\\\\\"split\\\\\\\", \\\\\\\"dtype\\\\\\\": {\\\\\\\"0\\\\\\\": \\\\\\\"float64\\\\\\\", \\\\\\\"1\\\\\\\": \\\\\\\"float64\\\\\\\", \\\\\\\"2\\\\\\\": \\\\\\\"float64\\\\\\\", \\\\\\\"3\\\\\\\": \\\\\\\"float64\\\\\\\", \\\\\\\"4\\\\\\\": \\\\\\\"float64\\\\\\\", \\\\\\\"5\\\\\\\": \\\\\\\"float64\\\\\\\"}, \\\\\\\"is_multiindex\\\\\\\": false, \\\\\\\"is_multicolumn\\\\\\\": false}}\\\"}, \\\"element_index\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [{\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 0}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 1}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 2}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 3}, {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"int64\\\", \\\"_object\\\": 4}], \\\"dtype\\\": \\\"int64\\\"}, \\\"element\\\": \\\"sink\\\", \\\"values\\\": null, \\\"profile_name\\\": {\\\"_module\\\": \\\"numpy\\\", \\\"_class\\\": \\\"array\\\", \\\"_object\\\": [\\\"0\\\", \\\"1\\\", \\\"2\\\", \\\"3\\\", \\\"4\\\"], \\\"dtype\\\": \\\" Date: Fri, 22 Dec 2023 08:47:37 +0100 Subject: [PATCH 122/126] bug in release yml fixed --- .github/workflows/release.yml | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a583ac9a5..71bafbf41 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -86,7 +86,8 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest igraph pytest-split - if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi + if [${{ matrix.python-version != '3.11' }}]; then python -m pip install numba; fi + shell: bash - name: Install pandapipes from TestPyPI if: ${{ inputs.upload_server == 'testpypi'}} run: | diff --git a/setup.py b/setup.py index cad8d74c7..655a81bd9 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='pandapipes', - version='0.9.0', + version='0.9.0.post1', author='Simon Ruben Drauz-Mauel, Daniel Lohmeier, Jolando Marius Kisse', author_email='simon.ruben.drauz-mauel@iee.fraunhofer.de, daniel.lohmeier@retoflow.de, ' 'jolando.kisse@uni-kassel.de', From f2470a401df078569001ffd24da10d8e4c55374f Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 22 Dec 2023 08:53:36 +0100 Subject: [PATCH 123/126] test windows and ubuntu --- .github/workflows/run_tests_develop.yml | 23 ++++++++++++++--------- .github/workflows/run_tests_master.yml | 20 ++++++++++++-------- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index b0bcb60e2..6949d5abe 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -14,11 +14,12 @@ on: jobs: build: - - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -29,7 +30,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest igraph pytest-split - if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi + if [${{ matrix.python-version != '3.11' }}]; then python -m pip install numba; fi 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 . @@ -52,12 +53,12 @@ jobs: verbose: true linting: - - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10'] - + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -84,10 +85,12 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics tutorial_tests: - runs-on: ubuntu-latest + #runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -98,7 +101,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest nbmake pytest-xdist pytest-split igraph - if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi + if [${{ matrix.python-version != '3.11' }}]; then python -m pip install numba; fi 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 . @@ -110,10 +113,12 @@ jobs: python -m pytest --nbmake -n=auto "./tutorials" docs_check: - runs-on: ubuntu-latest + #runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [ '3.10' ] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index 153a78694..64d530524 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -1,7 +1,7 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -# pandapipes-master branch has to work with pandapower-master branch +# pandapipes-master branch is designed to work with pandapower-master branch name: ppipes_master @@ -13,12 +13,12 @@ on: jobs: build: - - runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} + #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] - + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -29,7 +29,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest igraph pytest-split - if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi + if [${{ matrix.python-version != '3.11' }}]; then python -m pip install numba; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower; python -m pip install . @@ -52,10 +52,12 @@ jobs: verbose: true tutorial_tests: - runs-on: ubuntu-latest + #runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -66,7 +68,7 @@ jobs: run: | python -m pip install --upgrade pip python -m pip install pytest nbmake pytest-xdist pytest-split igraph - if ${{ matrix.python-version != '3.11' }}; then python -m pip install numba; fi + if [${{ matrix.python-version != '3.11' }}]; then python -m pip install numba; fi if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower python -m pip install . @@ -78,10 +80,12 @@ jobs: python -m pytest --nbmake -n=auto "./tutorials" docs_check: - runs-on: ubuntu-latest + #runs-on: ubuntu-latest + runs-on: ${{ matrix.os }} strategy: matrix: python-version: [ '3.10' ] + os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From 4663e83284e52dc4866c2dced44218f0ee383548 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 22 Dec 2023 08:58:03 +0100 Subject: [PATCH 124/126] test windows and ubuntu --- .github/workflows/run_tests_develop.yml | 7 ++++--- .github/workflows/run_tests_master.yml | 4 +--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 6949d5abe..1cd5d011a 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -34,6 +34,7 @@ jobs: 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 . + shell: bash - name: List all installed packages run: | python -m pip list @@ -72,6 +73,7 @@ jobs: 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 . + shell: bash - name: List all installed packages run: | python -m pip list @@ -105,6 +107,7 @@ jobs: 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 . + shell: bash - name: List all installed packages run: | python -m pip list @@ -113,12 +116,10 @@ jobs: python -m pytest --nbmake -n=auto "./tutorials" docs_check: - #runs-on: ubuntu-latest - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: python-version: [ '3.10' ] - os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index 64d530524..ccdb20c8b 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -80,12 +80,10 @@ jobs: python -m pytest --nbmake -n=auto "./tutorials" docs_check: - #runs-on: ubuntu-latest - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: matrix: python-version: [ '3.10' ] - os: [ ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} From b1c734c7aefe86e139ec24865ffe5c4104cc1f2c Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 22 Dec 2023 09:11:53 +0100 Subject: [PATCH 125/126] remove comments add shell --- .github/workflows/run_tests_develop.yml | 3 --- .github/workflows/run_tests_master.yml | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_tests_develop.yml b/.github/workflows/run_tests_develop.yml index 1cd5d011a..acf46022d 100644 --- a/.github/workflows/run_tests_develop.yml +++ b/.github/workflows/run_tests_develop.yml @@ -15,7 +15,6 @@ on: jobs: build: runs-on: ${{ matrix.os }} - #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] @@ -55,7 +54,6 @@ jobs: linting: runs-on: ${{ matrix.os }} - #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.10'] @@ -87,7 +85,6 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics tutorial_tests: - #runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: matrix: diff --git a/.github/workflows/run_tests_master.yml b/.github/workflows/run_tests_master.yml index ccdb20c8b..9be8fe64f 100644 --- a/.github/workflows/run_tests_master.yml +++ b/.github/workflows/run_tests_master.yml @@ -14,7 +14,6 @@ on: jobs: build: runs-on: ${{ matrix.os }} - #runs-on: ubuntu-latest strategy: matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] @@ -33,6 +32,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower; python -m pip install . + shell: bash - name: List all installed packages run: | python -m pip list @@ -52,7 +52,6 @@ jobs: verbose: true tutorial_tests: - #runs-on: ubuntu-latest runs-on: ${{ matrix.os }} strategy: matrix: @@ -72,6 +71,7 @@ jobs: if [ -f requirements.txt ]; then pip install -r requirements.txt; fi python -m pip install git+https://github.com/e2nIEE/pandapower@master#egg=pandapower python -m pip install . + shell: bash - name: List all installed packages run: | python -m pip list From 9ee1336f023055718111b07213ebaae9ca43fe91 Mon Sep 17 00:00:00 2001 From: sdrauz Date: Fri, 22 Dec 2023 09:36:45 +0100 Subject: [PATCH 126/126] remove post1 from version tag --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 655a81bd9..cad8d74c7 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( name='pandapipes', - version='0.9.0.post1', + version='0.9.0', author='Simon Ruben Drauz-Mauel, Daniel Lohmeier, Jolando Marius Kisse', author_email='simon.ruben.drauz-mauel@iee.fraunhofer.de, daniel.lohmeier@retoflow.de, ' 'jolando.kisse@uni-kassel.de',