Interdisciplinary Project at the Chair of Renewable and Sustainable Energy Systems at TUM (WS22-SS23)
A tool for displaying, editing and optimizing low-voltage distribution systems in real time
The main script runs in Python Flask (Version 3.8.16). Additional requirements are:
- Pandapower: https://www.pandapower.org/
- PostgreSQL: https://www.postgresql.org/
- PostGIS: https://postgis.net/
It is highly encouraged to set up a dedicated virtual environment for pylovopt. We recommend using the Python distribution Anaconda.
- Anaconda (Python 3)/Miniconda. Choose the 64-bit installer if possible. During the installation procedure, keep both checkboxes "modify PATH" and "register Python" selected! If only higher Python versions are available, you can switch to a specific Python Version by typing conda install python=VERSION
In a directory of your choice, clone this repository by executing:
git clone https://github.com/tum-ens/pylovopt.git --recurse-submodules
You want to use --recurse-submodules to pull the Connector-Syn-grid repo as well.
Open the Anaconda Powershell Prompt and navigate to the cloned directory folder and execute the following commands to set up the Anaconda environment:
cd /path/to/cloned/directory/pylovopt
conda env create -f environment.yml
cd ../Connector-syn-grid
pip install .
Open a terminal of your choice and enter the following command to connect to the database via localhost. Authenticate yourself with your own username and password. Without access to the database the tool will not work.
ssh -L 1111:localhost:5432 [user]@10.195.1.137
Open the Anaconda Powershell Prompt and execute the following commands
conda activate TUM_Syngrid
cd /path/to/cloned/directory/pylovopt
flask --app maptool --debug run
Then navigate to http://127.0.0.1:5000 in a browser of your choice (though preferably Chrome, because that is the only browser the CSS layout is guaranteed to work with at the moment)
tbc
Once you have opened the tool in a browser of your choice you will be presented with a map view centered somewhere in Bavaria.
You can enter a German PLZ into the input in the top right corner to show all already existing nets for that PLZ. A popup window will let you select one of the available networks for that area, or you can choose to create a new version of the network. Once you have submitted a valid PLZ, the tool will display the generated networks on the map. You can choose one of them by clicking on it or selecting it via the list on the right and clicking "Select Network"
- You can select an area by drawing a shape on the map via the tools on the left side of the page and then clicking the "Select Area" button. At the moment this will only display all the buildings the database can find within the selected area. Clicking on individual buildings opens a popup that allows you to delete a specific building.
- Once you are satisfied, you can click "Generate Network" to generate pylovo networks based on the buildings you selected. Once the networks have been generated, you can access each one of them by clicking on them NOTE: at the moment there is a bug involving the building select, meaning that networks are based on the initial area selection; building deletion is not taken into consideration.
- Clicking the "Select Network" button will change your view, displaying the selected network in more detail. Now you can choose and edit individual features as well as delete them.
You can access features via the lists on the right-hand side of the screen or by clicking on them on the map itself.
- Once you are satisfied with your network, you can click the "Finish Editing" button and get taken to the Urbs Editor Setup view. Here you can once again access different features relevant for the urbs run through the GUI. Once everything has been set to your liking you can click the "Finish Urbs Setup" button, which will start the execution of urbs.
The official Flask Documentation: https://flask.palletsprojects.com/en/2.2.x/quickstart/
W3Schools HTML Tutorials: https://www.w3schools.com/html/
W3Schools JavaScript Tutorials: https://www.w3schools.com/js/