Minor fix - check for ragged array length when exporting to hdf5
This commit is contained in:
parent
5d6be5796b
commit
6287874b5c
@ -44,12 +44,18 @@ class HDF5Exporter(Exporter):
|
||||
data = []
|
||||
|
||||
appendAllX = self.params['columnMode'] == '(x,y) per plot'
|
||||
#print dir(self.item.curves[0])
|
||||
tlen = 0
|
||||
for i, c in enumerate(self.item.curves):
|
||||
d = c.getData()
|
||||
if i > 0 and len(d[0]) != tlen:
|
||||
raise ValueError ("HDF5 Export requires all curves in plot to have same length")
|
||||
if appendAllX or i == 0:
|
||||
data.append(d[0])
|
||||
tlen = len(d[0])
|
||||
data.append(d[1])
|
||||
|
||||
|
||||
fdata = numpy.array(data).astype('double')
|
||||
dset = fd.create_dataset(dsname, data=fdata)
|
||||
fd.close()
|
||||
|
Loading…
x
Reference in New Issue
Block a user