{"id":31851,"name":"PyPSA-KZ","description":"Aims to model the Kazakh power system, incorporating a substantial increase in variable generation, such as solar and wind, surpassing the current official mid-term policy goal of 15% of all renewable energy sources in generation by 2030.","url":"https://github.com/pypsa-meets-earth/pypsa-kz-data","last_synced_at":"2026-05-18T23:03:58.430Z","repository":{"id":174956604,"uuid":"626820789","full_name":"pypsa-meets-earth/pypsa-kz-data","owner":"pypsa-meets-earth","description":"Extra data for Kazakhstan model that will be used as input for PyPSA-Earth","archived":false,"fork":false,"pushed_at":"2024-08-11T17:21:48.000Z","size":772,"stargazers_count":9,"open_issues_count":1,"forks_count":20,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-21T03:51:23.459Z","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-meets-earth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSES/AGPL-3.0-or-later.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-12T08:20:12.000Z","updated_at":"2026-04-13T18:32:59.000Z","dependencies_parsed_at":"2024-08-11T18:57:27.997Z","dependency_job_id":null,"html_url":"https://github.com/pypsa-meets-earth/pypsa-kz-data","commit_stats":{"total_commits":189,"total_committers":6,"mean_commits":31.5,"dds":0.2857142857142857,"last_synced_commit":"ca3bbace79636122a6725fa8488d9e2d5bfdd9ed"},"previous_names":["pypsa-meets-earth/pypsa-kz-data"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pypsa-meets-earth/pypsa-kz-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pypsa-meets-earth","download_url":"https://codeload.github.com/pypsa-meets-earth/pypsa-kz-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32694980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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"}},"owner":{"login":"pypsa-meets-earth","name":"PyPSA meets Earth","uuid":"84225086","kind":"organization","description":"An open source energy system model initiative for our Earth","email":null,"website":"https://pypsa-meets-earth.github.io/","location":null,"twitter":"pypsameetsearth","company":null,"icon_url":"https://avatars.githubusercontent.com/u/84225086?v=4","repositories_count":11,"last_synced_at":"2023-03-04T04:30:40.464Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/pypsa-meets-earth","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2022-11-14T09:36:13.738Z","updated_at":"2023-03-04T04:30:40.503Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pypsa-meets-earth","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pypsa-meets-earth/repositories"},"packages":[],"commits":{"id":1343224,"full_name":"pypsa-meets-earth/pypsa-kz-data","default_branch":"main","total_commits":197,"total_committers":5,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":39.4,"dds":0.2791878172588832,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-13T06:02:26.680Z","last_synced_commit":"363a18b86d48df4af4f4215abeef9f50f80ee214","created_at":"2023-09-12T09:18:01.516Z","updated_at":"2026-04-13T06:02:25.555Z","committers":[{"name":"yerbol-akhmetov","email":"yerbol.akhmetov.93@gmail.com","login":"yerbol-akhmetov","count":142},{"name":"martacki","email":"martha.frysztacki@gmail.com","login":"martacki","count":47},{"name":"Max Parzen","email":"max.parzen@ed.ac.uk","login":"pz-max","count":5},{"name":"ekatef","email":"e.v.kasilova@gmail.com","login":"ekatef","count":2},{"name":"Alfiya","email":"34157901+alfiyaks","login":"alfiyaks","count":1}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-15T00:00:09.512Z","repositories_count":6213593,"commits_count":903370865,"contributors_count":34924174,"owners_count":1144562,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"pypsa-meets-earth/pypsa-kz-data","html_url":"https://github.com/pypsa-meets-earth/pypsa-kz-data","last_synced_at":"2026-04-07T03:00:19.593Z","status":"error","issues_count":1,"pull_requests_count":43,"avg_time_to_close_issue":574587.0,"avg_time_to_close_pull_request":241625.69047619047,"issues_closed_count":1,"pull_requests_closed_count":42,"pull_request_authors_count":4,"issue_authors_count":1,"avg_comments_per_issue":1.0,"avg_comments_per_pull_request":0.3023255813953488,"merged_pull_requests_count":32,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":0,"past_year_pull_requests_count":1,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":633001.0,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":1,"past_year_pull_request_authors_count":1,"past_year_issue_authors_count":0,"past_year_avg_comments_per_issue":null,"past_year_avg_comments_per_pull_request":3.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":1,"created_at":"2023-09-12T09:18:11.565Z","updated_at":"2026-04-07T03:00:19.593Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/pypsa-meets-earth%2Fpypsa-kz-data/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"COLLABORATOR":1},"pull_request_author_associations_count":{"CONTRIBUTOR":28,"COLLABORATOR":12},"issue_authors":{"martacki":1},"pull_request_authors":{"yerbol-akhmetov":28,"martacki":9,"alfiyaks":2,"ekatef":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-15T00:00:09.535Z","repositories_count":14269060,"issues_count":34630327,"pull_requests_count":113269358,"authors_count":11234946,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{},"past_year_pull_request_authors":{},"maintainers":[{"login":"martacki","count":10,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/martacki"},{"login":"yerbol-akhmetov","count":3,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/yerbol-akhmetov"}],"active_maintainers":[]},"events":{"total":{"ForkEvent":2,"WatchEvent":2},"last_year":{"ForkEvent":1,"WatchEvent":1}},"keywords":[],"dependencies":[{"ecosystem":"actions","filepath":".github/workflows/ci-linux.yml","sha":null,"kind":"manifest","created_at":"2023-10-12T17:23:52.541Z","updated_at":"2023-10-12T17:23:52.541Z","repository_link":"https://github.com/pypsa-meets-earth/pypsa-kz-data/blob/main/.github/workflows/ci-linux.yml","dependencies":[{"id":14178076992,"package_name":"actions/checkout","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":14178076993,"package_name":"conda-incubator/setup-miniconda","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false},{"id":14178076994,"package_name":"actions/cache","ecosystem":"actions","requirements":"v2","direct":true,"kind":"composite","optional":false}]}],"score":3.9120230054281464,"created_at":"2023-09-12T07:44:15.147Z","updated_at":"2026-05-18T23:03:58.432Z","avatar_url":"https://github.com/pypsa-meets-earth.png","language":"Python","category":"Energy Systems","sub_category":"Global and Regional Energy System Models","monthly_downloads":0,"total_dependent_repos":0,"total_dependent_packages":0,"readme":"\u003c!--\nSPDX-FileCopyrightText:  pypsa-kz-data authors\n\nSPDX-License-Identifier: AGPL-3.0-or-later\n--\u003e\n\n# About the Project\n\n\u003cimg src=\"https://github.com/pypsa-meets-earth/pypsa-kz-data/assets/53824825/ca7893de-26e2-47ad-a3e4-d91cd6716652\" alt=\"Open Energy Transition Logo\" width=\"280\" height=\"100\" align=\"right\"\u003e\n\u003cimg src=\"https://github.com/pypsa-meets-earth/pypsa-kz-data/assets/53824825/63bd0250-c54a-4ce1-8df3-eb116baac01b\" alt=\"Agora Energiewende Logo\" width=\"240\" height=\"100\"\u003e\n\u003cbr\u003e\n\nAgora Energiewende aims to model the Kazakh power system, incorporating a substantial increase in variable generation, such as solar and wind, surpassing the current official mid-term policy goal of 15% of all renewable energy sources (RES) in generation by 2030. This endeavor has received support from Open Energy Transition on the modeling side.\n\nUsed for [2024 study](https://www.agora-energiewende.org/publications/modernising-kazakhstans-coal-dependent-power-sector-through-renewables), \"Modernising Kazakhstan’s coal-dependent power sector through renewables - Challenges, solutions and scenarios up to 2030 and beyond\"\n\n## Development status: Active and Stable\n\n[![CI-Linux](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml/badge.svg?branch=main)](https://github.com/pypsa-meets-earth/pypsa-kz-data/actions/workflows/ci-linux.yml)\n![Size](https://img.shields.io/github/repo-size/pypsa-meets-earth/pypsa-kz-data?label=Repo%20size)\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPLv3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\n[![REUSE status](https://api.reuse.software/badge/github.com/pypsa-meets-earth/pypsa-kz-data)](https://api.reuse.software/info/github.com/pypsa-meets-earth/pypsa-kz-data)\n\n# PyPSA-KZ-Data\n\n\u003cimg src=\"https://github.com/user-attachments/assets/cced2eb3-7d14-4f21-ae1a-2e0ca9174ea6\" alt=\"Kazakhstan Generation Capacities\"\u003e\n\nExtra data for the Kazakhstan model that will be used as input for PyPSA-Earth.\nRepo design oriented on: https://github.com/pypsa-meets-earth/pypsa-zm-data\n\n![image](https://user-images.githubusercontent.com/61968949/231397315-bc490876-abb6-45c4-bf01-e26f90c9db93.png)\n\n# Data\n\nContains openly available data for Kazakhstan\n\n## Demand data\n\nMonthly electricity demand data with monthly aggregation provided by Kazakhstan operator of the electric energy and power market\n\n`kz_demand_validation.csv`\n(`demand_valid_clean.R` contains for details on how data were extracted and a simple vizualization; needs to work any R terminal + installation of two libraries)\n\n# Model Execution\n\n## Setting up the general repositories\n\nThe provided workflow builds on [PyPSA-Earth](https://github.com/pypsa-meets-earth/pypsa-earth). Therefore, first, the PyPSA-Earth repository must be forked and the fork should then be cloned. A fork can be created by navigating to the [PyPSA-Earth](https://github.com/pypsa-meets-earth/pypsa-earth) website. By clicking on the fork-symbol in the upper right corner, a fork is created and linked to the specific user. While making a fork, unclick `Copy the main branch only` option to fork all branches and tags of `pypsa-earth` repository.\n\nNext, we also need to fork the [pypsa-kz-data](https://github.com/pypsa-meets-earth/pypsa-kz-data) repository. A fork can be created by navigating to the [pypsa-kz-data](https://github.com/pypsa-meets-earth/pypsa-kz-data) website and clicking the fork symbol in the upper right corner.\n\nIn order to clone both forks to the correct locations on a local machine, the following commands can be used using the local machines shell:\n```bash\ngit clone https://github.com/\u003cuser-name\u003e/pypsa-earth\n```\n`\u003cuser-name\u003e` must be replaced with the personal github-username.\n\nAfter that, one must change to the freshly created pypsa-earth repository.\n```bash\ncd pypsa-earth/\n```\nSwitch to the stable `v0.4.0` version of `pypsa-earth` that is compatible with `pypsa-kz-data` repository:\n```bash\ngit checkout tags/v0.4.0\n```\nRepeat the cloning, this time for the pypsa-kz-data repository.\n```bash\ngit clone https://github.com/\u003cuser-name\u003e/pypsa-kz-data\n```\nAgain, `\u003cuser-name\u003e` must be replaced with the personal github-username.\n\nIn order to install the pypsa-earth environment, instructions are provided in the pypsa-earth [documentation](https://pypsa-earth.readthedocs.io/en/latest/installation.html), see `Install dependencies` and `Python dependencies`.\nAfter installing the environment, activate it using\n```bash\nconda activate pypsa-earth\n```\n\n## Modeling adaptations for KZ study\n\nTo adapt the overall workflow for kz, only two further changes are necessary.\n\nFirstly, open the Snakefile (in `pypsa-earth/`) and navigate to line [1071-1072](https://github.com/pypsa-meets-earth/pypsa-earth/blob/main/Snakefile#L1057-L1058), which should read\n```bash\nos.system(\"snakemake -j all solve_all_networks --rerun-incomplete\")\nos.system(\"snakemake -j1 make_statistics --force\")\n```\nand replace these two lines with\n```bash\nos.system(f\"snakemake -j1 networks/{wildcards.scenario_name}/base.nc\")\nos.system(\"cp pypsa-kz-data/data/custom_powerplants.csv data/custom_powerplants.csv\")\nos.system(\"snakemake -j1 solve_everything --rerun-incomplete\")\n```\n\nSecondly, copy the default configuration file to the pypsa-earth folder using:\n```bash\ncp pypsa-kz-data/config.kz_default.yaml config.default.yaml\n```\nIn case you already have a custom config file, make sure to replace it as well, using\n```bash\ncp pypsa-kz-data/config.kz_default.yaml config.yaml\n```\n**Note!** Run two aforementioned commands in `pypsa-earth` directory.\nYou are now all set to run all scenarios!\n\n## Running KZ scenarios\n\nTo prepare running all scenarios, execute\n```bash\nsnakemake -j1 prepare_kz_scenarios\n```\nOptionally, to save time for future runs, you can now set `enable: retrieve_databundle: True` in the `config.yaml` to `False`. If you already have build all cutouts for 2011, 2013 and 2018, you can also set `enable: build_cutout: True` to `False`.\nFinally, to run all scenarios, execute\n```bash\nsnakemake -j1 run_all_scenarios\n```\n\nAfter all scenarios have executed successfully, all results are generated and locally saved in `pypsa-earth/results/\u003cscenario_folder\u003e/networks/`.\n\n# Potential errors\n- A rule is killed. In this case, open the `Snakefile` in `pypsa-earth` or open `kz.smk` in `pypsa-kz-data` (depending on the rule which is killed), navigate to the rule that is being killed in the workflow and increase the memory assignment (for example, add a 0 at the end).\n\n- The workflow runs into an error during the `build_powerplants` rule. In this case, try to repeat step 1. of the workflow using the command\n```bash\ncp pypsa-kz-data/data/custom_powerplants.csv data/custom_powerplants.csv\n```\n\n- Unusual error arising from either Snakemake or the `Snakefile` and proving to be challenging to comprehend: Inspect all indentation. Ensure there is no tab spacing; employ only spaces, i.e., ` `. It is probable that the indentations before\n```bash\nos.system(f\"snakemake -j1 networks/{wildcards.scenario_name}/base.nc\")\nos.system(\"cp pypsa-kz-data/data/custom_powerplants.csv data/custom_powerplants.csv\")\nos.system(\"snakemake -j1 solve_everything --rerun-incomplete\")\n```\nare tabs instead of four spaces.\n\n- Missing `data/` folder or some relevant subfolders. This should normally be executed automatically when executing the rule `prepare_kz_scenarios`, however might be missing due to incorrect execution. The databundle can be also retrieved manually via:\n```bash\nsnakemake -j 1 retrieve_databundle_light\n```\n\n- The rule `retrieve_databundle_light` always executes with an error. To avoid this, try setting `enable: build_cutout: False` to `True`.\n\n- Hydrobasins data might not be accessible in some regions (e.g. in Kazakhstan). It is recommended to retrieve the databundle using VPN. \n\n# Comes in handy\nAfter all cutouts were generated (i.e. the three files `asia-\u003cyear\u003e-era5.nc` exist in the folder `pypsa-earth/cutouts/`, where `\u003cyear\u003e` is 2011, 2013, and 2018, navigate to `pypsa-earth/pypsa-kz-data`, open the default config file, navigate to line 36, which should read `build_cutout: True`, and set it to `build_cutout: false`. This will save you a lot of time when (re-)runnig scenarios. But remember to set it back to `true` in case one of the cutouts was deleted!\n\n## Acknowledgement\nCode development and testing:\u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://openenergytransition.org/about-us.html#team\"\u003e\n        \u003cb\u003eOpen Energy Transition\u003c/b\u003e\n    \u003c/a\u003e\n\u003c/td\u003e\n\nModel assumptions: \u003ctd align=\"center\"\u003e\n    \u003ca href=\"https://www.agora-energiewende.de/en/\"\u003e\n        \u003cb\u003eAgora Energiewende\u003c/b\u003e\n    \u003c/a\u003e\n\u003c/td\u003e\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":["energy-system-model","energy-system","energy-system-planning","investment-optimization","operational-optimization","power-system-model","power-system-planning","pypsa-africa","pypsa-earth","scenario-analysis"],"project_url":"https://ost.ecosyste.ms/api/v1/projects/31851","html_url":"https://ost.ecosyste.ms/projects/31851"}