Commit Graph

141 Commits

Author SHA1 Message Date
Fabian Neumann
013b705ee4
Clustering: build renewable profiles and add all assets after clustering (#1201)
* Cluster first: build renewable profiles and add all assets after clustering

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* correction: pass landfall_lengths through functions

* assign landfall_lenghts correctly

* remove parameter add_land_use_constraint

* fix network_dict

* calculate distance to shoreline, remove underwater_fraction

* adjust simplification parameter to exclude Crete from offshore wind connections

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* remove unused geth2015 hydro capacities

* removing remaining traces of {simpl} wildcard

* add release notes and update workflow graphics

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: lisazeyen <lisa.zeyen@web.de>
2024-09-13 15:37:01 +02:00
Fabian Neumann
bbff4297f9
temporarily disable n.shapes until memory issues resolved (#1238) 2024-08-26 15:16:06 +00:00
Fabian Neumann
b44f544d77 simplify_network: do not use mode for linetype inferral 2024-08-26 13:56:10 +02:00
Bobby Xiong
0c36de9bf8
Introducing OpenStreetMap high-voltage grid to PyPSA-Eur (#1079)
* Implemented  which uses the overpass API to download power features for individual countries.

* Extended  rule by input.

* Bug fixes and improvements to clean_osm_data.py. Added  in retrieve_osm_data.py.

* Updated clean_osm_data and retrieve_osm_data to create clean substations.

* Finished clean_osm_data function.

* Added check whether line is a circle. If so, drop it.

* Extended build_electricity.smk by build_osm_network.py

* Added build_osm_network

* Working osm-network-fast

* Bug fixes.

* Finalised and cleaned  including docstrings.

* Added try catch to retrieve_osm_data. Allows for parallelisation of downloads.

* Updated cleaning process.

* Set maximum number of threads for retrieving to 4, wrt. fair usage policy and potential request errors.

* Intermediate update on clean_osm_data.py. Added docstrings.

* Bug fix.

* Bug fix.

* Bug fixes in data types out of clean_osm_data

* Significant improvements to retrieve_osm_data, clean_osm_data. Cleaned code. Speed improvements

* Cleaned config.

* Fixes.

* Bug fixes.

* Updated default config

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Removed overpass from required packages. Not needed anymore.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added links_relations (route = power, frequency = 0) to retrieval. This will change how HVDC links are extracted in the near future.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Work-in-progress clean_osm_data

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added clean links output to clean_osm_data. Script uses OSM relations to retrieve clean HVDC links.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* New code for integrating HVDC links. Using relations. Base network implementation functioning.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed manual line dropping.

* Updated clean script

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* reverted Snakefile to default: sync settings

* added prebuilt functionality.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated build_electricity.smk to work with scenario management.

* removed commented-out code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* removed commented-out code.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fixed bug in pdf export by substituting pdf export with svg.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bug-fix Snakefile

* dropped not needed columns from build_osm_network.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated build_shapes, config.default and clean_osm_data.

* pre-commit changes.

* test

* Added initial prepare_osm_network_release.py script

* Finalised prepare_osm_network_release script to build clean and stable OSM base_network input files.

* Added new rules/development.smk

* Updated clean_osm_data to add substation_centroid to linestrings

* Updated clean_osm_data to add substation_centroid to linestrings

* Updated clean_osm_data to add substation_centroid to linestrings

* Updated clean_osm_data to add substation_centroid to linestrings

* Added osm-prebuilt functionality and zenodo sandbox repository.

* Updated clean_osm_data to geopandas v.1.01

* Made base_network and build_osm_network function more robust for empty links.

* Made base_network and build_osm_network function more robust for empty links.

* Bug fix in base_network. Voltage level null is now kept (relevant e.g. for Corsica)

* Merge with hcanges in upstream PR 1146. Fixing UA and MD.

* Updated Zenodo and fixed prepare_osm_network_release

* Updated osm network release.

* Updated prepare osm network release.

* Updated MD, UA scripts.

* Cleaned determine_availability_matrix_MD_UA.py, removed redundant code

* Bug fixes.

* Bug fixes for UA MD scripts.

* Rename of build script.

* Bug fix: only distribute load to buses with substation.

* Updated zenodo sandbox repository.

* Updated config.default

* Cleaned config.default.yaml: Related settings grouped together and redundant voltage settings aggregated.

* Cleaned config.default.yaml: Related settings grouped together and redundant voltage settings aggregated. Added release notes.

* Updated Zenodo repositories for OSM-prebuilt to offcial publication.

* Updated configtables

* Updated links.csv: Under_construction lines to in commission.

* Updated link 8394 and parameter_corrections: Continuation of North-Sea-Link.

* Major update: fix simplify_network, fix Corsica, updated build_osm_network to include lines overpassing nodes.

* remove config backup

* Bug fix: Carrier type of all supernodes corrected to 'AC'

* Bug fix: Carrier type of all supernodes corrected to 'AC'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Updated rules and base_network for compatibility with TYNDP projects.

* Updated Zenodo repository and prebuilt network to include 150 kV HVDC connections.

* Removed outdated config backup.

* Implemented all comments from PR #1079. Cleaned up OSM implementation.

* Bug fix: Added all voltages, 200 kV-750 kV, to default config.

* Cleaning and bugfixes.

* Updated Zenodo repository to https://zenodo.org/records/13358976. Added converter voltages, 'underground' property for DC lines/cables, and included Konti-Skan HVDC (DK-SE). Added compatibility with https://github.com/PyPSA/pypsa-eur/pull/1079 and https://github.com/PyPSA/pypsa-eur/pull/1085

* Apply suggestions from code review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* simplify_network: handle complicated transformer topologies

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* syntax fix

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2024-08-22 15:01:20 +02:00
Philipp Glaum
8480d62d33
fix bug in simplyfy network (#1222) 2024-08-16 13:16:52 +02:00
Bobby Xiong
55cca6a0f9
Bug fix: Carrier type of added supernodes in simplify_network need to be set to "AC" (#1221)
* Fixed simplify_network.py to handle more complex topologies, i.e. if two links are connected to nearby AC buses separated by an AC line.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added fix for Corsica node: If region containing Corsica is modelled, include substation on Corsica as supernode (end point).

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bug fix: Carrier type of all supernodes corrected to 'AC'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bug fix: Carrier type of all supernodes corrected to 'AC'

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Bug fix: Carrier type of all supernodes corrected to 'AC'

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-15 19:45:49 +02:00
Philipp Glaum
a9f67b313f
handle new and upgraded TYNDP&NEP lines/links in base network (OSM compatible) (#1085)
* add general implementation to add tyndp and nep. TODO: Remove duplicate?

* pre_osm_merge

* clean and update base_network.py
update default config settings

* clean and update base_network.py
update default config settings

* base_network.py:remove adding of transmission projects
add_transmission_project.py: add new script for creating lines and link csv from transmission projects
add_electricity.py: add new projects from created csv files

* cluster_network.py: do not allow to group lines with different build years together-> requires pypsa update
simplify_network.py: fix bug of simplify links

* remove legacies of removing transmission projects from base_network

* restructure folders:new folder for tranmission project csv
add_transmission_projects: improve logging, cleanup

* update lines csvs and add default line type for upgraded and new lines

* remove duplicate lines which were already in gridkit

* allow to connect ac lines only to ac buses

* add manual links csv (adjusted links_tyndp.csv) and update default config

* add realease note

* remove links_tyndp.csv file, references in build_elec.smk and function in base_network.py to add them

* add configuration options for transmission projects to documentation and add template folder for transmission projects

* update pypsa version in environments

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* integrate Fabian's review comments 2

* add electricity:add import pathlib and duplicate printing out of adding line projects

* update NEP line csv

* address Fabian's comments

* build_transmission_projects: address Fabian's final comments
simplify_network: use modus to get line type which appears most often

* build_transmission_project: change from .geometry to ["geometry"]

* build_transmission_projects: remove redundanty line

* build_transmission_projects: remove buffer for europe shape because of higher resolution
default config: fix wrong key for skip argument in transmission_projects

* update configtables and default config

* update manual links csv and delete undetected duplicate links in tyndp2020

* final adjustments

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2024-08-15 11:42:21 +02:00
Bobby Xiong
1cf85b0be8
Fix for Corsica in simplify_network: Include local substation (#1215)
* Fixed simplify_network.py to handle more complex topologies, i.e. if two links are connected to nearby AC buses separated by an AC line.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added fix for Corsica node: If region containing Corsica is modelled, include substation on Corsica as supernode (end point).

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-14 14:22:03 +02:00
Bobby Xiong
3ef6d519d7
Fix simplify_network.py to handle more complex topologies (#1211)
* Fixed simplify_network.py to handle more complex topologies, i.e. if two links are connected to nearby AC buses separated by an AC line.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-08-14 10:24:38 +02:00
Koen van Greevenbroek
76c201ef7d Integrate build_bus_regions into base_network
Fixes a problem with the `build_bus_regions` writing to base.nc
without declaring base.nc as an output.
2024-05-03 14:53:18 +02:00
Fabian Neumann
95805a8d72
Merge pull request #1031 from PyPSA/remove_connection_costs
Remove connection costs output
2024-04-18 09:34:32 +02:00
martacki
feb564506a remove connection_costs as snakemake output from simplify_network 2024-04-16 15:41:01 +02:00
Fabian
f1b33992f7 move append_bus_shapes to build_bus_regions, apply it where possible 2024-04-11 13:27:52 +02:00
Fabian
590d363579 clustering: add docstring to cluster_regions function, fix network reference 2024-04-11 12:13:07 +02:00
Fabian
47134a88d8 regions to n.shapes: smooth out remaining issues 2024-04-10 18:35:50 +02:00
Thomas Gilon
7e99f3bba7 Fix error with symbol of buses in simplify_network 2024-03-22 10:06:48 +01:00
Fabian Neumann
719d4dad23 Merge branch 'master' into scenario-management 2024-02-20 12:08:54 +01:00
Fabian Neumann
16e2286188 update copyright years to 2024 2024-02-19 16:21:48 +01:00
Fabian Neumann
d2a66879de Merge branch 'master' into scenario-management 2024-02-17 17:04:36 +01:00
Fabian Neumann
6de08bd523 Merge branch 'master' into scenario-management 2024-02-10 17:22:01 +01:00
Fabian Neumann
4b6199de42 create a bus for every unique coordinate, not only substations (closes #699) 2024-02-09 15:43:27 +01:00
pre-commit-ci[bot]
d2f2d4ab0b [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-01-29 18:31:05 +00:00
Fabian
f876d78ed4 fix linting: run ruff 2024-01-19 12:17:45 +01:00
Fabian
cc08dff280 simplify_network: revert fillna 2023-12-18 12:44:21 +01:00
martacki
ea42b3797d simplify_network&pandas21: nans not supported 2023-12-18 11:43:04 +01:00
pre-commit-ci[bot]
ea3fdb6c15 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-12-18 08:58:15 +00:00
Fabian Neumann
c304738ea5 fix to restore compatibility with PyPSA v0.26.0 2023-12-12 18:18:03 +01:00
Sourcery AI
3c36c60bdd 'Refactored by Sourcery' 2023-10-08 09:20:36 +00:00
Fabian
e28ae59375 introduce scenario-management 2023-08-15 15:06:59 +02:00
Fabian Hofmann
4a8af57a59
simplify network: remove 'underground' column to avoid consense error 2023-08-03 18:19:20 +02:00
Fabian
d22c87419b update enviromnent yaml to install pypsa from master
cluster: allow custom strategies for all components
2023-07-17 14:03:16 +02:00
Fabian
8e568cee03 cluster network: remove bus strategies as already handled internally 2023-07-14 16:00:21 +02:00
Fabian
f566142d38 cluster network: update to new clustering module (pypsa v0.25) 2023-07-14 15:47:41 +02:00
Fabian
2f3005e555 use pypsa.clustering.spatial namespace 2023-06-29 15:37:29 +02:00
Fabian
45cac01ea3 adjust param accessing in cluster, simplify and build_elec script 2023-06-14 14:39:53 +02:00
virio-andreyana
e581ca930c made params more specific 2023-05-27 15:50:37 +02:00
pre-commit-ci[bot]
216a02fba1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-05-19 13:42:45 +00:00
virio-andreyana
c043100ada
add more params in simplify_network.py 2023-05-19 15:42:07 +02:00
virio-andreyana
1fc48d8753
using python algorithm to edit rules and script 2023-05-15 10:33:17 +02:00
Fabian
1f6f7a2039 replace config.yaml by config/config.yaml in doc and docstrings 2023-04-21 10:41:44 +02:00
pre-commit-ci[bot]
460bbd080f [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-04-10 22:02:35 +00:00
Fabian Neumann
91ea0a3f55 docs: rearrange sections 2023-03-09 13:28:42 +01:00
Fabian Neumann
9c1182fe96 prepare release 0.7 2023-02-16 11:50:55 +01:00
pre-commit-ci[bot]
e6ecbc95d7 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-02-06 22:28:32 +00:00
pre-commit-ci[bot]
8bdba5653a [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2023-01-23 21:27:20 +00:00
Fabian Neumann
5360eb0a2e Merge branch 'master' of https://github.com/pypsa/pypsa-eur 2022-12-28 09:35:15 +01:00
Fabian Neumann
bb5c5bd143 simplify_networks: add control for removing stubs II 2022-12-28 09:34:28 +01:00
Fabian Neumann
e9f3d20432 simplify_networks: add control for removing stubs 2022-12-28 09:33:08 +01:00
Fabian Neumann
bb1b37e8ef address pandas iteritems deprecation 2022-12-27 13:16:05 +01:00
pre-commit-ci[bot]
85d01bceb0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2022-09-19 14:34:48 +00:00