Code Monkey home page Code Monkey logo

pypsa-eur's Introduction

GitHub release (latest by date including pre-releases) Build Status Documentation Size Zenodo PyPSA-Eur Zenodo PyPSA-Eur-Sec Snakemake REUSE status Stack Exchange questions

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System

PyPSA-Eur is an open model dataset of the European energy system at the transmission network level that covers the full ENTSO-E area. The model is suitable both for operational studies and generation and transmission expansion planning studies. The continental scope and highly resolved spatial scale enables a proper description of the long-range smoothing effects for renewable power generation and their varying resource availability.

The model is described in the documentation and in the paper PyPSA-Eur: An Open Optimisation Model of the European Transmission System, 2018, arXiv:1806.01613. The model building routines are defined through a snakemake workflow. Please see the documentation for installation instructions and other useful information about the snakemake workflow. The model is designed to be imported into the open toolbox PyPSA.

WARNING: PyPSA-Eur is under active development and has several limitations which you should understand before using the model. The github repository issues collect known topics we are working on (please feel free to help or make suggestions). The documentation remains somewhat patchy. You can find showcases of the model's capabilities in the Joule paper The potential role of a hydrogen network in Europe, another paper in Joule with a description of the industry sector, or in a 2021 presentation at EMP-E. We do not recommend to use the full resolution network model for simulations. At high granularity the assignment of loads and generators to the nearest network node may not be a correct assumption, depending on the topology of the underlying distribution grid, and local grid bottlenecks may cause unrealistic load-shedding or generator curtailment. We recommend to cluster the network to a couple of hundred nodes to remove these local inconsistencies. See the discussion in Section 3.4 "Model validation" of the paper.

PyPSA-Eur Grid Model

The dataset consists of:

  • A grid model based on a modified GridKit extraction of the ENTSO-E Transmission System Map. The grid model contains 7072 lines (alternating current lines at and above 220kV voltage level and all high voltage direct current lines) and 3803 substations.
  • The open power plant database powerplantmatching.
  • Electrical demand time series from the OPSD project.
  • Renewable time series based on ERA5 and SARAH, assembled using the atlite tool.
  • Geographical potentials for wind and solar generators based on land use (CORINE) and excluding nature reserves (Natura2000) are computed with the atlite library.

A sector-coupled extension adds demand and supply for the following sectors: transport, space and water heating, biomass, industry and industrial feedstocks, agriculture, forestry and fishing. This completes the energy system and includes all greenhouse gas emitters except waste management and land use.

This diagram gives an overview of the sectors and the links between them:

sector diagram

Each of these sectors is built up on the transmission network nodes from PyPSA-Eur:

network diagram

For computational reasons the model is usually clustered down to 50-200 nodes.

Already-built versions of the model can be found in the accompanying Zenodo repository.

Contributing and Support

We strongly welcome anyone interested in contributing to this project. If you have any ideas, suggestions or encounter problems, feel invited to file issues or make pull requests on GitHub.

  • In case of code-related questions, please post on stack overflow.
  • For non-programming related and more general questions please refer to the mailing list.
  • To discuss with other PyPSA users, organise projects, share news, and get in touch with the community you can use the discord server.
  • For bugs and feature requests, please use the PyPSA-Eur Github Issues page.

Licence

The code in PyPSA-Eur is released as free software under the MIT License, see doc/licenses.rst. However, different licenses and terms of use may apply to the various input data.

pypsa-eur's People

Contributors

adam-dvorak1 avatar amosschle avatar chrstphtrs avatar coroa avatar cpschau avatar ekatef avatar energyls avatar euronion avatar fabianhofmann avatar fneum avatar gormbruunandresen avatar heronimonimo avatar irieo avatar janfrederickunnewehr avatar koen-vg avatar lindnemi avatar lisazeyen avatar lukasfrankenq avatar martacki avatar martavp avatar millingermarkus avatar nworbmot avatar p-glaum avatar parisra avatar pre-commit-ci[bot] avatar pz-max avatar tgi-climact avatar toniseibold avatar virio-andreyana avatar yerbol-akhmetov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypsa-eur's Issues

Run breaks when DE is not included in country list

When only running the model for NL, BE, LU the model breaks. Adding DE solves it but increases the computational load significantly. Problems seems to be related to the base_network.py script:

File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/numpy/core/_methods.py", line 26, in _amax
   return umr_maximum(a, axis, None, out, keepdims)
ValueError: zero-size array to reduction operation maximum which has no identity
[Tue Feb 12 11:19:21 2019]
Error in rule base_network:
   jobid: 6
   output: networks/base.nc

RuleException:
CalledProcessError in line 62 of /home/pypsa/pypsa-eur/Snakefile:
Command ' set -euo pipefail;  /home/.conda/envs/pypsa-eur/bin/python3.6 /home/pypsa/pypsa-eur/.snakemake/scripts/tmp8xt_y9hd.base_network.py ' returned non-zero exit status 1.
 File "/home/pypsa/pypsa-eur/Snakefile", line 62, in __rule_base_network
 File "/home/.conda/envs/pypsa-eur/lib/python3.6/concurrent/futures/thread.py", line 56, in run

More realistic AC offshore potentials for Germany and elsewhere in Europe

Currently we have tens of GW expansion potential for AC-connected offshore for Germany in the North Sea, whereas in reality Germany has almost no AC-connected offshore but almost 100% DC-connected offshore. We already use the marine nature reserves from Natura 2000 to exclude some of the AC-accessible area, see
https://nworbmot.org/natura_2000_reserves.png
and exclude locations more than 80 km from the shore (see parameter config.yaml, offshore-ac, max_shore_distance). However we're missing many of the other exclusion areas, e.g. due to shipping, see this official map of offshore potential areas here:
https://upload.wikimedia.org/wikipedia/commons/7/79/Karte_Offshore-Windkraftanlagen_in_der_Deutschen_Bucht.png

Looking at the map a good criterion for DC would be: exclude all nature reserves and other excluded areas. Then everything more than 50 km from mainland (NOT from islands) should be DC. This reproduces German AC versus DC connections.

hydro_profile is missing countries

I think I'm almost there, but now I run into this:

INFO:pypsa.io:Imported network base.nc has buses, lines, links, transformers
INFO:__main__:Added connection cost of 584-67363 Eur/MW/a to offwind-ac
INFO:__main__:Added connection cost of 1589-58672 Eur/MW/a to offwind-dc
Traceback (most recent call last):
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmp8o1icwp2.add_electricity.py", line 482, in <module>
    attach_hydro(n, costs, ppl)
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmp8o1icwp2.add_electricity.py", line 254, in attach_hydro
    inflow.sel(countries=country.loc[ppl.has_inflow].values)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/xarray/core/dataarray.py", line 849, in sel
    **indexers_kwargs)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/xarray/core/dataset.py", line 1610, in sel
    self, indexers=indexers, method=method, tolerance=tolerance)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/xarray/core/coordinates.py", line 355, in remap_label_indexers
    obj, v_indexers, method=method, tolerance=tolerance
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/xarray/core/indexing.py", line 258, in remap_label_indexers
    dim, method, tolerance)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/xarray/core/indexing.py", line 197, in convert_label_indexer
    % index_name)
KeyError: "not all values found in index 'countries'"
[Thu Feb  7 14:50:08 2019]
Error in rule add_electricity:
    jobid: 11
    output: networks/elec.nc

RuleException:
CalledProcessError in line 154 of /home/pypsa/pypsa-eur/Snakefile:
Command ' set -euo pipefail;  /home/.conda/envs/pypsa-eur/bin/python3.6 /home/pypsa/pypsa-eur/.snakemake/scripts/tmp8o1icwp2.add_electricity.py ' returned non-zero exit status 1.
  File "/home/pypsa/pypsa-eur/Snakefile", line 154, in __rule_add_electricity
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/pypsa/pypsa-eur/.snakemake/log/2019-02-07T144925.615481.snakemake.log

Originally posted by @Heronimonimo in #1 (comment)

Failure finding gurobi when directly setting number of clusters

When using the number of clusters in a command line call
snakemake -R results/summaries/elec_s6_all_lc1.0_Co2L-3H_all

It results in an error when using cbc:

INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, loads, storage_units
INFO:pypsa.io:Imported network elec.nc has buses, carriers, generators, lines, loads, storage_units, transformers
INFO:__main__:Mapping all network lines onto a single 380kV layer
INFO:__main__:Simplifying connected link components
INFO:__main__:Removing stubs
WARNING:__main__:The configured solver `cbc` does not support quadratic objectives. Falling back to `ipopt`.
INFO:__main__:Clustering to 6 buses
WARNING: Could not locate the 'gurobi' executable, which is required for
    solver gurobi
WARNING:pyomo.solvers:Could not locate the 'gurobi' executable, which is required for solver gurobi
Traceback (most recent call last):
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpiavuo4h_.simplify_network.py", line 299, in <module>
    n, cluster_map = cluster(n, int(snakemake.wildcards.simpl))
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpiavuo4h_.simplify_network.py", line 261, in cluster
    clustering = clustering_for_n_clusters(n, n_clusters, potential_mode=potential_mode)
  File "/home/pypsa/pypsa-eur/scripts/cluster_network.py", line 154, in clustering_for_n_clusters
    n, busmap_for_n_clusters(n, n_clusters, algorithm),
  File "/home/pypsa/pypsa-eur/scripts/cluster_network.py", line 109, in busmap_for_n_clusters
    n_clusters = distribute_clusters(n, n_clusters, solver_name=solver_name)
  File "/home/pypsa/pypsa-eur/scripts/cluster_network.py", line 91, in distribute_clusters
    results = opt.solve(m)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pyomo/opt/base/solvers.py", line 541, in solve
    self.available(exception_flag=True)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pyomo/solvers/plugins/solvers/GUROBI.py", line 156, in available
    val = ILMLicensedSystemCallSolver.available(self, exception_flag)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pyomo/opt/solver/ilmcmd.py", line 36, in available
    if not pyomo.opt.solver.shellcmd.SystemCallSolver.available(self, exception_flag):
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pyomo/opt/solver/shellcmd.py", line 122, in available
    raise ApplicationError(msg % self.name)
pyutilib.common._exceptions.ApplicationError: No executable found for solver 'gurobi'

snakemake loop issue

What I want to achieve is to run a loop in snakemake, giving the initial input file and generating the output iteratively. I took the approach using "for" loop, i.e.,
rule all:
input: "{wildcards}-3"
for i in range(n):
rule:
input: "{wildcards}-{param}".format(param=i-1)
output: "{wildcards}-{param}".format(param=i)
script: do something

If the initial file is named after "A-0", the workflow is supposed to generate outputs until "A-3". However, I got KeyError: "wildcards", and I suspect it is due to the fact that wildcards and python string format cannot be used in the same line. Does anyone have solutions to this problem? Or maybe you have a better way to implement the loop?

Set min/max constraint for each technology per country

What would be the advisable way to set a minimum/maximum constraint for technologies per country?

I was thinking about using a .csv with the same structure as the costs.csv. This could than be loaded at the add_electricity phase. Would this be the right way?

Include nuclear

For electricity, CHP, hydrogen production and industrial process heat.

Plot breaks when conventional carriers are included

When making a plot with conventional carriers enabled it breaks. From what I understand one of the types of line has no color defined in the tech_colors table. Unfortunately I can't find what name that line would have:

Traceback (most recent call last):
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpwavuangu.plot_network.py", line 118, in <module>
    ax=ax)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pypsa/plot.py", line 159, in plot
    "bus_colors must be a dictionary defining a color for each element " \
AssertionError: bus_colors must be a dictionary defining a color for each element in the second MultiIndex level of bus_sizes
[Thu Feb 14 16:32:31 2019]
Error in rule plot_network:
    jobid: 0
    output: results/plots/elec_s_10_lc1_Co2L-3H_p_nom.pdf, results/plots/elec_s_10_lc1_Co2L-3H_p_nom_ext.pdf

RuleException:
CalledProcessError in line 267 of /home/pypsa/pypsa-eur/Snakefile:
Command ' set -euo pipefail;  /home/.conda/envs/pypsa-eur/bin/python3.6 /home/pypsa/pypsa-eur/.snakemake/scripts/tmpwavuangu.plot_network.py ' returned non-zero exit status 1.
  File "/home/pypsa/pypsa-eur/Snakefile", line 267, in __rule_plot_network
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/pypsa/pypsa-eur/.snakemake/log/2019-02-14T163224.663600.snakemake.log

How to add multi country connected offshore hub?

I've been looking how to add an offshore hub that's connected to multiple countries. As far as I know the best route would be by forcibly adding a bus that is located at for example the Dogger Bank (https://en.wikipedia.org/wiki/Dogger_Bank). My goal is to see the total effect of:

  • far offshore wind farm
  • increased interconnection between countries

Do you have any advice on an elegant way to add this? For now my guess is to find a way to force a certain bus when clustering. But I'm not entirely sure.

Add option to set number of clusters per country

Just thinking of the following enhancement:
Would it be possible to set the number of clusters per country? That would enable to do more detailed analysis on one country while keeping approximately right border flows.

Separate residential and tertiary/services time series for decentralised heating

Currently the daily heating profile we use for the time series includes both residential and tertiary demand, so it has a peak at midday (for tertiary) and a peak in the evening (for residential). However, since these two peaks happen in different building stocks, we're underestimating the total peak demand by using only a single time series. Therefore we should split heating demand into residential and tertiary sectors. (In district heating it's OK because both sectors are served by the same source.)
We already have the total thermal energy demand in data/energy_totals.csv by sector, so we just need to find weekday and weekend daily profiles for tertiary and residential demand from somewhere. Sources to try: RLI, look on openmod forum, standard profiles for Germany, etc.

Unify year of euro costs to take account of inflation

When quoting costs it is usual to specify the year for the value of the currency, e.g. 2015-EUR/kW. This takes account of inflation which, although small, can propagate over decades.

DIW costs: 2010-EUR
Budischak: unclear, paper is from 2012-2013, some costs given for 2008
EnergyPLAN Cost Database Version 3.0: fuel costs given in 2009-EUR
Danish Energy Agency: unclear
Henning & Palzer: paper from 2013, most values for energy etc. given in reference to 2010

Suggestion: unify on 2010-EUR

one-node-per-country clustering becomes infeasible

I have tried with 37 nodes clustering, which works totally fine. However, if I want one-node-per-country, the cluster_network rule becomes infeasible with the following message:

  File "/home/zhu/pypsa-eur/.snakemake/scripts/tmpli1lgrnk.cluster_network.py", line 116, in busmap_for_n_clusters
    n_clusters = distribute_clusters(n, n_clusters, solver_name=solver_name)
  File "/home/zhu/pypsa-eur/.snakemake/scripts/tmpli1lgrnk.cluster_network.py", line 99, in distribute_clusters
    assert results['Solver'][0]['Status'].key == 'ok', "Solver returned non-optimally: {}".format(results)
AssertionError: Solver returned non-optimally

Also, I am not quite sure what is the reason to cluster the network twice. Please shed some lights on this.

Recent change has broken cluster_network when running for one country only

One of the more recent changes has broken the cluster_network script. Have been trying to figure out but can't find what goes wrong. Might this have something to do with a specific pandas version that is needed? Or is it a stupid err on my side?

INFO:pypsa.io:Imported network elec_s.nc has buses, carriers, generators, lines, links, loads, storage_units
WARNING:__main__:The configured solver `cbc` does not support quadratic objectives. Falling back to `ipopt`.
Traceback (most recent call last):
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpgo1s6gwl.cluster_network.py", line 240, in <module>
    potential_mode=potential_mode)
  File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpgo1s6gwl.cluster_network.py", line 164, in clustering_for_n_clusters
    generator_strategies={'p_nom_max': p_nom_max_strategy}
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pypsa/networkclustering.py", line 244, in get_clustering_from_busmap
    buses, linemap, linemap_p, linemap_n, lines = get_buses_linemap_and_lines(network, busmap, line_length_factor, bus_strategies)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pypsa/networkclustering.py", line 219, in get_buses_linemap_and_lines
    buses = aggregatebuses(network, busmap, bus_strategies)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pypsa/networkclustering.py", line 155, in aggregatebuses
    .groupby(busmap).agg(strategies) \
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/generic.py", line 6665, in groupby
    observed=observed, **kwargs)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 2152, in groupby
    return klass(obj, by, **kwds)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 599, in __init__
    mutated=self.mutated)
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 3315, in _get_grouper
    if not isinstance(gpr, Grouping) else gpr
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/groupby/groupby.py", line 3025, in __init__
    raise ValueError("Grouper for '%s' not 1-dimensional" % t)
ValueError: Grouper for '<class 'pandas.core.frame.DataFrame'>' not 1-dimensional
[Tue Feb 19 10:23:58 2019]
Error in rule cluster_network:
    jobid: 2
    output: networks/elec_s_5.nc, resources/regions_onshore_elec_s_5.geojson, resources/regions_offshore_elec_s_5.geojson, resources/clustermaps_elec_s_5.h5

