5
5
import urllib
6
6
import pyfive
7
7
import time
8
+ from operator import mul
9
+ from pyfive .h5d import StoreInfo
8
10
9
11
import s3fs
10
12
@@ -334,7 +336,7 @@ def _from_storage(self, ds, indexer, chunks, out_shape, out_dtype, compressor, f
334
336
out = []
335
337
counts = []
336
338
else :
337
- out = np .empty (out_shape , dtype = out_dtype , order = ds .order )
339
+ out = np .empty (out_shape , dtype = out_dtype , order = ds ._order )
338
340
counts = None # should never get touched with no method!
339
341
340
342
# Create a shared session object.
@@ -464,16 +466,19 @@ def _process_chunk(self, session, ds, chunks, chunk_coords, chunk_selection, cou
464
466
#FIXME: Do, we, it's not actually used?
465
467
466
468
"""
467
- # This should contain all the valid chunks
468
- print (ds ._index .keys (), len (ds ._index .keys ()))
469
- offset , size , filter_mask = ds ._index [chunk_coords ]
469
+ # map into correct coordinate space for h5py/pyfive
470
+ chunk_coords = tuple (map (mul , chunk_coords , chunks ))
471
+ # retrieve coordinates from chunk index
472
+ storeinfo = ds ._index [chunk_coords ]
473
+ # extract what we need here.
474
+ offset , size = storeinfo .byte_offset , storeinfo .size
470
475
self .data_read += size
471
476
472
477
if self .storage_type == 's3' and self ._version == 1 :
473
478
474
479
tmp , count = reduce_opens3_chunk (ds .fh , offset , size , compressor , filters ,
475
480
self .missing , ds .dtype ,
476
- chunks , ds . order ,
481
+ chunks , ds_order ,
477
482
chunk_selection , method = self .method
478
483
)
479
484
@@ -500,7 +505,7 @@ def _process_chunk(self, session, ds, chunks, chunk_coords, chunk_selection, cou
500
505
size , compressor , filters ,
501
506
self .missing , np .dtype (ds .dtype ),
502
507
chunks ,
503
- ds .order ,
508
+ ds ._order ,
504
509
chunk_selection ,
505
510
operation = self ._method )
506
511
else :
@@ -519,7 +524,7 @@ def _process_chunk(self, session, ds, chunks, chunk_coords, chunk_selection, cou
519
524
size , compressor , filters ,
520
525
self .missing , np .dtype (ds .dtype ),
521
526
chunks ,
522
- ds .order ,
527
+ ds ._order ,
523
528
chunk_selection ,
524
529
operation = self ._method )
525
530
elif self .storage_type == 'ActivePosix' and self .version == 2 :
@@ -532,7 +537,7 @@ def _process_chunk(self, session, ds, chunks, chunk_coords, chunk_selection, cou
532
537
# although we will version changes.
533
538
tmp , count = reduce_chunk (self .filename , offset , size , compressor , filters ,
534
539
self .missing , ds .dtype ,
535
- chunks , ds .order ,
540
+ chunks , ds ._order ,
536
541
chunk_selection , method = self .method )
537
542
538
543
if self .method is not None :
0 commit comments