Update scripts/add_electricity.py

Co-authored-by: Fabian Hofmann <fab.hof@gmx.de>
This commit is contained in:
virio-andreyana 2023-04-27 17:29:20 +02:00 committed by GitHub
parent e38a0a9d34
commit e24ca89a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,8 @@ 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)
if len(missing_carrier):
n.madd("Carrier", missing_carrier)
def _add_missing_carriers_from_costs(n, costs, carriers):