RuleException:
CalledProcessError in line 188 of /home/pypsa/pypsa-eur/Snakefile:
Command ' set -euo pipefail;  /home/.conda/envs/pypsa-eur/bin/python3.6 /home/pypsa/pypsa-eur/.snakemake/scripts/tmpgo1s6gwl.cluster_network.py ' returned non-zero exit status 1.
  File "/home/pypsa/pypsa-eur/Snakefile", line 188, in __rule_cluster_network
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/concurrent/futures/thread.py", line 56, in run

Edit: strangely enough it doesn't happen when running for BE+NL but it does happen when running for DE only

More detail of distribution of buildings' heat consumption for retrofitting/efficiency measures

Stefan Petrovic from DTU mentioned a database from Vienna, DTU, called TABULA:
http://episcope.eu/welcome/
There's a nice distribution of kWh/d/household heating demand in the UK in Figure 6 of
https://doi.org/10.1039/C8EE01157E

Should look on Odyssee for retrofitting/efficiency data (e.g. progress per year).

See also Leander Kotzur PhD thesis for retrofitting measures in Germany:
https://publications.rwth-aachen.de/record/752116

Aggregated costs for measures in Europe, based on another source, for PRIMES on page 43 of:

https://ec.europa.eu/energy/sites/ener/files/documents/2018_06_27_technology_pathways_-_finalreportmain2.pdf

make_summary brakes on 'links'

After solving the network for DE + NL a new problem seems to have shown up in the make_summary rule:

Traceback (most recent call last):
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 3078, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 140, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 162, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1492, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1500, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'links'

It seems to be related with 'links' and pandas. Can't directly figure out what is going on or if it is an error on my side.

Edit: seems to be related to German dataset. Make_summary works fine for NL+BE combo.

Integrate industry flexibility

E.g. aluminium smelters adjust dynamically to price.
Demand for H2 and other synthetic fuels is automatically flexible thanks to storage options for these fuels.

Prepare data for pathway optimisation with sector coupling

Heating

  • Today's split of heating technologies in each country: district heating / gas boiler / oil boiler (JRC IDEES in "residential" and "tertiary")
  • Approximations of age distribution of heating infrastructure (assumption e.g. 25% 5 years old, 25% 10 years old, etc.)
  • Capital costs and fuel costs over time

Transport

  • Number of vehicles in each country (JRC IDEES)
  • Distribution of their ages, or make assumption (e.g. 25% 5 years old, etc.), could be different in different countries
  • EITHER cost prediction for EVs over time (e.g. from Bloomberg NEF or Fraunhofer IEE or EnergyPLAN) OR exogenous share of EV over time

Industry

  • Costs of different production pathways, e.g. blast furnace versus DRI + electric furnace, to determine substitution pathway (Christian Breyer has researched some of these costs) OR exogenous pathway

Other studies

Fraunhofer IEE (formerly IWES) has cost assumptions over time for vehicles, heating, etc., as does Palzer PhD thesis, see e.g. references in Synergies of Sector Coupling paper, e.g.
http://www.energiesystemtechnik.iwes.fraunhofer.de/de/projekte/suche/laufende/interaktion_strom_waerme_verkehr.html
has diesel versus petrol versus EV for DE until 2050, see e.g. Figure 0-9, costs in Table 10-35 (beware battery costs too high since study is old).

Add documentation about available snakemake rules and project directory structure

After running the cluster_network rule snakemake stops. Trying to manually run the next steps with:

snakemake -R solve_network
Building DAG of jobs...
Nothing to be done.
Complete log: /home/pypsa/pypsa-eur/.snakemake/log/2019-02-08T090811.231068.snakemake.log

I can't find a way to make it run the other rules. But that might be todo with me being very new with the snakemake rule structure. Thanks in advance!

Fiona error

After first setup following the readme I run into the following issue when running snakemake:

File "/home/pypsa/pypsa-eur/.snakemake/scripts/tmpd0ajxt9a.build_shapes.py", line 21, in _get_country
    return getattr(pyc.countries.get(**keys), target)
