The model is described in the documentation and in the paper PyPSA.
For details about dev containers see Dev Containers.
This repository is an attempt to use pre-built images to speed up development. Learn more at the Dev Containers Guide, inspired by the repository kubernetes-devcontainer.
Link to the package: pypsa-eur.
- You need Visual Studio Code installed.
- Install Docker: Install Docker.
- Install the Dev Containers extension for VS Code: Install the Extension.
- Clone this repo and open it in VS Code.
- Hit
Ctrl+Shift+P
to open the command palette in VS Code and search for "Dev Containers". - Wait for the image to be downloaded.
- Once finished, you will be inside the container.
- Inside the container, you can see the welcome message.
- Open the terminal and see that the
pypsa-eur
environment is pre-configured. - Navigate to the files to see the solved folders for the electricity tutorial copied from the container.
Addressing issues like these Stack Overflow.
Here I attempt to propose a debugging guide where we can use Snakemake commands to specify config and stop execution in the middle with debugpy
and attach using VS Code debugger.
More detailed guide: VS Code Python Debugging.
These steps can be followed whether you are using the devcontainers or not.
- Let's say you have electricity tutorial already ran successfully.
- Let's delete the results folder:
sudo rm -r results
-
Now, if we want to rebuild the results folder and resulting networks in debug mode:
-
First, let's navigate to the 'scripts/solvenetwork.py' reference file solve_network.py.
-
Import
debugpy
-
-
Instead of using this command:
snakemake -call results/test-elec/networks/elec_s_6_ec_lcopt_.nc --configfile config/test/config.electricity.yaml
- We have to modify it to use one core only and pass the
--debug
flag to Snakemake:
snakemake --cores 1 results/test-elec/networks/elec_s_6_ec_lcopt_.nc --configfile config/test/config.electricity.yaml --debug
-
Navigate to the "Run and Debug" tab in VS Code and use the debugger attach configuration to launch the debugger, file link launch.json.
-
Once launched, the debugger will attach to paused code. From here on, you can add breakpoints to the code and use the debugger UI.
We strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.
- In case of code-related questions, please post on stack overflow.
- For non-programming related and more general questions please refer to the mailing list.
- To discuss with other PyPSA users, organise projects, share news, and get in touch with the community you can use the discord server.
- For bugs and feature requests, please use the PyPSA-Eur Github Issues page.
The code in PyPSA-Eur is released as free software under the
MIT License, see doc/licenses.rst
.
However, different licenses and terms of use may apply to the various
input data, see doc/data_sources.rst
.