From 93d90ddba8636bc866c12f59dd5e76762513588c Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Mon, 18 Jan 2021 10:36:16 +0100 Subject: [PATCH] [dataview] fix data_fetched counter --- nixview/util/dataview.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/nixview/util/dataview.py b/nixview/util/dataview.py index beec708..6dc9e19 100644 --- a/nixview/util/dataview.py +++ b/nixview/util/dataview.py @@ -18,7 +18,6 @@ class DataView(): def request_more(self): if self.fully_loaded: - print("all data fetched") return # first make sure, that the count is valid, i.e. inside data valid_count = self._file_handler.valid_count(self._full_shape, self._offset, self._count) @@ -31,7 +30,7 @@ class DataView(): new_ofst[i] = sum(x) self._offset = tuple(new_ofst) - self._fetched_data = tuple([sum(x) for x in zip(self._fetched_data, self._count)]) + self._fetched_data = tuple([sum(x) for x in zip(self._fetched_data, valid_count)]) def init_chunking(self): """decides on the chunks size for reading. Heuristic is based on the dimensionality of the data and the "best xdim" if available. @@ -63,13 +62,13 @@ class DataView(): print("init buffer") @property - def fully_loaded(self): + def fully_loaded(self): return np.all(self._buffer is not None and self._fetched_data == self._full_shape) def __str__(self) -> str: r = self._item_descriptor.name + " " + str(self._item_descriptor.entity_type) - r += "buffer size: " + str(self._buffer.shape) if self._buffer is not None else "" + "\n" - r += "chunk size:" + str(self._count) - r += "is fully loaded: " + str(self.fully_loaded) + r += " buffer size: " + str(self._buffer.shape) if self._buffer is not None else "" + "\n" + r += " max chunk size: " + str(self._count) + r += " is fully loaded: " + str(self.fully_loaded) return r \ No newline at end of file