From 3e638e2cf25d5f7a854aff552a1e82db38a5482b Mon Sep 17 00:00:00 2001 From: Thomas Fillon Date: Thu, 17 Jul 2014 10:55:16 +0200 Subject: [PATCH] fix(tools/buffering.py): provide compatibility with pytables 2.3.1 use proper arguments for createEArray() --- timeside/tools/buffering.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/timeside/tools/buffering.py b/timeside/tools/buffering.py index 364536c..e49bb28 100644 --- a/timeside/tools/buffering.py +++ b/timeside/tools/buffering.py @@ -53,9 +53,20 @@ class BufferTable(object): except tables.exceptions.NoSuchNodeError: if name not in self.array_names: self.array_names.append(name) + # The following is compatible with pytables 3 only + #self.fileh.create_earray(where=self.fileh.root, + # name=name, + # obj=[new_array]) + atom = tables.Atom.from_dtype(new_array.dtype) + if len(new_array.shape) > 1: + shape = (0, new_array.shape[1]) + else: + shape = (0,) self.fileh.createEArray(where=self.fileh.root, - name=name, - obj=[new_array]) + name=name, + atom=atom, + shape=shape) + self.append(name, new_array) def close(self): for name in self.array_names: -- 2.39.5