Commit Graph

101 Commits

Author SHA1 Message Date
Fabian Neumann
35f8b54a46 switch to Belgium for CI and tutorial 2022-03-24 15:51:36 +01:00
euronion
e2e98120b1 Update Snakefile 2022-03-21 10:01:34 +01:00
euronion
30cb861ca2 Update Snakefile 2022-03-21 09:37:50 +01:00
euronion
da72f5487d Update Snakefile 2022-03-18 14:29:50 +01:00
euronion
65e35135e1 Update Snakefile 2022-03-18 11:13:58 +01:00
Fabian
49ec143b0a Snakefile: fix memory function for clusters == 'all' 2022-03-02 14:22:16 +01:00
Fabian Neumann
3eec027db6
no more 'mv' command in Snakefile for Windows (#316) 2022-02-22 19:34:47 +01:00
Fabian Neumann
090b4908a4 Snakefile: use standard resource mem_mb rather than mem 2022-01-27 21:04:50 +01:00
Fabian Neumann
e1aae5a98e minor adjustment to memory requirements of add_electricity, cluster_network 2022-01-13 15:36:13 +01:00
Fabian Neumann
c0d1656091 build_load_data: separate retrieving and processing load data 2021-11-10 10:37:09 +01:00
Fabian Neumann
8996e09dc2
Merge branch 'master' into mit-license 2021-09-20 09:28:32 +02:00
Koen van Greevenbroek
6485b98973 Mark datasets from Zenodo as static
When retrieving a remote file over HTTP, Snakemake uses the
"last-modified" property in HTTP header as a proxy for `mtime` of the
remote file. If this time is more recent than the `mtime` of the
output of the retrieve rule, the rule is triggered and the remote file
is retrieved again (since it was apparently updated).

However, Zenodo periodically updates the "last-modified" property of
records retrieved over HTTP even if those records have not been
updated. This causes Snakemake to false assume that the records have
to downloaded again.

By setting `static=True` for datasets we know don't actually change,
we avoid this problem.
2021-09-15 11:44:49 +02:00
Fabian Neumann
2e02af8b4b change license 2021-09-14 16:37:41 +02:00
martacki
400317d062 update plot_network and make_summary scripts to latest pypsa/-eur versions 2021-08-16 17:53:56 +02:00
huckebrink
2aa59a3905
exporting additional costs, and compatibility adjustments (#261)
* added export for connection_cost adjustment

* removed lambda function from multiprocessing
changed true/false_values to lists

* removed double import of functools

* moved added costs to df column

* Update scripts/simplify_network.py

Co-authored-by: Leonie Plaga <leonie.plaga@ruhr-uni-bochum.de>
Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2021-08-04 16:19:23 +00: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
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
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
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
5ea29551b9
add REUSE.software license information (#160)
* add REUSE.software license information

* add release note on licensing

* Update doc/index.rst

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

* Update doc/index.rst

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

* Update doc/release_notes.rst [skip travis]

Co-authored-by: euronion <42553970+euronion@users.noreply.github.com>
2020-05-29 09:50:55 +02:00
euronion
2f85b0ede5
Separate retrieval and building of cutouts, natura raster into distinct configurations each. (#136)
* Separate config switches for retrieving and building cutout, natura raster.

* Include new switches in tutorial and test configs.

* Update release_notes.rst

* Update toplevel.csv

* Update tutorial.rst

* Update configuration.rst
2020-03-16 15:51:47 +01:00
FabianHofmann
1ecca802f3 Nomopyomo (#116)
* play around, add new nomopyomo feature

* fix constraints

* fix constraints

* set solver to cbc due to error with gurobi900

* update environments
shift lv and lc constraints to prepare_network
start modifying opt constraints

* correct BAU

* correct environment

* fix import

* fix SAFE constraint

* fix battery charger ratio constraint

* code cleaning

* restructure solve scripts

* fix CCL constraint

* adjust doc

* solve_network: update doc string

* revert unwanted changes

* update environment.yaml

* update environment.yaml II

* force conda update, revert last commit

* revert last change, use other channel priority

* remove trace_sove_network

* add skip_iterating and track_iterations options to config file

* revert last commit, fix environment to current pypsa master

* line break, trigger CI with updated pypsa

* nomopyomo: PR review

Co-authored-by: Fabian Neumann <fabian.neumann@outlook.de>
2020-02-10 12:06:43 +01:00
Fabian
7c14b16777 solve_operations_network: fix snakemake input for unprepared network 2020-01-23 18:47:18 +01:00
Fabian Neumann
5934f4f7a1
prepare release v0.1.0 (#117) 2020-01-09 14:09:28 +01:00
FabianHofmann
eaf30a9b65
Introduce mocksnakemake which acutally parses Snakefile (#107)
* rewrite mocksnakemake for parsing real Snakefile

* continue add function to scripts

* going through all scripts, setting new mocksnakemake

* fix plotting scripts

* fix build_country_flh

* fix build_country_flh II

* adjust config files

* fix make_summary for tutorial network

* create dir also for output

* incorporate suggestions

* consistent import of mocksnakemake

* consistent import of mocksnakemake II

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/plot_network.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/plot_network.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* Update scripts/retrieve_databundle.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* use pathlib for mocksnakemake

* rename mocksnakemake into mock_snakemake

* revert change in data

* Update scripts/_helpers.py

Co-Authored-By: euronion <42553970+euronion@users.noreply.github.com>

* remove setting logfile in mock_snakemake, use Path in configure_logging

* fix fallback path and base_dir
fix return type of make_io_accessable

* reformulate mock_snakemake

* incorporate suggestion, fix typos

* mock_snakemake: apply absolute paths again, add assertion error
*.py: make hard coded io path accessable for mock_snakemake

* retrieve_natura_raster: use snakemake.output for fn_out

* include suggestion

* Apply suggestions from code review

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* linting, add return ad end of file

* Update scripts/plot_p_nom_max.py

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* Update scripts/plot_p_nom_max.py

fixes #112

Co-Authored-By: Jonas Hörsch <jonas.hoersch@posteo.de>

* plot_p_nom_max: small correction

* config.tutorial.yaml fix snapshots end

* use techs instead of technology

* revert try out from previous commit, complete replacing

* change clusters -> clusts in plot_p_nom_max due to wildcard constraints of clusters

* change clusters -> clusts in plot_p_nom_max due to wildcard constraints of clusters II
2019-12-09 21:29:15 +01:00
Fabian Neumann
f5175713af Snakefile: load default config if config.yaml does not exist 2019-11-28 16:33:33 +01:00
euronion
85c356297a Add logging to logfiles to all snakemake workflow scripts. (#102)
* Add logging to logfiles to all snakemake workflow scripts.

* Fix missing quotation marks in Snakefile.

* Apply suggestions from code review

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* Apply suggestions from code review

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* doc: fix _ec_ filenames in docs

* Allow logging message format to be specified in config.yaml.

* Add logging for Snakemake rule 'retrieve_databundle '.

* Add limited logging to STDERR only for retrieve_*.py scripts.

* Import progressbar module only on demand.

* Fix logging to file and enable concurrent printing to STDERR for most scripts.

* Add new 'logging_format' option to Travis CI test config.yaml.

* Add missing parenthesis (bug fix) and cross-os compatible paths.

* Fix typos in messages.

* Use correct log files for logging (bug fix).

* doc: fix line references

* config: logging_format in all configs

* doc: add doc for logging_format

* environment: update to powerplantmatching 0.4.3

* doc: update line references for tutorial.rst

* Change logging configuration scheme for config.yaml.

* Add helper function for doing basic logging configuration.

* Add logpath for prepare_links_p_nom rule.

* Outsource basic logging configuration for all scripts to _helper submodule.

* Update documentation for changed config.yaml structure.

Instead of 'logging_level' and 'logging_format', now 'logging' with subcategories is used.

* _helpers: Change configure_logging signature.
2019-11-28 08:22:52 +01:00
Fabian Neumann
efb5f064b7 Snakefile: use normpath for solver logs
* mailing list: pypsa-eur_questions related: generated data and solver conf issues, 2019/11/19, 19:13
2019-11-22 15:13:46 +01:00
Fabian Neumann
81d9d2ab4d
battery+H2: option for stores and links instead of storage_units (#97)
* add_electricity: stores and links instead of storageunits

* move code for attaching in add_extra_stores.py

* Update Snakefile

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* Update Snakefile

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* Update Snakefile

Co-Authored-By: Fabian Neumann <fabian.neumann@outlook.de>

* rename to add_extra_components.py

* incorporate suggestions

* Snakefile: update script name

* extra_components: import _add_missing_carriers_from_costs

* Add '_ec" infix in Snakefile

* Snakefile add infix at missing spot

* remove unintendetely inserted data.bundle, correct import in add_extra_components

* environment: fix pyyaml version

* set powerplantmatching as conda-dependency

* environment fix minimal ppm version

* environment reinsert pyyaml

* environment: carry over changes to environment.docs.yaml

* extra_components: add carriers

* update docstring

* Update scripts/add_extra_components.py

* Update scripts/add_extra_components.py

* tutorial: fix hyperlink [skip travis]

* update release notes

* update documentation

* add_electricity: merge removal of suptech
2019-11-19 19:36:28 +01:00
JanFrederickUnnewehr
6cde3e902b own databundle (#96)
* config.default.yaml

* retrieve_databundle: docs, config and defaults

* fix capitalisation of true/false
2019-11-19 15:56:44 +01:00
Fabian Neumann
c857f4ce95 retrieve_cutout: execute retrieve cutout only once 2019-11-11 16:51:25 +01:00
Fabian Neumann
a35dbc067c build_natura: add cutouts as input (closes #95) 2019-11-11 16:29:27 +01:00
Fabian Neumann
fd4e43c085 Snakefile: fix inputs for retrieve_databundle 2019-11-06 17:50:57 +01:00
Fabian Neumann
99cb4a4354
Merge pull request #86 from PyPSA/workflow
Integrate data retrieving into snakemake workflow
2019-11-06 16:06:11 +01:00
Fabian Neumann
0fb57601bf doc: document powerplantmatching changes from #84 2019-11-06 15:59:34 +01:00
Fabian Neumann
82392c6c07 Merge branch 'co2limit' of https://github.com/fneum/pypsa-eur into fneum-co2limit 2019-11-06 11:19:41 +01:00
Fabian
3597f931cf Snakefile remove space 2019-11-05 14:57:59 +01:00
Fabian
594489ef22 snakefile: remove commented files 2019-11-05 14:55:51 +01:00
Fabian
b1a38229f4 ignore sort warning 2019-11-05 14:29:15 +01:00
Fabian
f6e44d2805 include data retrieving in workflow 2019-11-05 12:53:21 +01:00
FabianHofmann
5cd7a46339 fully enable powerplantmatching 2019-10-31 16:45:13 +01:00
FabianHofmann
0c777fc431
Merge pull request #71 from PyPSA/update_link_length
[WIP] capital cost and underwater fraction update in clustering
2019-10-31 11:27:58 +01:00
Fabian Neumann
5ea60a1ee0 modify to run without GEBCO and without hydro 2019-10-03 12:32:49 +02:00
Fabian Hofmann
16ff2b51bd fix small issues 2019-09-23 16:44:48 +02:00
Fabian Neumann
c99480e0f3 add co2 emissions reduction factor to wildcard 2019-06-18 11:50:54 +02:00
Jonas Hoersch
31aefae93c make_summary: Allow mixing volume and cost limit 2019-02-22 17:08:43 +01:00
Jonas Hoersch
50abd6c0c9 build_country_flh: Add rule for per-country full load hours tables and plots 2019-02-15 18:27:04 +01:00