aggregator: take care of no aggregating data in folder
This commit is contained in:
parent
22c82ae521
commit
f94c79f843
|
@ -221,7 +221,10 @@ class Aggregator:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if len(node_data) == 1:
|
if len(node_data) == 0:
|
||||||
|
# No data collected, return default AggregatedData with zeros
|
||||||
|
return AggregatedData(0.0, 0.0, 0.0, 0.0, 0.0)
|
||||||
|
elif len(node_data) == 1:
|
||||||
# Directly use the values for a single node
|
# Directly use the values for a single node
|
||||||
for node_number, data in node_data.items():
|
for node_number, data in node_data.items():
|
||||||
min_soc = data['soc'][0] if data['soc'] else 0.0
|
min_soc = data['soc'][0] if data['soc'] else 0.0
|
||||||
|
|
|
@ -226,7 +226,10 @@ class Aggregator:
|
||||||
except ValueError:
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if len(node_data) == 1:
|
if len(node_data) == 0:
|
||||||
|
# No data collected, return default AggregatedData with zeros
|
||||||
|
return AggregatedData(0.0, 0.0, 0.0, 0.0, 0.0)
|
||||||
|
elif len(node_data) == 1:
|
||||||
# Directly use the values for a single node
|
# Directly use the values for a single node
|
||||||
for node_number, data in node_data.items():
|
for node_number, data in node_data.items():
|
||||||
min_soc = data['soc'][0] if data['soc'] else 0.0
|
min_soc = data['soc'][0] if data['soc'] else 0.0
|
||||||
|
|
Loading…
Reference in New Issue