Skip to content
Snippets Groups Projects
Commit af67ba0f authored by Ask Hjorth Larsen's avatar Ask Hjorth Larsen
Browse files

handle empty arrays correctly

parent 94757106
No related branches found
No related tags found
No related merge requests found
......@@ -319,6 +319,7 @@ class GulpContext(object):
allgroups.append(thislinegroups)
def savearray(parser):
print('SAVE', name)
arr = np.array(allgroups, dtype=object)
del allgroups[:]
if name in self.data:
......@@ -330,8 +331,10 @@ class GulpContext(object):
pass
else:
raise ValueError('Unknown keyword %s' % conflict)
if arr.size > 0:
self.data[name] = arr
#if arr.size > 0:
if arr.size == 0:
arr.shape = (0, ngroups)
self.data[name] = arr
if endmatcher is None:
endmatcher = r'.*'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment