Skip to content

Commit de97167

Browse files
committed
Fix conversion to numpy array for data with eroded elements.
1 parent 723b930 commit de97167

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/lasso/dyna/binout.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,16 @@ def _get_variable(self, path):
338338
if time_symbol:
339339
time += time_symbol.read()
340340

341+
try:
342+
data_array = np.array(data)
343+
except ValueError:
344+
data_array = np.array(data, dtype=object)
345+
341346
# return sorted by time
342347
if len(time) == len(data):
343-
return np.array(data)[np.argsort(time)]
348+
return data_array[np.argsort(time)]
344349

345-
return np.array(data)
350+
return data_array
346351

347352
def _collect_variables(self, symbol):
348353
"""Collect all variables from a symbol

0 commit comments

Comments
 (0)