G-Node / nix

Neuroscience information exchange format
https://readthedocs.org/projects/nixio/
Other
66 stars 36 forks source link

H5Group::objectName does not use creation order index #617

Closed achilleas-k closed 8 years ago

achilleas-k commented 8 years ago

Link creation order is tracked both at the file level and at the group level. This was introduced in PR #390 after a discussion in issue #387. However, when accessing groups by their index, using H5Lget_name_by_idx, the default index type and order is used, H5_INDEX_NAME and H5_ITER_NATIVE respectively (see H5Group.cpp).

This is an incomplete solution and appears to retrieve groups in creation order only when the number of child groups is less than 8 (I am unsure why this is). For N > 8, the indexed retrieval order appears arbitrary (yet stable).

To make retrieval and iteration follow creation order, the index type and order in H5Lget_name_by_idx should be H5_INDEX_CRT_ORDER and H5_ITER_INC respectively.