Skip to content

Commit a47138d

Browse files
authored
fix: DE specific changes for for pypsa v1 (#113)
1 parent 54043de commit a47138d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/pypsa-de/export_ariadne_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4296,7 +4296,7 @@ def get_economy(n, region):
42964296
var = pd.Series()
42974297

42984298
def get_tsc(n, country):
4299-
n.statistics.set_parameters(drop_zero=False)
4299+
pypsa.options.params.statistics.drop_zero = False
43004300
capex = n.statistics.capex(
43014301
groupby=pypsa.statistics.groupers["name", "carrier"], nice_names=False
43024302
)

scripts/pypsa-de/modify_prenetwork.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ def add_hydrogen_turbines(n):
923923
h2_plants.bus2 = ""
924924
h2_plants.efficiency2 = 1
925925
# add the new links
926-
n.import_components_from_dataframe(h2_plants, "Link")
926+
n.add("Link", h2_plants.index, **h2_plants)
927927

928928
# special handling of CHPs
929929
gas_plants = n.links[
@@ -937,7 +937,7 @@ def add_hydrogen_turbines(n):
937937
h2_plants.bus0 = h2_plants.bus1 + " H2"
938938
h2_plants.bus3 = ""
939939
h2_plants.efficiency3 = 1
940-
n.import_components_from_dataframe(h2_plants, "Link")
940+
n.add("Link", h2_plants.index, **h2_plants)
941941

942942

943943
def force_retrofit(n, params):
@@ -980,7 +980,7 @@ def force_retrofit(n, params):
980980
h2_plants.capital_cost *= 1 + params["cost_factor"]
981981
h2_plants.overnight_cost *= 1 + params["cost_factor"]
982982
# add the new links
983-
n.import_components_from_dataframe(h2_plants, "Link")
983+
n.add("Link", h2_plants.index, **h2_plants)
984984
n.links.drop(gas_plants, inplace=True)
985985

986986
# special handling of CHPs
@@ -1001,7 +1001,7 @@ def force_retrofit(n, params):
10011001
h2_plants.efficiency3 = 1 # default value
10021002
h2_plants.capital_cost *= 1 + params["cost_factor"]
10031003
h2_plants.overnight_cost *= 1 + params["cost_factor"]
1004-
n.import_components_from_dataframe(h2_plants, "Link")
1004+
n.add("Link", h2_plants.index, **h2_plants)
10051005
n.links.drop(gas_plants, inplace=True)
10061006

10071007

0 commit comments

Comments
 (0)