Commit Graph

872 Commits

Author SHA1 Message Date
Chiara Anselmetti
11c29ac6cc
Adding focus_weights to pre-clustering (#241)
* Add focus_weights to pre-clustering

Hey guys,
another quick fix since I noticed it wasn't implemented yet: When pre-clustering the network, the focus_weights have not yet been considered. This may distort clustering results when pre-clustering to a low resolution.

* Update release_notes.rst
2021-05-21 15:27:34 +02:00
martacki
f3f587e3f8 simplify to substations - initial draft 2021-05-21 13:54:38 +02:00
martacki
e2ed561938 merge master? 2021-05-19 10:04:44 +02:00
Chiara Anselmetti
cf55f00656
Delete capital costs at battery discharge link (#240)
Hey guys,
please correct me if I'm wrong, but I think pricing both the charge and discharge of the battery store component with the inverter's capital costs results in duplicating costs since a bi-directional inverter is considered (I checked the source of the cost assumption, Budischak 2013). 
Before working with PyPSA-EUR, I have worked with the toy model WHOBS where only the charging-link of the battery store component is priced with its capital costs (cf. https://github.com/PyPSA/WHOBS/blob/master/run_single_simulation.ipynb). The proposed change in code is equivalent.
2021-05-06 15:56:49 +02:00
Fabian Neumann
035bcf99df restore REUSE compliance [skip travis] 2021-04-28 09:25:27 +02:00
FabianHofmann
b8a7685931
Atlite availability (#224)
* adjust buil_cutout.py and Snakefile

* try adjusting build_renewable_profiles, currently crashing due to weird pyproj error

* build_renewable_profiles: -remove printing gid

* build_renewable_profiles: use dask for paralellization, use dense functions

* build_renewable_profiles:
	- revise imports
	- add logging for long calculation
	- revise explaining comment
	- revise distance calculation

* build profiles: adjust to cutout.grid

* * fix area to square km
* rename potmatrix -> capacity_potential
* rename available to availibility

* config.default update cutout params
build_renewable_potentials: major refactoring and simplification
hydro_profiles: update code

* build profiles: fix weight output dimensions

* build profiles: fix typo, fix selection of buses

* build profiles: reinsert paths variable

* follow up

* build profiles: move to dask calculation only

* CI: set build cutout to true (add CDSAPI)

* build profiles: use pyproj, test with gleas and geokit upstream

* environment.yaml fix atlite version

* build profiles: use dask 'processes' for more than 25 regions

* build profiles: specify dask scheduler according to number of regions

* backpedal a bit, only allow scheduler='processes'

* follow up, code style and fixup

* build profiles: add logger info for underwater fraction calc

* config adjust cutout parameters
Snakefile fixup

* config.default.yaml: adjust resolution

* config: use one cutout in total
build_cutout: automatic detetection of geographical boundaries

* env: add python>=3.8 requirement
build_cutout: fixup for region bound

* config: allow base cutout

* folllow up, fix up

* follow up II

* clean up

* clean up II

* build profiles: move back to multiprocessing due to performance issues

* small code style corrections

* move in pool context

* swqitch to ratsterio

* switch to rasterio for availibility calculation

* tiny fixup

* * build continental raster for offshore distance calculation
* adjust Snakefile to new script build_raster

* rename continental raster to onshore raster
add projected_mask function (not yet tested)
add docstrings, modularize

* Snakefile: remove build_onhore_raster rule, build mask directly from geometry instead
build_natura_raster: adjust code, add function for exporting
build_profiles:
	* add buffer to shore distance to init_globals function
	* update docstrings
	* improve handling of nodata grid codes
	* add geometry mask if natura raster not activated
	(the 255 value is an 'eligible' value for the corine data base,
	do this for excluding data outside the shape)

* build_profiles: adjust docstrings

* update environment

* build profiles: fixup reproject woth padding

* follow up, small fixups

* fix resampling method

checkpoint: reproduces solar profile in tut data

* reintegrate plot map
code style

* config: rename cutout into "base"

* build profiles: adjust to new atlite code

* natura raster: small fixup

* build natura raster: compress tiff file

* config: adjust cutout names

* build profiles: cover case if no or partial overlap between natura raster and cutout

* config-tutorial: adjust cutout params

* buid-profifiles: fixup in gebco filter

* follow up

* update config files

* build profiles: select layoutmatrix != 0

* build profiles: speed up average_distance and underwaterfraction

* build profiles: fix typo

* update release notes
build_cutout: only build needed features

* update envs

* config: add temperature to sarah features

* temporary fix for atlite v0.2.1 and new xarray version release

* env: remove xarray specification

* * remove rule build_country_flh
* build profiles: remove sneaked in line

* doc: update configuration.rst (section atlite) and corresponding csv table

* release notes: fix quotes

* build profiles: use 3035 for area calculation

* Update envs/environment.docs.yaml

* Update scripts/build_cutout.py

* Update doc/release_notes.rst

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>

* Update doc/configuration.rst

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/build_cutout.py

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>

* update release notes

* release notes: add deprecation of 'keep_all_available_areas'
build profiles: remove warning for 'keep_all_available_areas'

* build cutout: rearrage code, set buffer correctly

* Rename tutorial cutout to remove name clash with real cutout.

* Update release_notes.rst: Rename tutorial cutout.

* retrieve: update cutouts and downloads (alternative) (#237)

* retrieve: update cutouts and downloads

* retrieve: remove unnecessary import

* use snakemake remote file functionality

* Snakefile: update zenodo link

* update natura remote link (closes #234)

* env: update atlite version to 0.2.2

* env: fix dask version due to memory issues

* test: retrieve cutout instead of build

* test: use tutorial cutout for CI

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-04-27 17:58:31 +02:00
Fabian Neumann
c29d59b97f Merge branch 'pz-max-fix-marginal-costs' 2021-04-27 14:36:39 +02:00
Fabian Neumann
164c168a30 minor revisions on pz-max's PR 2021-04-27 14:36:34 +02:00
Fabian Neumann
e3863084cd Merge branch 'fix-marginal-costs' of https://github.com/pz-max/pypsa-eur into pz-max-fix-marginal-costs 2021-04-27 14:32:49 +02:00
Fabian Neumann
efdfad97a3
address FutureWarning re set operations on pd.Index (#238) 2021-04-27 07:51:46 +02:00
euronion
d3dc2e924a
Correct co2base in config.default.yaml . (#233)
* Correct co2base in config.default.yaml .

Based on PyPSA-EUR-SEC data.

* Update release_notes.rst

* Fix .rst .
2021-04-23 11:41:55 +02:00
Fabian Neumann
6765ffda8f fix electricity.csv 2021-04-06 13:27:21 +02:00
martacki
bd57548788 merge 2021-03-24 12:00:45 +01:00
Max Parzen
184b060903
syntax correction 2021-03-23 20:27:13 +00:00
Max Parzen
f9e73690e1
Update add_extra_components 2021-03-23 19:34:13 +00:00
Max Parzen
b4a992c4db
update config.yaml
adding to marginal costs:
- electroysis
- fuel cell
- battery inverter
2021-03-23 19:30:06 +00:00
Max Parzen
165148d26c
Update scripts/add_extra_components.py
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-03-23 19:22:39 +00:00
pz-max
2f9e9075e8 adding marginal cost for storage 2021-03-23 17:29:59 +00:00
Koen van Greevenbroek
9048af482f
Add a check to fix KeyError (#220) (#228)
In some cases, in networks with DC links, a non-existing column would
be referenced in an empty Dataframe. This commit adds a check for this
case.

Co-authored-by: Koen van Greevenbroek <koen@vesoldo.com>
2021-03-10 18:16:09 +01:00
eb5194
b9fdacad4d simplify: delete columns with incorrect/accurate entries 2021-01-20 20:39:22 +01:00
eb5194
ea8e643dc4 add_electricity.py Resolve FutureWarning 771 Index.__or__ operating as set operation is deprecated 2021-01-19 15:20:58 +01:00
Fabian Neumann
df2425d4a0
Update README.md 2021-01-14 21:22:34 +01:00
lukasnacken
4e44822514
Add openpyxl to environment.yaml to fix #215 (#216) 2021-01-13 17:24:42 +01:00
Chiara Anselmetti
ed4fdc9150
Keep links to store components when using ATK wildcard (#214)
* Update prepare_network.py

The new ATK wildcard removes all lines + links without further distinction; however, since storage options are now modeled as store components, the links to and from the the storage units for (dis)charge are eliminated as well. Thus, the storage options drop out of the optimisation. 
Especially when only allowing renewables as generation sources, optimisation may become infeasible for a high temporal resolution (capacity factors = 0 for certain hours; no further options to serve the load). 
This issue does not arise with the ATKc wildcard, since bus0 and bus1 of the (dis)charge links share the same country code.

The proposed change is a very quick fix in the enforce_autarky function, solely removing DC links.

* Update scripts/prepare_network.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

* Update prepare_network.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-01-11 10:27:27 +01:00
Fabian Neumann
8f2ace03ee doc: fix electricity.csv format [skip travis] 2020-12-15 15:17:37 +01:00
Fabian Neumann
9966c751bd envs: restore REUSE compliance [skip travis] 2020-12-07 09:45:14 +01:00
Fabian Neumann
5a917dc5a9 doc: change zenodo links to latest [skip travis] 2020-12-07 09:43:17 +01:00
Fabian Neumann
08674a6cda
Release v0.3 (#213)
* release_notes: order for release

* doc: fix smaller typos and tidy up

* config: bump version

* doc: fix line references

* doc: bump confpy version

* envs: update fixed versions yaml

* Snakefile: simplify all_elec to all
2020-12-05 17:54:50 +01:00
Fabian Neumann
3ad6340c13 travis: correctly constrain version 2020-12-04 18:53:12 +01:00
Fabian Neumann
1baa309252 travis: ipopt 3.13.3 does not provide windows executables
https://github.com/conda-forge/ipopt-feedstock/issues/55
2020-12-04 18:44:34 +01:00
Fabian
f563b612e4 doc/configuration.rst: update lines 2020-12-03 23:47:38 +01:00
FabianHofmann
3fa5bbad1c
Opsd renewable ppls (#212)
* fix clustering of offwind-ac and offwind-dc in sites option

* add release nodes

* attach renewable assets by location (lat and lon) from OPSD register to network

* adapt default config to changes

* undo changes from a differen PR in cluster_network.py

* undo changes from a different PR, add release notes for this PR

* correct release notes

* add comments for relevant settings in add_electricity.py

* adjust configtable for electricity to OPSD renewable option and add estimate_renewable_capacities_from_capacitiy_stats

* reset cluster_network to HEAD

* add_electricity: Capacity is float

* config: add GB to OPSD_VRE_countries

* review and modify implementation

* update release notes

* Update envs/environment.yaml

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

Co-authored-by: martha.frysztacki <eb5194@iai-esm003.iai.kit.edu>
Co-authored-by: eb5194 <martha.frysztacki@kit.edu>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2020-12-03 23:13:41 +01:00
Fabian Neumann
2fc1ea0255
some refactoring and code cleaning (#190)
* some refactoring and code cleaning

* execute pre-commit

* pre-commit: limit large files

* add license to .pre-commit

* add pre-commit to env

* solve: tidy memory logger

* travis: add conda list for easier debugging

* undo config test/tutorial without plotting, rm matplotlibrc, .licenses

* remove {networks} wildcard

* unadd pre-commit config

* add release notes

* restore REUSE compliance

* fix docs environment python version

* env: remove gurobi from dependencies

* fix unclean merge block

* fix elif to if

* lighter rtd style

* lighter rtd style II
2020-12-03 19:50:53 +01:00
Fabian Neumann
84edde8f63
add time series segmentation with tsam package (#186)
* add time segmentation with tsam

* cut off SEG

* Snakefile: adjust memory function

* untangle memory reservation calculation

* prepare: document segmentation option

* correct typo
2020-12-03 16:02:21 +01:00
Martha Maria
cfb979a0d0
Custom busmap for clustering (#193)
* add option to use custom clustermaps from data folder

* adapt default config to custom busmap

* input file from Snakefile

* adapt input description

* add option to use custom clustermaps from data folder

* adapt default config to custom busmap

* input file from Snakefile

* adapt input description

* Snakefile: custom_busmap in cluster_network input is now csv

* cluster_network: custom_busmap is now read as csv file, adaptions of description

* simplify_network: adapt descriptions

* configfiles: add cutom_clustermaps switch

* unify clustarmap and busmap names

* unify clustermap and busmap names

* test/config: unify clustermap and busmap names

* cluster_network: make clustering_for_n_clusters compatible with simplify_network

* simplify_network: make compatible with changes in cluster_network.py

* Update scripts/cluster_network.py

* Update scripts/simplify_network.py

* Update scripts/simplify_network.py

* Update scripts/cluster_network.py

* Update scripts/cluster_network.py

* cluster_network: move custom_busmap flag to enable; simplify names

* cluster_network: move custom_busmap flag to enable; simplify names

* custom_busmap: add documentation

* cluster_network: add default for custom_busmap for compatibility with old configs

* cluster_network: add default for custom_busmap for compatibility with old configs

Co-authored-by: martha.frysztacki <eb5194@iai-esm003.iai.kit.edu>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2020-12-03 15:17:16 +01:00
FabianHofmann
9792069ab3
Update load processing (#211)
* build_load_data

* Add documentation

* updating load data import

* Update Config files

* Update load.csv

* Update add_electricity.py

* change log file name

* Update scripts/add_electricity.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* Update scripts/build_load_data.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* Update scripts/build_load_data.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* Update scripts/build_load_data.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* Update build_load_data.py

* Update build_load_data.py

* Update scripts/build_load_data.py

Co-authored-by: FabianHofmann <hofmann@fias.uni-frankfurt.de>

* update gap handling in build_load_data

* Update build_load_data.py

* Update config.test1.yaml

* update test.config

* Update config.tutorial.yaml

* update load csv function for load data

* Update build_load_data.py

* Update config.test1.yaml

* Update add_electricity.py

* Update build_load_data.py

* Added error messages if load data contains gaps after modifications

* general adjustments:
	- reduce data source to only entsoe statistics
	- sanitize code
	- adjust logging messages
	- adjust daocstrings

* update Snakefile config and docs

* update release notes
rename build_load -> build_load_data in config

* small follow up

* - reintroduce choice between powerstatistics and transparency
- remove load_ timeseries from databundle
- always build load_data
- reinsert scaling factor in config
- fix url to 2019 version

* update doc: configtable, release notes
update config.yaml

* follow up

Co-authored-by: Jan Frederick <jan.frederick.unnewehr@inatech.uni-freiburg.de>
Co-authored-by: JanFrederickUnnewehr <50404069+JanFrederickUnnewehr@users.noreply.github.com>
2020-12-03 12:49:04 +01:00
Fabian Neumann
f18b7b02cb
StorageUnit correct efficiency_dispatch/store (counter-proposal 2) (#202)
* fix efficiencies of storage units counter proposal

* extra_components: fix roundtrip efficiency

* add_electricity: remove misleading roundtrip efficiency for storageunit

* add release notes
2020-12-03 10:02:23 +01:00
Fabian Neumann
c1447875d5
no defaults channel in environment.yaml (#144)
* no defaults channel in environment.yaml

* GIS from conda-forge

* remove channel pinning and add descartes via conda

* remove geopandas version restriction

* travis: remove duplicated conda list
2020-12-02 17:48:47 +01:00
Fabian Neumann
03170f4aaf
add option for p_nom_max factors in {opts} wildcard (#207)
* prepare: add option for potential reduction sweeps

* prepare: fix attr lookup for potential/cost reduction sweeps

* prepare: fix attr naming cost -> capital_cost

* add release notes
2020-11-26 17:25:14 +01:00
Fabian Neumann
bfbf595ad8
Parameter corrections for East-Western and Anglo-Scottish interconnection (#206)
* data: parameter corrections for East-Western and Anglo-Scottish interconnector

* add release notes
2020-11-26 17:20:48 +01:00
Fabian Neumann
de0478968c
config: make storage modelling with Store and Link default (#205) 2020-11-25 13:18:30 +01:00
Fabian Neumann
5240b090d9 Merge branch 'master' of github.com:PyPSA/pypsa-eur 2020-11-17 12:47:00 +01:00
Fabian Neumann
3b858384d3 data: ALEGrO in operation 2020-11-17 12:46:49 +01:00
Fabian Neumann
2e70e8d15b
prepare: fix transmission limit when no HVDC links in network (#209) 2020-11-12 17:37:43 +01:00
Fabian Neumann
9c526687fd environment: remove snakemake-minimal version constraint 2020-11-12 16:27:52 +01:00
Fabian Neumann
984e688615 skip cost aggregation of component if empty 2020-10-28 15:30:36 +01:00
Martha Maria
52683236cd
prepare_network: fix nmo security margin (#199)
* prepare_network: fix nmo security margin

* Update doc/release_notes.rst

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

* Update scripts/prepare_network.py

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2020-10-02 15:55:22 +02:00
Martha Maria
2e76b88ec8
simplify_ and cluster_network: clustermaps to csv (#198)
* simplify and clustering: output and input from HDF format to CSV

* add release notes

* simplify and clustering: output files from Snakefile
2020-10-02 12:53:56 +02:00
Fabian Neumann
4d0a860246 Merge branch 'master' of github.com:PyPSA/pypsa-eur 2020-09-26 13:16:19 +02:00
Fabian Neumann
88f1184315 travis: only build master and PRs onto master 2020-09-26 13:16:00 +02:00