You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "/Users/igorzolin/Library/Application Support/JetBrains/PyCharm2023.3/scratches/check_ts.py", line 33, in <module>
layout[n - 1, [1,2,3,4]] = vsource
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/h5py/_hl/vds.py", line 180, in __setitem__
self.dcpl.set_virtual(
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 "h5py/h5p.pyx", line 902, in h5py.h5p.PropDCID.set_virtual
ValueError: Invalid mapping selections (point selections not currently supported with virtual datasets)
If I try initiate like this vsource = CustomVirtualSource(f['data'], mask=[1,2,3,4]) I get <h5py._hl.selections.FancySelection object at 0x1148bc310> and everything works fine:
When I try something like this vsource = CustomVirtualSource(f['data'], mask=[2,3,4]) and layout[n - 1, [1,2,3]] = vsource
I get
Traceback (most recent call last):
File "/Users/igorzolin/Library/Application Support/JetBrains/PyCharm2023.3/scratches/check_ts.py", line 33, in <module>
vsource = CustomVirtualSource(f['data'], mask=[2,3,4])
File "/Users/igorzolin/Library/Application Support/JetBrains/PyCharm2023.3/scratches/check_ts.py", line 17, in __init__
self.sel = h5py._hl.selections.select(slice_shape, arr)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/h5py/_hl/selections.py", line 82, in select
return selector.make_selection(args)
File "h5py/_selector.pyx", line 282, in h5py._selector.Selector.make_selection
File "h5py/_selector.pyx", line 212, in h5py._selector.Selector.apply_args
IndexError: Fancy indexing out of range for (0-2)
But this vsource = CustomVirtualSource(f['data'], mask=[0,2,3]) is working
Update:
I found a way that I can get slice like this and it is working perfect vsource = h5py.VirtualSource(f['data'])[:2] but still want to be able to filter more specific
Fancy indexing is expressed to HDF5 as selecting multiple hyperslabs in one dataspace. I guess it allows that for virtual dataset mappings, though I don't know how efficient it will be at looking these up if you have a lot of such selections. I think it should be possible to do fancy indexing with VirtualSource objects directly, no need to create your own class.
It looks like not all your examples are with exactly the code you show (parameter mask vs. slice), so it's hard to say exactly what's going on.
Hello, trying to make custom VirtualSource to filter data with boolean mask.
I get this error and I understand why:
If I try initiate like this
vsource = CustomVirtualSource(f['data'], mask=[1,2,3,4])
I get<h5py._hl.selections.FancySelection object at 0x1148bc310>
and everything works fine:When I try something like this
vsource = CustomVirtualSource(f['data'], mask=[2,3,4])
andlayout[n - 1, [1,2,3]] = vsource
I get
But this
vsource = CustomVirtualSource(f['data'], mask=[0,2,3])
is workingThe main question is can I somehow make mask for only points I need? And also if Fancy indexing works as expected why so?
The text was updated successfully, but these errors were encountered: