From c54ddab4a331fdbe08f4938cb838bf2f128d93f0 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Thu, 24 Mar 2022 14:47:00 +0100 Subject: [PATCH] remove unused simple_hvdc_costs --- doc/release_notes.rst | 1 + scripts/add_electricity.py | 18 +++++++----------- scripts/make_summary.py | 2 +- scripts/prepare_network.py | 2 +- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 3b20fbcf..7deee108 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -62,6 +62,7 @@ Upcoming Release * New network topology extracted from the ENTSO-E interactive map. +* The unused argument ``simple_hvdc_costs`` in :mod:`add_electricity` was removed. PyPSA-Eur 0.4.0 (22th September 2021) ===================================== diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 7dffe60f..ad932cd8 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -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) -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. # Separate the function to distinguish. @@ -242,16 +242,12 @@ def update_transmission_costs(n, costs, length_factor=1.0, simple_hvdc_costs=Fal # may be missing. Therefore we have to return here. 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 * - ((1. - n.links.loc[dc_b, 'underwater_fraction']) * - costs.at['HVDC overhead', 'capital_cost'] + - n.links.loc[dc_b, 'underwater_fraction'] * - costs.at['HVDC submarine', 'capital_cost']) + - costs.at['HVDC inverter pair', 'capital_cost']) + costs = (n.links.loc[dc_b, 'length'] * length_factor * + ((1. - n.links.loc[dc_b, 'underwater_fraction']) * + costs.at['HVDC overhead', 'capital_cost'] + + n.links.loc[dc_b, 'underwater_fraction'] * + costs.at['HVDC submarine', 'capital_cost']) + + costs.at['HVDC inverter pair', 'capital_cost']) n.links.loc[dc_b, 'capital_cost'] = costs diff --git a/scripts/make_summary.py b/scripts/make_summary.py index 854e9463..af1ecf36 100644 --- a/scripts/make_summary.py +++ b/scripts/make_summary.py @@ -404,7 +404,7 @@ def make_summaries(networks_dict, paths, config, country='all'): Nyears = n.snapshot_weightings.objective.sum() / 8760. 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) diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index f984ace6..206e220b 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -104,7 +104,7 @@ def set_transmission_limit(n, ll_type, factor, costs, Nyears=1): ref = (lines_s_nom @ n.lines[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: n.lines['s_nom_min'] = lines_s_nom