add the function add_missing_carrier
add_missing_carrier() are applied on python script where new components are added. The function runs ideally after all of the new components are added and before add_nice_carrier_names()
This commit is contained in:
parent
e550ba915d
commit
71c1a7fbef
@ -120,6 +120,11 @@ def calculate_annuity(n, r):
|
||||
else:
|
||||
return 1 / n
|
||||
|
||||
def add_missing_carrier(n):
|
||||
components = [n.buses, n.generators, n.lines, n.links, n.storage_units, n.stores]
|
||||
for c in components:
|
||||
missing_carrier = np.setdiff1d(c.carrier.unique(),n.carriers.index)
|
||||
n.madd("Carrier",missing_carrier)
|
||||
|
||||
def _add_missing_carriers_from_costs(n, costs, carriers):
|
||||
missing_carriers = pd.Index(carriers).difference(n.carriers.index)
|
||||
@ -832,7 +837,8 @@ if __name__ == "__main__":
|
||||
estimate_renewable_capacities(n, snakemake.config)
|
||||
|
||||
update_p_nom_max(n)
|
||||
|
||||
|
||||
add_missing_carrier(n)
|
||||
add_nice_carrier_names(n, snakemake.config)
|
||||
|
||||
n.meta = snakemake.config
|
||||
|
Loading…
Reference in New Issue
Block a user