{"id":20612625,"url":"https://github.com/pypsa/condynet-2-wp-1","last_synced_at":"2025-07-14T00:35:14.120Z","repository":{"id":146649452,"uuid":"349209132","full_name":"PyPSA/condynet-2-wp-1","owner":"PyPSA","description":"Code for topology-based approximations for N-1 contingency constraints","archived":false,"fork":false,"pushed_at":"2021-06-18T09:23:13.000Z","size":260,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-17T03:44:39.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","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":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-03-18T20:31:06.000Z","updated_at":"2021-11-17T06:56:29.000Z","dependencies_parsed_at":"2023-04-25T06:02:40.708Z","dependency_job_id":null,"html_url":"https://github.com/PyPSA/condynet-2-wp-1","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"dcff9af53ef37c8a396aa8aeb4f378db917346a8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fcondynet-2-wp-1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fcondynet-2-wp-1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fcondynet-2-wp-1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PyPSA%2Fcondynet-2-wp-1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PyPSA","download_url":"https://codeload.github.com/PyPSA/condynet-2-wp-1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242260383,"owners_count":20098552,"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:57.061Z","updated_at":"2025-03-06T18:22:35.127Z","avatar_url":"https://github.com/PyPSA.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Workflow Overview\n\n\n# Find buffer capacity factors\n\nIn this repository, we find buffer capacity factor based on our proposed approximate approach `c_a` (cf. rule `compute_approximate_c`),\nrobust approach for each subset `c_r` (cf. rule `compute_robust_c`) for each subset and whole of the network,\nand line-specific approach `c_l` (cf. rule `compute_linespecific_c`) for the all transmission lines.\n\n# Heuristic Security-Constrained LOPF\n\nThis repository is useful to test the operational costs of\na network with different buffer capacity (contingency) factors (cf. rule `solve_heuristic_contingency`) versus the\nfully security-constrained case (cf. rule `solve_full_contingency`), as well as how\nsecure the heuristic systems for specific outages (cf. rule `check_outage_flow`).\n\n## Workflow Structure\n\n![workflow](workflow.png)\n\nDocumentation inside `scripts/*.py`.\n\n## Configuration Options\n\nThe configuration is set in `config.yaml`.\n\n- `network:` specifies the path to the already solved PyPSA-Eur network. Ideal would be a 50-node German network with investments optimized for 90% CO2 redunction, which has lots of flow, but also some conventional generators to set high marginal prices.\n- `load_shedding:` adds load shedding generators to the network if not already existing to guarantee feasibility.\n- `rolling_horizon:` runs full security-constraint LOPF in batches of snapshots rather than all at once.\n- `group_size:` specifies the number of snapshots that form a batch.\n- `s_max_pu:` specifies which heuristic contingency factors you want to sweep through.\n- `solver:` includes the solver options and parameters.\n \n## Executing on Cluster\n\nMount the LSDF, do `kubectl-login`, go to project directory and execute:\n\n```\nkubedo --inception -i pypsa-eur-gurobi -- snakemake -j 99 all\n```\n\n## Caveats\n\nMake sure you do not have any lines with `num_parallel=0` and infinite reactance `x=np.inf`.\n\nMake sure you do not have sub networks with a single bus.\n\n## Analysis\n\nYou can get the operational costs of a network with different buffer capacity factor with `notebooks/operation_cost.py`.\n\n\nYou can check out the line loadings at the different outages with\n\n```py\nimport pandas as pd\n\npd.read_csv(\"results/new/outage_line_loading_heur....csv\", index_col=[0,1,2], parse_dates=True)\n```\n\nThis file has multiple index levels: the first is the snapshot, the second the component type, the third the line index. The columns denote the outage of the line. The column `base` shows the flows under no outage conditions. You can compare this data to the line capacities in `n.lines.s_nom` to find any overloadings.\n\nYou can find total cases and snapshots where the transmission network is overloaded in at least one line for different buffer capacity factors with `notebooks/check_outages.py`.\n\n\n## Plot\n\nAll results has been plotted with `notebooks/plot.ipynb`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fcondynet-2-wp-1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpypsa%2Fcondynet-2-wp-1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpypsa%2Fcondynet-2-wp-1/lists"}