TRIQS / h5

A high-level C++ interface to the hdf5 library
https://triqs.github.io/h5
Other
3 stars 7 forks source link

deleting a h5 group not possible #14

Open the-hampel opened 1 year ago

the-hampel commented 1 year ago

Deleting a h5 group with the triqs h5 python layer is not possible. Consider as a simple example the following standard dft_tools archive with the top layer content:

HDFArchive (partial view) with the following content:
  dft_input : subgroup
  dft_misc_input : subgroup
  dft_symmcorr_input : subgroup

running:

with HDFArchive('svo.h5','a') as ar:
    del ar['dft_misc_input']

is not deleting the group. The output still looks the same. However, with h5py this is possible:

import h5py
with h5py.File('svo.h5',  'a') as ar:
    del ar['dft_misc_input']

removes the group from the archive:

HDFArchive (partial view) with the following content:
  dft_input : subgroup
  dft_symmcorr_input : subgroup

I also noticed that the example given in the docstring of the h5 main class do not work: https://github.com/TRIQS/h5/blob/d9af4b5b5de4c1e431bcafc55b29ef914937dc76/python/h5/archive.py#L339

the test was done on the 1.1.x branch, but the unstable branch shows the same behavior.