pandaenergy-extension
Library for converting pandapower/pandapipes networks to a graph representation and extending controller functionality.
Installing
The peext-library is available as package on PyPi, therfore you can install it using pip.
pip install peext
However, as usual, it is recommended to install it in a virtual environment:
pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install peext
Quickstart
In peext you can execute a steady-state time series simulation coupled with mango-agents using pandapower/pandapipes.
To setup the simulation you need to construct a MASWorld object and start the asyncio based simulation.
import asyncio
import peext.scenario.network as pn
from peext.world.core import MASWorld
# construct the world using a coroutine constructing the mango
# container + agents
world = MASWorld(create_mas, pn.create_small_test_multinet(), max_steps=10)
# Start the simulation using asyncio
loop = asyncio.get_event_loop()
loop.run_until_complete(future=world.run())
In this example a MASWorld is constructed using the mango setup routine create_mas and the small multi energy test network pn.create_small_test_multinet(). The mango setup routine could look like this.
async def create_mas(me_network: MENetwork):
"""Create a multi agent system within a single container.
:param me_network: the network
:type me_network: network.MENetwork
:return: container the agents live in
:rtype: Container
"""
container = await Container.factory(addr=('127.0.0.2', 5555))
agents = []
for node in me_network.nodes:
a = RoleAgent(container)
# random actions
a.add_role(RandomRegulatorRole(node))
agents.append(a)
return container, agents
This coroutine-function will setup a mango-agent Container on port 5555 with the internal adress '127.0.0.2'. Also it creates an agent for every node in the multi-energy network. The network is represented by an instance of the MENetwork class. For more information about defining roles, creating agents in mango, consult the mango documentation (https://mango-agents.readthedocs.io/en/latest/).
Package documentation
In this section the important packages (and their important classes), their objective and capabilities are described.
MASWorld
A MASWorld (peext.world.core) is capable of coupling a mango-agents simulation with a multi-energy pandapipes controller simulation. It expects at least 2 object:
- the multinet
- a coroutine-function, which setups mango-agents and containers.
Besides executing the simulation the World will collect data every step and persist the collected data and the network itself for later usage (f.e. with dcnv).
MENetwork
The MENetwork is the central network model when using peext components and resides in the package peext.network. While pandapower/pipes uses pandas dataframes to store all informations about the components and the simulation results, the MENetwork represents every component by a node or an edge. Nodes are f.e. generators, loads, while edges f.e. are lines, pipes and trafos. In this representation buses and junctions are omitted. If the data is needed it can be accessed using the methods get_bus_junc_res_data and get_bus_junc. Exception: empty junctions and buses will be represented as own nodes.
Pandapipes/Pandapower Controller
The peext-library implements a set of controller representing coupling points in the multi-energy network:
| Name | Description | Components | Modes |
|---|---|---|---|
| CHPControlMultiEnergy | Implements a regulatable (heat and power/gas) CHP coupling point with an optional heat storage | heat_exchanger, gen/sgen, sink, optional EnergyStorage | Power driven/Gas driven |
| RegulatedG2PControlMultiEnergy | Implements a regulatable G2P coupling point. Essentially equivalent to CHPControllMultiEnergy with heat_regulation = 0 | gen/sgen, sink | Power driven/Gas driven |
| RegulatedP2GControlMultiEnergy | Implements a regulatable P2G coupling point. | source, load | Power driven |
Furthermore there are controllers to extend the capabilites of the MENetwork represenation and for collecting/plotting data:
- HistoryController
- Collecting data for historical timesteps, providing a bridge to this data in the MENetwork instance
- PlottingController
- Implements live plotting of a chosen set of components in matplotlib windows
- StaticPlottingController
- Capable of collecting the network data every step. Used internally by the MASWorld for persisting the network results.
Metadata
Release files for peext 0.5.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| peext-0.5.2.tar.gz | 37.3 kB | Without provenance | Details for peext-0.5.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| peext-0.5.2-py3-none-any.whl | Python 3 | none | any | Details for peext-0.5.2-py3-none-any.whl |
Total release size: 73.1 kB
Release files / peext-0.5.2.tar.gz
| Download URL | peext-0.5.2.tar.gz |
|---|---|
| Size | 37.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21365f58cfea752aadf86a29df744ff6709e63af3a9b6a3d09f5d7e57e24eeb4
|
|
BLAKE2b-256 checksum How to use checksums |
39db2c3db96f637c5c3e70fab2a1abd929cb9d49729d308fb3a1b85d734eced4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.2
|
Release files / peext-0.5.2-py3-none-any.whl
| Download URL | peext-0.5.2-py3-none-any.whl |
|---|---|
| Size | 35.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
565a6c3c34592553fa4e66bc77c87906139496e39e78ef475feb46d5bb992de2
|
|
BLAKE2b-256 checksum How to use checksums |
b6ca9777fa513c4dc25efff862a3fabcdfb337e237bac5226e22ab07187ea611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.8.2
|
Security for peext 0.5.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.