Skip to content

Commit a6c60d7

Browse files
alixdammangdementen
authored andcommitted
fix #291 : excluding 0D arrays when saving a session.
1 parent ca6e8ef commit a6c60d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

larray/io/session.py

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from collections import OrderedDict
55
from pandas import ExcelWriter, ExcelFile, HDFStore
66

7+
from larray.core.abc import ABCLArray
78
from larray.util.misc import pickle
89
from larray.io.excel import open_excel
910
from larray.io.array import df_aslarray, read_csv, read_hdf
@@ -114,6 +115,10 @@ def dump_arrays(self, key_values, *args, **kwargs):
114115
display = kwargs.pop('display', False)
115116
self._open_for_write()
116117
for key, value in key_values:
118+
if isinstance(value, ABCLArray) and value.ndim == 0:
119+
if display:
120+
print('Cannot dump {}. Dumping 0D arrays is not supported currently.'.format(key))
121+
continue
117122
if display:
118123
print("dumping", key, "...", end=' ')
119124
self._dump(key, value, *args, **kwargs)

0 commit comments

Comments
 (0)