Key changes/actions taken:
*Using pypsa-africa version available in 02.06.22
*new virtual env was created with conda on the path to repository ( ---/path/pypsa-africa conda env create -f envs/environment.yaml)
-before creating the environment, change the order of import for fiona and geopandas to solve a circular import problem that might appear
-additional libraries are included if errors mentioning them appear (for windows): Dot (conda install graphviz)
*a config.yaml is created based on the config.default.yaml file and the generic data bundle is downloaded (---/path/pypsa-africa snakemake -j 1 retrieve_databundle_light --force)
*The confing.yaml file was modified to run only for Bolivia (neighbouring countries are added do to problems with the offshore_shapes file (empty for only Bolivia due to being a landlocked country) amd the build_cutout rule) and the "build_cutout" and "build_natura_raster" rules are enabled for their first run.
-countries: ["AR","BO","PE"]
-scenario:
simpl: ['']
ll: ['copt']
clusters: [10]
opts: [Co2L-3H]
-enable:
retrieve_databundle: true # Recommended 'true', for the first run. Otherwise data might be missing.
download_osm_data: true # If 'true', OpenStreetMap data will be downloaded for the above given countries
build_natura_raster: false # If True, than an exclusion raster will be build
build_cutout: true
*The entire workflow is rerun with the command "---/path/pypsa-africa snakemake -j 1 solve_all_networks --forceall"
*The model run without problems until reaching the rule "build_powerplants" due to an AtributeError for a data frame modifications were made in the "C:\Users\Lenovo\anaconda3\envs\pypsa-africa\Lib\site-packages\powerplantmatching\heuristics.py" file to solve it
-in line 557 "[...] it's trying to fill the nan values with values from column named 'energy_source'. This column actually doesn't exist, you can change it to "energy_source_level_1" and it should work just fine."
-this problem is detailed in the issue/bug report: https://github.com/pypsa-meets-africa/pypsa-africa/issues/358
*In order to allow the model to run the optimization rules the gurobi library is installed with conda (a previous download and installation is required, aswell as an academic licence)
-conda config --add channels https://conda.anaconda.org/gurobi
-conda install gurobi
*After the model is solved for the selection of countries, a new run is made considering the databases generated in the config.yaml (BO can't be run alone do to landlock problems in "build_renewable_profiles" rules) file:
-countries: ["AR","BO","PE"]
-scenario:
simpl: ['']
ll: ['copt']
clusters: [15]
opts: [Co2L-3H]
-enable:
retrieve_databundle: false
download_osm_data: false
build_natura_raster: false
build_cutout: false
*Additional jupyter_lab notebooks were created to review/compare results between different scenarios ("0_solve_network_results_BO_15Bus.ipynb" shows that no initial (p_nom) generators are considered for Bolivia)
PyPSA meets Africa is a free and open source software initiative aiming to develop a powerful energy system model for Africa. The tool was first released end of 2022 and is heavily based on PyPSA and PyPSA-Eur. In 2022 we will focus on Earth wide expansion. Stay tuned and join our mission - We look for users, co-developers and leaders!
A short presentation about our project and its aims is given on our website. There you can also sign-up to our Newsletter. Watch our latest discussion with African leaders about Open Energy System Modelling in Africa: State of the Art and Future Opportunities. Let's work together for a better future.
There are multiple ways to get involved and learn more about our work. That's how we organise ourselves:
- Discord NEW! (Open)
- General initiative meeting (Open)
- every month Thursday 16-17:00 (UTC+0) download .ics
- join for project news and high-level code updates
- meeting hosted on Discord
- open agenda. See what we will discuss. Invited members have edit rights.
- Buddy talk (Open)
- every Friday between 17-18:00 (UTC+0)
- book a 20min meeting with Max to discuss anything you like
- booking link: app.autobook.me/max-parzen/pypsa-meets-africa (developed by @mnm-matin)
- Specific code meeting (Open)
- meeting hosted on Discord
- join updates, demos, Q&A's, discussions and the coordination of each work package
- Demand creation and prediction meeting, on demand
- AI asset detection meeting, every Tuesday 15:30 UTC+0, download .ics
- Sector coupling meeting, every Thursday 09:00 UTC+0, download .ics
- Data workflow and architecture meeting, every Thursday 13:30 UTC+0, download .ics
- Outreach meeting (Open)
- every second week, Tuesday 17:00 UTC+0
- planning, discussing events, workshops, communication, community activities
- Google Drive
- access to minutes, presentations, lists, documents (access to minutes)
- Open your terminal at a location where you want to install pypsa-africa. Type the following in your terminal to download the package from GitHub:
.../some/path/without/spaces % git clone https://github.com/pypsa-meets-africa/pypsa-africa.git
- The python package requirements are curated in the
envs/environment.yaml
file. The environment can be installed using:
.../pypsa-africa % conda env create -f envs/environment.yaml
-
For running the optimization one has to install the solver. We can recommend the open source HiGHs solver which installation manual is given here.
-
To use jupyter lab (new jupyter notebooks) continue with the ipython kernel installation and test if your jupyter lab works:
.../pypsa-africa % ipython kernel install --user --name=pypsa-africa
.../pypsa-africa % jupyter lab
- In the folder open a terminal/command window to be located at this path
~/pypsa-africa/
- Activate the environment
conda activate pypsa-africa
- Rename config.tutorial.yaml to config.yaml. For instance in Linux:
mv config.tutorial.yaml config.yaml
- Run a dryrun of the Snakemake workflow by typing simply in the terminal:
Remove the -n to do a real run. Follow the tutorial of PyPSA-Eur 1 and 2 on YouTube to continue with an analysis.
snakemake -j 1 solve_all_networks -n
- We recently updated some hackathon material for PyPSA-Africa. The hackathon contains jupyter notebooks with exercises. After going through the 1 day theoretical and practical material you should have a suitable coding setup and feel confident about contributing.
- The get a general feeling about the PyPSA functionality, we further recommend going through the PyPSA and Atlite examples.
- We are happy to answer questions and help with issues if they are public. Through being public the wider community can benefit from the raised points. Some tips. Bugs and feature requests should be raised in the GitHub Issues. General workflow or user questions as well as discussion points should be posted at the GitHub Discussions tab. Happy coding.
The documentation is available here: documentation.