{"id":20612618,"url":"https://github.com/pypsa/pypsa-za","last_synced_at":"2025-04-15T07:07:39.889Z","repository":{"id":146649715,"uuid":"105310269","full_name":"PyPSA/pypsa-za","owner":"PyPSA","description":"PyPSA Model of the South African Energy System","archived":false,"fork":false,"pushed_at":"2023-09-22T14:43:07.000Z","size":664,"stargazers_count":19,"open_issues_count":0,"forks_count":9,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-15T07:07:34.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PyPSA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-09-29T19:38:31.000Z","updated_at":"2025-02-22T14:03:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"f950307b-de89-455c-977c-88354202241a","html_url":"https://github.com/PyPSA/pypsa-za","commit_stats":{"total_commits":107,"total_committers":1,"mean_commits":107.0,"dds":0.0,"last_synced_commit":"2913b1eb577ee6a8d92b9b59ceb33f2a1c82c132"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fpypsa-za","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fpypsa-za/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fpypsa-za/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fpypsa-za/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyPSA","download_url":"https://codeload.github.com/PyPSA/pypsa-za/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249023723,"owners_count":21199960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T11:05:55.381Z","updated_at":"2025-04-15T07:07:39.867Z","avatar_url":"https://github.com/PyPSA.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyPSA-ZA\n\n[PyPSA](https://pypsa.org/) model of the South African electricity system at the level of ESKOM's supply regions.\n\n![Visualisation of optimal capacities and costs in the least cost scenario](imgs/network_csir-moderate_redz_E_LC_p_nom_ext.png)\n\nThe model is described and evaluated in the paper [PyPSA-ZA: Investment and operation co-optimization of integrating wind and solar in South Africa at high spatial and temporal detail](https://arxiv.org/abs/1710.11199), 2017, [arXiv:1710.11199](https://arxiv.org/abs/1710.11199).\n\nThis repository contains the scripts to automatically reproduce the analysis.\n\n## Instructions\n\nTo build and solve the model, a computer with about 20GB of memory with a strong\ninterior-point solver supported by the modelling library\n[PYOMO](https://github.com/Pyomo/pyomo) like Gurobi or CPLEX are required.\n\nWe recommend as preparatory steps (the path before the `%` sign denotes the\ndirectory in which the commands following the `%` should be entered):\n\n1. cloning the repository using `git` (**to a directory without any spaces in the path**)\n   ```shell\n   /some/other/path % cd /some/path/without/spaces\n   /some/path/without/spaces % git clone https://github.com/FRESNA/pypsa-za.git\n   ```\n\n2. installing the necessary python dependencies using conda (from within the `pypsa-za` directory)\n   ```shell\n   .../pypsa-za % conda env create -f environment.yaml\n   .../pypsa-za % source activate pypsa-za  # or conda activate pypsa-za on windows\n   ```\n\n3. getting the separate [data bundle](https://vfs.fias.science/d/f204668ef2/files/?p=/pypsa-za-bundle.7z\u0026dl=1) (see also [Data dependencies] below) and unpacking it in `data`\n   ```shell\n   .../data % wget \"https://vfs.fias.science/d/f204668ef2/files/?dl=1\u0026p=/pypsa-za-bundle.7z\"\n   .../data % 7z x pypsa-za-bundle.7z\n   ```\n\nAll results and scenario comparisons are reproduced using the workflow\nmanagement system `snakemake`\n```shell\n.../pypsa-za % snakemake\n[... will take about a week on a recent computer with all scenarios ...]\n```\n\n`snakemake` will first compute several intermediate data files in the directory\n`resources`, then prepare unsolved networks in `networks`, solve them and save\nthe resulting networks in `results/version-0.x/networks` and finally render the\nmain plots into `results/version-0.5/plots`.\n\nInstead of computing all scenarios (defined by the product of all wildcards in\nthe `scenario` config section), `snakemake` also allows to compute only a\nspecific scenario like `csir-aggressive_redz_E_LC`:\n```shell\n.../pypsa-za % snakemake results/version-0.5/plots/network_csir-aggressive_redz_E_LC_p_nom\n```\n\n## Data dependencies\n\nFor ease of installation and reproduction we provide a bundle\n[`pypsa-za-bundle.7z`](https://vfs.fias.science/d/f204668ef2/files/?p=/pypsa-za-bundle.7z\u0026dl=1)\nwith the necessary data files:\n\n| File                                               | Citation                                                                                                                                                                                                       |\n|----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| South_Africa_100m_Population                       | WorldPop, South Africa 100m Population (2013). [doi:10.5258/soton/wp00246](https://doi.org/10.5258/soton/wp00246)                                                                                             |\n| Supply area normalised power feed-in for PV.xlsx   | D. S. Bofinger, B. Zimmermann, A.-K. Gerlach, D. T. Bischof-Niemz, C. Mushwana, [Wind and Solar PV Resource Aggregation Study for South Africa](https://www.csir.co.za/csir-energy-centre-documents). (2016). |\n| Supply area normalised power feed-in for Wind.xlsx | same as above                                                                                                                                                                                                 |\n| EIA_hydro_generation_2011_2014.csv                 | U.S. EIA, [Hydroelectricity Net Generation ZA and MZ 2011-2014](http://tinyurl.com/EIA-hydro-gen-ZA-MZ-2011-2014) (2017).                                                                                     |\n| Existing Power Stations SA.xlsx                    | Compiled by CSIR from [Eskom Holdings](https://www.eskom.co.za/) (Jan 2017) and RSA DOE, [IRP2016](http://www.energy.gov.za/IRP/2016/Draft-IRP-2016-Assumptions-Base-Case-and-Observations-Revision1.pdf)     |\n| Power_corridors                                    | RSA DEA, [REDZs Strategic Transmission Corridors](https://egis.environment.gov.za/) (Apr 2017)                                                                                                                |\n| REDZ_DEA_Unpublished_Draft_2015                    | RSA DEA, [Wind and Solar PV Energy Strategic Environmental Assessment REDZ Database](https://egis.environment.gov.za/) (Mar 2017)                                                                             |\n| SACAD_OR_2017_Q2                                   | RSA DEA, [South Africa Conservation Areas Database (SACAD)](https://egis.environment.gov.za/) (Jun 2017)                                                                                                      |\n| SAPAD_OR_2017_Q2                                   | RSA DEA, [South Africa Protected Areas Database (SAPAD)](https://egis.environment.gov.za/) (Jun 2017)                                                                                                         |\n| SystemEnergy2009_13.csv                            | Eskom, System Energy 2009-13 Hourly, available from Eskom on request                                                                                                                                          |\n| SALandCover_OriginalUTM35North_2013_GTI_72Classes  | GEOTERRAIMAGE (South Africa), [2013-14 South African National Land-Cover Dataset](https://egis.environment.gov.za/data_egis/node/109) (2017)                                                                  |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fpypsa-za","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypsa%2Fpypsa-za","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fpypsa-za/lists"}