Merge branch 'eu-energy-security' of github.com:PyPSA/pypsa-eur into eu-energy-security
This commit is contained in:
commit
76cd0751b4
@ -73,6 +73,10 @@ Upcoming Release
|
|||||||
|
|
||||||
* A new section ``conventional`` was added to the config file. This section contains configurations for conventional carriers. Using the ``energy_availibility_factor`` key, the ``p_max_pu`` values for conventional power plants can be defined.
|
* A new section ``conventional`` was added to the config file. This section contains configurations for conventional carriers. Using the ``energy_availibility_factor`` key, the ``p_max_pu`` values for conventional power plants can be defined.
|
||||||
|
|
||||||
|
* Fix crs bug. Change crs 4236 to 4326.
|
||||||
|
|
||||||
|
* Update rasterio version to correctly calculate exclusion raster
|
||||||
|
|
||||||
|
|
||||||
Synchronisation Release - Ukraine and Moldova (17th March 2022)
|
Synchronisation Release - Ukraine and Moldova (17th March 2022)
|
||||||
===============================================================
|
===============================================================
|
||||||
|
@ -43,7 +43,7 @@ For more information on the data dependencies of PyPSA-Eur, continue reading :re
|
|||||||
How to customise PyPSA-Eur?
|
How to customise PyPSA-Eur?
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
The model can be adapted to only include selected countries (e.g. Germany) instead of all European countries to limit the spatial scope.
|
The model can be adapted to only include selected countries (e.g. Belgium) instead of all European countries to limit the spatial scope.
|
||||||
|
|
||||||
.. literalinclude:: ../config.tutorial.yaml
|
.. literalinclude:: ../config.tutorial.yaml
|
||||||
:language: yaml
|
:language: yaml
|
||||||
|
@ -24,6 +24,7 @@ dependencies:
|
|||||||
- yaml
|
- yaml
|
||||||
- pytables
|
- pytables
|
||||||
- lxml
|
- lxml
|
||||||
|
- powerplantmatching>=0.5.3
|
||||||
- numpy
|
- numpy
|
||||||
- pandas
|
- pandas
|
||||||
- geopandas
|
- geopandas
|
||||||
@ -45,7 +46,7 @@ dependencies:
|
|||||||
# GIS dependencies:
|
# GIS dependencies:
|
||||||
- cartopy
|
- cartopy
|
||||||
- descartes
|
- descartes
|
||||||
- rasterio
|
- rasterio<=1.2.9 # 1.2.10 creates error https://github.com/PyPSA/atlite/issues/238
|
||||||
|
|
||||||
# PyPSA-Eur-Sec Dependencies
|
# PyPSA-Eur-Sec Dependencies
|
||||||
- geopy
|
- geopy
|
||||||
|
@ -94,7 +94,6 @@ import geopandas as gpd
|
|||||||
import powerplantmatching as pm
|
import powerplantmatching as pm
|
||||||
from powerplantmatching.export import map_country_bus
|
from powerplantmatching.export import map_country_bus
|
||||||
|
|
||||||
from vresutils.costdata import annuity
|
|
||||||
from vresutils import transfer as vtransfer
|
from vresutils import transfer as vtransfer
|
||||||
|
|
||||||
idx = pd.IndexSlice
|
idx = pd.IndexSlice
|
||||||
@ -105,6 +104,18 @@ logger = logging.getLogger(__name__)
|
|||||||
def normed(s): return s/s.sum()
|
def normed(s): return s/s.sum()
|
||||||
|
|
||||||
|
|
||||||
|
def calculate_annuity(n, r):
|
||||||
|
"""Calculate the annuity factor for an asset with lifetime n years and
|
||||||
|
discount rate of r, e.g. annuity(20, 0.05) * 20 = 1.6"""
|
||||||
|
|
||||||
|
if isinstance(r, pd.Series):
|
||||||
|
return pd.Series(1/n, index=r.index).where(r == 0, r/(1. - 1./(1.+r)**n))
|
||||||
|
elif r > 0:
|
||||||
|
return r / (1. - 1./(1.+r)**n)
|
||||||
|
else:
|
||||||
|
return 1 / n
|
||||||
|
|
||||||
|
|
||||||
def _add_missing_carriers_from_costs(n, costs, carriers):
|
def _add_missing_carriers_from_costs(n, costs, carriers):
|
||||||
missing_carriers = pd.Index(carriers).difference(n.carriers.index)
|
missing_carriers = pd.Index(carriers).difference(n.carriers.index)
|
||||||
if missing_carriers.empty: return
|
if missing_carriers.empty: return
|
||||||
@ -138,7 +149,7 @@ def load_costs(tech_costs, config, elec_config, Nyears=1.):
|
|||||||
"investment" : 0,
|
"investment" : 0,
|
||||||
"lifetime" : 25})
|
"lifetime" : 25})
|
||||||
|
|
||||||
costs["capital_cost"] = ((annuity(costs["lifetime"], costs["discount rate"]) +
|
costs["capital_cost"] = ((calculate_annuity(costs["lifetime"], costs["discount rate"]) +
|
||||||
costs["FOM"]/100.) *
|
costs["FOM"]/100.) *
|
||||||
costs["investment"] * Nyears)
|
costs["investment"] * Nyears)
|
||||||
|
|
||||||
|
@ -240,7 +240,7 @@ if __name__ == '__main__':
|
|||||||
# use named function np.greater with partially frozen argument instead
|
# use named function np.greater with partially frozen argument instead
|
||||||
# and exclude areas where: -max_depth > grid cell depth
|
# and exclude areas where: -max_depth > grid cell depth
|
||||||
func = functools.partial(np.greater,-config['max_depth'])
|
func = functools.partial(np.greater,-config['max_depth'])
|
||||||
excluder.add_raster(snakemake.input.gebco, codes=func, crs=4236, nodata=-1000)
|
excluder.add_raster(snakemake.input.gebco, codes=func, crs=4326, nodata=-1000)
|
||||||
|
|
||||||
if 'min_shore_distance' in config:
|
if 'min_shore_distance' in config:
|
||||||
buffer = config['min_shore_distance']
|
buffer = config['min_shore_distance']
|
||||||
|
@ -171,6 +171,9 @@ def calculate_capacity(n,label,capacity):
|
|||||||
if 'p_nom_opt' in c.df.columns:
|
if 'p_nom_opt' in c.df.columns:
|
||||||
c_capacities = abs(c.df.p_nom_opt.multiply(c.df.sign)).groupby(c.df.carrier).sum()
|
c_capacities = abs(c.df.p_nom_opt.multiply(c.df.sign)).groupby(c.df.carrier).sum()
|
||||||
capacity = include_in_summary(capacity, [c.list_name], label, c_capacities)
|
capacity = include_in_summary(capacity, [c.list_name], label, c_capacities)
|
||||||
|
elif 'e_nom_opt' in c.df.columns:
|
||||||
|
c_capacities = abs(c.df.e_nom_opt.multiply(c.df.sign)).groupby(c.df.carrier).sum()
|
||||||
|
capacity = include_in_summary(capacity, [c.list_name], label, c_capacities)
|
||||||
|
|
||||||
for c in n.iterate_components(n.passive_branch_components):
|
for c in n.iterate_components(n.passive_branch_components):
|
||||||
c_capacities = c.df['s_nom_opt'].groupby(c.df.carrier).sum()
|
c_capacities = c.df['s_nom_opt'].groupby(c.df.carrier).sum()
|
||||||
@ -185,11 +188,11 @@ def calculate_capacity(n,label,capacity):
|
|||||||
def calculate_supply(n, label, supply):
|
def calculate_supply(n, label, supply):
|
||||||
"""calculate the max dispatch of each component at the buses where the loads are attached"""
|
"""calculate the max dispatch of each component at the buses where the loads are attached"""
|
||||||
|
|
||||||
load_types = n.loads.carrier.value_counts().index
|
load_types = n.buses.carrier.unique()
|
||||||
|
|
||||||
for i in load_types:
|
for i in load_types:
|
||||||
|
|
||||||
buses = n.loads.bus[n.loads.carrier == i].values
|
buses = n.buses.query("carrier == @i").index
|
||||||
|
|
||||||
bus_map = pd.Series(False,index=n.buses.index)
|
bus_map = pd.Series(False,index=n.buses.index)
|
||||||
|
|
||||||
@ -232,11 +235,11 @@ def calculate_supply(n, label, supply):
|
|||||||
def calculate_supply_energy(n, label, supply_energy):
|
def calculate_supply_energy(n, label, supply_energy):
|
||||||
"""calculate the total dispatch of each component at the buses where the loads are attached"""
|
"""calculate the total dispatch of each component at the buses where the loads are attached"""
|
||||||
|
|
||||||
load_types = n.loads.carrier.value_counts().index
|
load_types = n.buses.carrier.unique()
|
||||||
|
|
||||||
for i in load_types:
|
for i in load_types:
|
||||||
|
|
||||||
buses = n.loads.bus[n.loads.carrier == i].values
|
buses = n.buses.query("carrier == @i").index
|
||||||
|
|
||||||
bus_map = pd.Series(False,index=n.buses.index)
|
bus_map = pd.Series(False,index=n.buses.index)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user