From 984e688615c8ee25903fa2a17d9d68dd9020e757 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Wed, 28 Oct 2020 15:30:36 +0100 Subject: [PATCH] skip cost aggregation of component if empty --- scripts/_helpers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/_helpers.py b/scripts/_helpers.py index fff8143d..85f5eb76 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -168,6 +168,7 @@ def aggregate_costs(n, flatten=False, opts=None, existing_only=False): n.iterate_components(iterkeys(components), skip_empty=False), itervalues(components) ): + if c.df.empty: continue if not existing_only: p_nom += "_opt" costs[(c.list_name, 'capital')] = (c.df[p_nom] * c.df.capital_cost).groupby(c.df.carrier).sum() if p_attr is not None: