Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h5py 3.1.0 breaks fancy indexing #147

Open
camiel-m opened this issue Jan 20, 2021 · 1 comment
Open

h5py 3.1.0 breaks fancy indexing #147

camiel-m opened this issue Jan 20, 2021 · 1 comment

Comments

@camiel-m
Copy link
Contributor

After updating to h5py 3.1.0 fancy indexing in loompy seems to be broken.
Downgrading to 2.10.0 solves the issue, alternatively a workaround is given in this thread where they suggest converting boolean arrays to indices.
This might be solved in later versions of h5py, but maybe it would be good to require h5py < 3.1.0 as an installation requirement for the time being.

Traceback (most recent call last):
  File "/home/camiel/cytograph-dev/cytograph/plotting/TF_heatmap.py", line 29, in TF_heatmap
    hm.plot(ds, dsagg, out_file=out_file)
  File "/home/camiel/cytograph-dev/cytograph/plotting/heatmap.py", line 31, in plot
    data = np.log(ds[layer][self.genes, :] + 1)
  File "/home/camiel/anaconda3/envs/chromo/lib/python3.7/site-packages/loompy/loom_layer.py", line 88, in __getitem__
    return self.ds._file['/matrix'].__getitem__(slice)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "/home/camiel/anaconda3/envs/chromo/lib/python3.7/site-packages/h5py/_hl/dataset.py", line 777, in __getitem__
    selection = sel.select(self.shape, args, dataset=self)
  File "/home/camiel/anaconda3/envs/chromo/lib/python3.7/site-packages/h5py/_hl/selections.py", line 82, in select
    return selector.make_selection(args)
  File "h5py/_selector.pyx", line 272, in h5py._selector.Selector.make_selection
  File "h5py/_selector.pyx", line 183, in h5py._selector.Selector.apply_args
TypeError: Indexing arrays must have integer dtypes
@winni2k
Copy link

winni2k commented Feb 23, 2021

I observe this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants