Skip to content

Commit 79057c0

Browse files
committed
bugfix for operation input/output mass in the empty case
1 parent 83cfef7 commit 79057c0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

elphick/geomet/flowsheet/operation.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def get_input_mass(self) -> pd.DataFrame:
7474
inputs = [i for i in self.inputs if i is not None]
7575

7676
if not inputs:
77-
return self._create_zero_mass()
77+
try:
78+
return self._create_zero_mass()
79+
except:
80+
return pd.DataFrame()
7881
elif len(inputs) == 1:
7982
return inputs[0].mass_data
8083
else:
@@ -84,7 +87,10 @@ def get_output_mass(self) -> pd.DataFrame:
8487
outputs = [o for o in self.outputs if o is not None]
8588

8689
if not outputs:
87-
return self._create_zero_mass()
90+
try:
91+
return self._create_zero_mass()
92+
except:
93+
return pd.DataFrame()
8894
elif len(outputs) == 1:
8995
return outputs[0].mass_data
9096
else:

0 commit comments

Comments
 (0)