sgkit-dev / sgkit-plink

NOW ARCHIVED! PLINK IO implementations for sgkit. With https://github.com/pystatgen/sgkit/issues/65, now maintained and developed in the sgkit repo.
Apache License 2.0
0 stars 4 forks source link

Support fancy and scalar indexing #31

Open eric-czech opened 4 years ago

eric-czech commented 4 years ago

Much like https://github.com/pystatgen/sgkit-bgen/pull/15, this reader should break if you try to index with scalars (ds.call_genotype[0, 0]) or lists. More problematic is the fact that Dask will request slices as scalar indices if a variant/sample chunk only has one item. Adding fancy=False to from_array, converting int slicers to actual slices, and then squeezing off unit dimensions in the chunks read is enough to fix these problems.