VDS datasets silently return None

Aperta
#275 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@bnlawrence ci sta già lavorando.

Dal 6/10/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
68/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start at pyfive.File dataset access and the indexing path used by d[:]; inspect how d.id.layout_class identifies the VDS layout. Reproduce the example with the two source files and vds.h5, then add a regression test confirming VDS indexing raises NotImplementedError or another clear unsupported-operation error instead of returning None.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Opening a dataset with virtual (VDS) layout works. shape and dtype are reported correctly, but indexing it returns None rather than data or an error. This leads on to confusing downstream errors rather than making clear that VDS files are not supported. We hit this while evaluating pyfive as a thread-safe read backend for pynbody. SWIFT cosmological simulations write a single-file "virtual" snapshot made of VDSs over their per-rank files, so every particle dataset in such a snapshot is affected.

We can probably work around this by detecting and handling VDS separately from regular hdf5 files, but it would be helpful if pyfive were to raise NotImplementedError or similar, rather than return None.

To reproduce:

import h5py
import numpy as np
import pyfive

for i in range(2):
    with h5py.File(f"src{i}.h5", "w") as f:
        f["x"] = np.arange(5) + 10 * i

layout = h5py.VirtualLayout(shape=(10,), dtype="i8")
for i in range(2):
    layout[5 * i : 5 * i + 5] = h5py.VirtualSource(f"src{i}.h5", "x", shape=(5,))
with h5py.File("vds.h5", "w") as f:
    f.create_virtual_dataset("x", layout)

with h5py.File("vds.h5") as f:
    print("h5py:  ", f["x"][:])

with pyfive.File("vds.h5") as f:
    d = f["x"]
    print("pyfive:", d.shape, d.dtype, d.id.layout_class)
    print("pyfive:", d[:])

Output:

h5py:   [ 0  1  2  3  4 10 11 12 13 14]
pyfive: (10,) int64 3
pyfive: None
Lingua principale
Python
Stelle
105
Fork
29
Merge medio
2g 8h
PR unite (30g)
9

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NCAS-CMS/pyfive

Tutte le issue di NCAS-CMS/pyfive

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.