AttributeError: 'NoneType' object has no attribute 'alpha_3'
[Thu Feb  7 10:32:17 2019]
Error in rule build_shapes:
    jobid: 14
    output: resources/country_shapes.geojson, resources/offshore_shapes.geojson, resources/europe_shape.geojson, resources/nuts3_shapes.geojson

RuleException:
CalledProcessError in line 81 of /home/pypsa/pypsa-eur/Snakefile:
Command ' set -euo pipefail;  /home/.conda/envs/pypsa-eur/bin/python3.6 /home/pypsa/pypsa-eur/.snakemake/scripts/tmpd0ajxt9a.build_shapes.py ' returned non-zero exit status 1.
  File "/home/pypsa/pypsa-eur/Snakefile", line 81, in __rule_build_shapes
  File "/home/.conda/envs/pypsa-eur/lib/python3.6/concurrent/futures/thread.py", line 56, in run
Removing output files of failed job build_shapes since they might be corrupted:
resources/country_shapes.geojson
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/pypsa/pypsa-eur/.snakemake/log/2019-02-07T102832.252956.snakemake.log

I've tried going back to Fiona 1.8.3 instead of 1.8.4, but that doesn't seem to solve the issue.

How to use the options variable (opts)

Hello,
I have tried to figure out which possibilities the different "opts" variables have in config.yaml.
I didn't find any information about the different "opts" that are listed in the file. What do the different options?

In the documentation, another option is listed after the "opts" variable. The "all countries" option. Has this option been replaced by the countries the config.yaml?

Thanks in advance,
Best Freddy

More realistic AC offshore potentials for Germany and elsewhere in Europe

At the moment all sea area within 80 km of each country that is not in a Natura 2000 nature reserve (see https://nworbmot.org/natura_2000_reserves.png for the excluded areas) is allotted to AC-connected offshore wind, and then 30% of that area is actually used (to take account of other uses like shipping lanes, etc, leading to a density of 3 MW/km^2 in the allowed areas). Beyond 80 km, offshore is connected with DC, which has higher costs because of the AC-DC converter stations. These settings can be found in config.yaml. The 80 km limit was based on Figure 34 of
https://ec.europa.eu/energy/sites/ener/files/documents/2014_nsog_report.pdf
which plots technology choices for different parks.

This leads to tens of GW expansion potential for AC-connected offshore for Germany in the North Sea, whereas in reality Germany has very little AC-connected offshore (a few parks in the North Sea and all the parks in the Baltic Sea) but a large amount of DC-connected offshore (only in the North Sea so far), see this map of current and planned offshore for Germany and the various exclusion areas:
https://upload.wikimedia.org/wikipedia/commons/7/79/Karte_Offshore-Windkraftanlagen_in_der_Deutschen_Bucht.png

There are two sources of problems:
i) There are some exclusion areas we're missing.
ii) Based on the map, a 50 km subsea limit for AC would better represent the existing and planned AC-DC split in the North Sea. This also fits with UK parks, which are all AC-connected, with the farthest existing park at 34 km from shore (Greater Gabbard 1). The discrepancy with the 80 km source above could be that the 80 km also included onshore.
iii) The 50 km limit should be measured from the mainland, NOT from the Fresian islands or Heligoland.
iv) 30% area usage may even be too strict: @fneum reports that with a 30 km limit, the potentials for Germany are 23.3 GW for AC-connected offshore wind (too high, at least for North Sea, I don't know about Baltic), and 67.0 GW for DC-connected offshore wind (seems too low to me, but I need a better reference).

Solutions:
i) To find the additional exclusion areas, @fneum suggested the following references:
http://www.windspeed.eu/media/publications/WINDSPEED_D2_1_revised_May_2011.pdf page 18
http://www.windspeed.eu/media/publications/WINDSPEED_Roadmap_110719_final.pdf page 26 Fig. 13
https://www.msp-platform.eu/practices/maritime-spatial-plan-german-eez-north-sea German Maritime Spatial Plan (Raumordnungsplan)
http://www.esa.int/spaceinimages/Images/2009/05/NO2_map_placed_on_top_of_the_shipping_route_map
ii) This is easy to change in config.yaml.
iii) As far as I can tell, the country shapes in scripts/build_shapes.py include everything with an area bigger than 0.1, which may include islands. Islands should be excluded from the 50 km limit (which is applied in scripts/build_renewable_profiles.py).
iv) Perhaps increase density from 3 MW/km^2 - need another reference for this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.