From 96dc178e989c8eedc20b8268e022bdb9140556ca Mon Sep 17 00:00:00 2001 From: Bryan Lawrence Date: Sun, 3 Mar 2024 09:29:15 +0000 Subject: [PATCH] Fixes bug which stops the selection read from actually occurring and changes to actually using the filter pipeline. At this point is failling test_reference. --- pyfive/__init__.py | 1 + pyfive/dataobjects.py | 4 ++-- pyfive/high_level.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pyfive/__init__.py b/pyfive/__init__.py index 9df950e..9fa6180 100644 --- a/pyfive/__init__.py +++ b/pyfive/__init__.py @@ -3,5 +3,6 @@ """ from .high_level import File +from .indexing import ZarrArrayStub, OrthogonalIndexer __version__ = '0.4.0.dev' diff --git a/pyfive/dataobjects.py b/pyfive/dataobjects.py index 0730e12..90be3c4 100644 --- a/pyfive/dataobjects.py +++ b/pyfive/dataobjects.py @@ -741,7 +741,7 @@ def _get_chunk_addresses(self): for node in self.chunk_btree.all_nodes[0]: for node_key, addr in zip(node['keys'], node['addresses']): size = node_key['chunk_size'] - if self._filter_pipeline: + if self.filter_pipeline: # I am not sure this varies per chunk, but in case it does filter_mask = node_key['filter_mask'] else: @@ -768,7 +768,7 @@ def _get_selection_via_chunks(self, args): for chunk_coords, chunk_selection, out_selection in indexer: addr, chunk_buffer_size, filter_mask = self.get_chunk_details(chunk_coords) chunk_buffer = self.chunk_btree.get_one_chunk_buffer( - addr, chunk_buffer_size, itemsize, self._filter_pipeline, filter_mask) + addr, chunk_buffer_size, itemsize, self.filter_pipeline, filter_mask) chunk_data = np.frombuffer(chunk_buffer, dtype=self.dtype) out[out_selection] = chunk_data.reshape(self.chunks, order=self.order)[chunk_selection] diff --git a/pyfive/high_level.py b/pyfive/high_level.py index 6614f3a..c033217 100644 --- a/pyfive/high_level.py +++ b/pyfive/high_level.py @@ -276,7 +276,7 @@ def __repr__(self): return '' % info def __getitem__(self, args): - data = self._dataobjects.get_data()[args] + data = self._dataobjects.get_data(args) if self._astype is None: return data return data.astype(self._astype)