Commit Graph

400 Commits

Author SHA1 Message Date
Tom Brown
62887b7870 Move solving memory from Snakefile to config.yaml 2020-03-25 14:51:37 +01: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
Tom Brown
5dc572c35e solve_network.py: Remove hacked installation of conda libraries 2020-03-04 18:10:57 +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
lisazeyen
36a57222f7 Clip p min pu (#50)
* changes for retrofitting

* changed Snakefile to work with new pypsa-eur version, change solve_network.py to clip also n.generators_t.p_min_pu

* removed retrofitting data files
2020-01-24 15:31:17 +01:00
Fabian
7c14b16777 solve_operations_network: fix snakemake input for unprepared network 2020-01-23 18:47:18 +01:00
Tom Brown
2278d67687 Add wave with default minimum costs 2020-01-11 09:11:09 +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
Tom Brown
8982147706 Convert code to use PyPSA nomopyomo branch; only works for LV=1.0
Will extend to LV > 1.0 soon.
2019-11-27 18:34:53 +01:00
Tom Brown
3fac944e5b 191108: Include a correctly-costed H2 network
Offers same topology to optimisation for H2 grid as that of HVAC and
HVDC grid.
2019-11-26 18:00:45 +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
Tom Brown
8d68146e7c Switch to BDEW-based weekday/end space heating demand profiles
These are different for residential and services demand.

Also include Snakefile in config files copied for each run.

Use gurobi settings from gurobi support for speed.

Commented out settings for testing randomness for noise.
2019-08-07 19:08:06 +02:00
Tom Brown
d3a0f7e67d Diff intraday heat profiles for (res, services) x (water, space)
These are specified in data/heat_load_profile.csv.

The resulting heat_demand df has MultiIndex columns, where the first
level is ["sector use"], and the second level level is nodes.
2019-08-01 15:43:04 +02:00
Tom Brown
32af25df62 Backup config files before solve_network rather than after
For debugging cases where solving failed.
2019-07-20 10:55:23 +02:00
Tom Brown
7509d61348 Split industrial demand across nodes by population 2019-07-18 15:55:58 +02:00
Tom Brown
f3b6027cd5 Incorporate Marta and Kun's scripts to build industry demand
By country and by energy source.
2019-07-18 11:40:38 +02:00
Fabian Neumann
c99480e0f3 add co2 emissions reduction factor to wildcard 2019-06-18 11:50:54 +02:00
Tom Brown
8394dca22c Rule to save a copy of important config files after each run 2019-05-16 09:39:03 +02:00
Tom Brown
c723291ac4 Save solve logs separately for each run 2019-05-13 18:37:11 +02:00
Tom Brown
77bef57c60 Automatic plotting of network maps with costs per node 2019-05-13 17:09:26 +02:00
Tom Brown
52a02bd979 Compute cfs; compute nodal costs, capacities, cfs; fix prices 2019-05-13 16:48:29 +02:00
Tom Brown
0ab5bd200a Fix gas and oil stores so that they allow fossil fuel extraction
Before both initial SOC and final SOC were set to be zero, which
prevents synthetic fuel transfer over the year boundary, and prevents
the use of fossil fuels for non-zero CO2 scenarios.

Now done properly with cyclic Store (prevents accumulation of fossil
fuels as a form of sequestration) and Generator (to imitate fossil
fuel extraction).
2019-05-08 12:18:18 +02:00
Tom Brown
5357b7b92f Record total capacities and total costs 2019-05-03 17:11:13 +02:00
Tom Brown
c47ffb8d03 Changes for 190501-256 2019-05-02 08:39:29 +02:00
Tom Brown
3b0e0dfb3a Changes to make solving and post-processing work 2019-04-18 12:12:38 +02:00
Tom Brown
e88b6c850f Fix prepare_sector_network to reproduce old sector prenetworks
from pypsa-eur sector branch
2019-04-17 17:04:33 +02:00
Tom Brown
ea22a792b7 Fix all data preparation steps up to prepare_network 2019-04-17 11:44:16 +02:00
Tom Brown
1b26c3c737 Copy data preparation scripts from pypsa-eur sector branch 2019-04-16 16:03:51 +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
Jonas Hoersch
15e986a0ec make_summary: Update summary creation for new line volume/cost constraints
Fixes #4.
2019-02-10 16:08:39 +01:00
Jonas Hoersch
c5b093380b solve_network: Slightly increase requested memory
Encountered out-of-memory kills for the 512_lc networks.
2019-02-06 11:49:06 +01:00
Jonas Hoersch
5dfeb6efbc trace_solve_network: Save intermediate line capacities 2019-02-04 18:32:56 +01:00
Jonas Hoersch
60dda9f909 plot_p_nom_max: Add plots for the cumulative renewable expansion potential
The wildcards `clusters` and `technology` accept lists of values separated by ','
2019-02-03 14:22:12 +01:00
Jonas Hoersch
dc134e88ab Add a separate rule for preparing all networks 2019-02-03 14:00:45 +01:00
Jonas Hoersch
dde0d91168 Include an optional total line cost constraint
elec_s_37_lc1.25_... adds a constraint on the total line cost for an extension
by a 25%, compare with elec_s_37_lv1.25_... for the line volume limit.

`ll` is an acronym for line limit.
2019-02-03 13:50:05 +01:00
Jonas Hoersch
f70e0304e5 Fix plotting settings 2019-01-16 12:08:46 +01:00
Jonas Hoersch
448ba651a0 build_renewable_profiles: Compute underwater_fraction 2018-12-11 17:30:25 +01:00
Jonas Hoersch
a035bee9c6 Merge branch 'windcosts' 2018-12-11 16:09:24 +01:00
Jonas Hoersch
802261eedd Use GLAES library by FZJ-IEK-3 for computing GIS potentials 2018-12-11 15:39:42 +01:00
Jonas Hörsch
761b1b998f make_summary: Add summary about capacities and allow single country summaries 2018-11-12 22:00:50 +01:00
Jonas Hörsch
c5e8c9ad25 add_electricity: Extend the assignment of max_hours 2018-11-12 22:00:46 +01:00
Jonas Hörsch
9c64034950 simplify_network: Add simplification cost updates
Depends on pypsa commit https://github.com/PyPSA/PyPSA/commit/9ec406252add1b6
2018-10-27 03:41:38 +02:00
Jonas Hörsch
b30f4a2fff Update technology costs for wind
Calculate grid extension costs for offshore based on weighted average distance
from weather cell to substation.
2018-10-26 21:32:04 +02:00
Jonas Hörsch
ee6085ed7e Snakefile: Comment out group settings
They are still experimental and lead to difficult to understand bugs.
For now we are advising to use submit the whole model generation up until the
prepare_network step on one compute node, i.e. submit a job running

snakemake --until prepare_network --resources mem=60000 -j4

for a 64GB compute node.

And only run the solve_network rule in parallel on the cluster.
2018-10-26 18:39:09 +02:00
Jonas Hörsch
5b201de7d4 {make,plot}_summary: Add rules to flexibly create summaries and plot them 2018-10-26 10:28:54 +02:00
Jonas Hörsch
0070b1c87c plot_network: Add functionality to produce a network plot of each solution 2018-10-25 16:43:24 +02:00
Jonas Hörsch
0c114c403c config: Update network_plot settings 2018-10-22 23:39:14 +02:00
Jonas Hörsch
d3d52cc60f Snakefile: Update memory requirements of solve_network 2018-10-22 23:28:56 +02:00
Jonas Hörsch
2b68ebadd5 Update Snakefile and cluster.yaml 2018-10-22 23:27:18 +02:00
Jonas Hörsch
1df85468aa add_electricity, prepare_network: Enable lv='inf' and remove converter link costs 2018-10-22 23:23:51 +02:00
Jonas Hörsch
52e214a3b2 base_network: Add links from TYNDP
Manually collected from https://tyndp.entsoe.eu/. Deactivated by default.
2018-09-24 20:19:47 +02:00
Jonas Hörsch
1678f319d8 prepare_network: Allow lv=inf to designate a fully cost-optimal expansion 2018-09-24 18:43:24 +02:00
Jonas Hörsch
748f4c9f36 Fix memory requirement for build_renewable_potentials
if distance is set one needs up to 24GB.
2018-09-24 18:43:24 +02:00
Jonas Hörsch
1069a52801 Reinstate cluster.yaml to define walltime, feature and log
resources in rules have to be integer-valued and parameters are not aggregated
to groups. making cluster.yaml the only mechanism compatible with rules and
group.
2018-09-20 14:26:38 +02:00
Jonas Hörsch
83e648b4c2 Update Snakefile for moab/torque profile
Remove cluster.yaml and snakemake_cluster, which are superseeded by profiles.
2018-09-19 15:21:11 +02:00
Jonas Hörsch
2372bb156d Prepare Snakefile and scripts for other solvers 2018-09-14 11:22:13 +02:00
Jonas Hörsch
fac30eb5a7 Snakefile: Set groups to minimize number of HPC jobs 2018-09-04 00:23:43 +02:00
Jonas Hörsch
a3ee75a2a7 Allow disabling rules prepare_links_p_nom and build_powerplants
Both rules have difficult to install dependencies and the correct output is
already included in the git repository.
2018-08-13 14:10:32 +02:00
Jonas Hörsch
fabbae8add Move generation of inflow to new cutout 2018-08-06 21:38:36 +02:00
Jonas Hörsch
c6a4de7469 Generate cutouts on-demand 2018-08-03 11:54:28 +02:00
Jonas Hörsch
6866ce6b06 Integrate bundled landuse and load data instead of relying on vresutils 2018-08-03 11:53:14 +02:00
Jonas Hörsch
8e4abc3fce build_shapes: Build shapes in separate rule from bundled data
- country_shapes
- offshore_shapes
- nuts3_shapes (nuts3 shapes already include population and gdp data)
2018-08-03 11:49:51 +02:00
Jonas Hörsch
5dabad31b2 Comment preliminary sectors rule 2018-07-10 17:41:59 +02:00
Jonas Hörsch
dedff1abdd Add costs directly into repository 2018-07-10 17:20:27 +02:00
Jonas Hörsch
fd026f4072 Store the busmaps underlying the simplification process as busmap_s 2018-07-10 16:31:57 +02:00
Jonas Hörsch
082b483820 Allow opts parameter to be empty 2018-07-10 15:57:51 +02:00
Jonas Hörsch
f32ac12199 Snakefile: Increase memory allowance for solve_network 2018-03-14 15:50:38 +01:00
Jonas Hörsch
d7ca9dc307 Snakefile: script directive should always be last 2018-03-14 11:48:14 +01:00
Jonas Hörsch
78ab018b60 cluster_network: Save maps from clustering as clustermaps 2018-03-13 11:50:06 +01:00
Jonas Hörsch
4bde9417dc Finish solve_operations_network 2018-03-13 10:47:47 +01:00
Jonas Hörsch
254ef948e5 config: Use gurobi instead of gurobi_persistent
The memory requirements of gurobi_persistent are significantly higher! Trade cpu
speed with memory.
2018-03-09 15:43:55 +01:00
Jonas Hörsch
cd970dad2b solve_operations_network: Add rule to solve opf with previously optimized capacities 2018-02-19 10:17:49 +01:00
Jonas Hörsch
de7cbd4e27 Several minor fixes 2018-02-19 10:16:29 +01:00
Jonas Hörsch
2c0b66c510 {simplify,cluster}_network: Fix two-step clustering and introduce m suffix
- a network name like elec_s1000_ now clusters the network down to 1000 buses in
  the simplify step.
- an 'm' after the number of clusters as in elec_s1000_181m_ skips the
  aggregation of renewable generators and just moves them to the new clustered
  bus in the second clustering step.
- to distribute the number of clusters to countries a small quadratic
  optimization is now performed to minimize \sum_i (n_i - L_i/\sum_j L_j N)**2,
  where n_i >= 1.
2018-02-19 10:03:25 +01:00
Jonas Hörsch
cb5681df18 Fix cluster use and memory requirements 2018-02-10 17:19:46 +01:00
Jonas Hörsch
6a613ea483 build_powerplants: Separate loading of power plant list into new rule 2018-02-10 17:16:20 +01:00
Jonas Hörsch
ff0d302479 Add all the parts to solve all networks 2018-01-30 23:49:41 +01:00
Jonas Hörsch
99299564d6 Split simplify_network from cluster_network 2018-01-30 23:11:16 +01:00
Jonas Hoersch
a867e245b3 Electricity network, Clustering and Solving 2018-01-29 22:28:33 +01:00
Jonas Hoersch
6e1566ac32 snakemake: Add skeletons and add prepare_links_p_nom rule 2017-12-18 20:34:15 +01:00