Merge pull request #341 from PyPSA/issue-301

remove unused simple_hvdc_costs
This commit is contained in:
Fabian Neumann 2022-03-29 12:30:13 +02:00 committed by GitHub
commit bded794957
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 13 deletions

View File

@ -62,12 +62,15 @@ Upcoming Release
* New network topology extracted from the ENTSO-E interactive map. * New network topology extracted from the ENTSO-E interactive map.
* The unused argument ``simple_hvdc_costs`` in :mod:`add_electricity` was removed.
* Iterative solving with impedance updates is skipped if there are no expandable lines. * Iterative solving with impedance updates is skipped if there are no expandable lines.
* Switch from Germany to Belgium for continuous integration and tutorial to save resources. * Switch from Germany to Belgium for continuous integration and tutorial to save resources.
* Use updated SARAH-2 and ERA5 cutouts with slightly wider scope to east and additional variables. * Use updated SARAH-2 and ERA5 cutouts with slightly wider scope to east and additional variables.
PyPSA-Eur 0.4.0 (22th September 2021) PyPSA-Eur 0.4.0 (22th September 2021)
===================================== =====================================

View File

@ -227,7 +227,7 @@ def attach_load(n, regions, load, nuts3_shapes, countries, scaling=1.):
n.madd("Load", substation_lv_i, bus=substation_lv_i, p_set=load) n.madd("Load", substation_lv_i, bus=substation_lv_i, p_set=load)
def update_transmission_costs(n, costs, length_factor=1.0, simple_hvdc_costs=False): def update_transmission_costs(n, costs, length_factor=1.0):
# TODO: line length factor of lines is applied to lines and links. # TODO: line length factor of lines is applied to lines and links.
# Separate the function to distinguish. # Separate the function to distinguish.
@ -242,10 +242,6 @@ def update_transmission_costs(n, costs, length_factor=1.0, simple_hvdc_costs=Fal
# may be missing. Therefore we have to return here. # may be missing. Therefore we have to return here.
if n.links.loc[dc_b].empty: return if n.links.loc[dc_b].empty: return
if simple_hvdc_costs:
costs = (n.links.loc[dc_b, 'length'] * length_factor *
costs.at['HVDC overhead', 'capital_cost'])
else:
costs = (n.links.loc[dc_b, 'length'] * length_factor * costs = (n.links.loc[dc_b, 'length'] * length_factor *
((1. - n.links.loc[dc_b, 'underwater_fraction']) * ((1. - n.links.loc[dc_b, 'underwater_fraction']) *
costs.at['HVDC overhead', 'capital_cost'] + costs.at['HVDC overhead', 'capital_cost'] +

View File

@ -404,7 +404,7 @@ def make_summaries(networks_dict, paths, config, country='all'):
Nyears = n.snapshot_weightings.objective.sum() / 8760. Nyears = n.snapshot_weightings.objective.sum() / 8760.
costs = load_costs(paths[0], config['costs'], config['electricity'], Nyears) costs = load_costs(paths[0], config['costs'], config['electricity'], Nyears)
update_transmission_costs(n, costs, simple_hvdc_costs=False) update_transmission_costs(n, costs)
assign_carriers(n) assign_carriers(n)

View File

@ -104,7 +104,7 @@ def set_transmission_limit(n, ll_type, factor, costs, Nyears=1):
ref = (lines_s_nom @ n.lines[col] + ref = (lines_s_nom @ n.lines[col] +
n.links.loc[links_dc_b, "p_nom"] @ n.links.loc[links_dc_b, col]) n.links.loc[links_dc_b, "p_nom"] @ n.links.loc[links_dc_b, col])
update_transmission_costs(n, costs, simple_hvdc_costs=False) update_transmission_costs(n, costs)
if factor == 'opt' or float(factor) > 1.0: if factor == 'opt' or float(factor) > 1.0:
n.lines['s_nom_min'] = lines_s_nom n.lines['s_nom_min'] = lines_s_nom