Can't read panda hdf file
还没有人认领这个 Issue。
评估
调研方向
Start by reading HdfMap._store_dataset and its call path in hdfmap_class.py, especially the group lookup shown in the traceback. Reproduce the failure with the provided hdfmap.create_hdf_map(f_hdf) example and inspect how the root-level dataset path is handled. Done means the Panda HDF file loads without the KeyError; add or update a regression test for that case.
由索引模型根据 Issue 内容生成。
描述
Tried reading a h5 file from P51 written by BlueSky but got an error.
import hdfmap
f_nxs = "/dls/p51/data/2026/cm44254-4/3336.nxs"
f_hdf = "/dls/p51/data/2026/cm44254-4/p51-3336-panda1.h5"
m = hdfmap.create_hdf_map(f_hdf)
print(m)
Gives error
Traceback (most recent call last):
File "/scratch/grp66007/python/mmg_toolbox/examples/check_p51-3336-panda_file.py", line 15, in <module>
m = hdfmap.create_hdf_map(f_hdf)
File "/scratch/grp66007/python/mmg_toolbox/.venv/lib/python3.14/site-packages/hdfmap/file_functions.py", line 40, in create_hdf_map
hdf_map = HdfMap(hdf)
File "/scratch/grp66007/python/mmg_toolbox/.venv/lib/python3.14/site-packages/hdfmap/hdfmap_class.py", line 137, in __init__
self.populate(file)
~~~~~~~~~~~~~^^^^^^
File "/scratch/grp66007/python/mmg_toolbox/.venv/lib/python3.14/site-packages/hdfmap/hdfmap_class.py", line 451, in populate
self._populate(hdf_file)
~~~~~~~~~~~~~~^^^^^^^^^^
File "/scratch/grp66007/python/mmg_toolbox/.venv/lib/python3.14/site-packages/hdfmap/hdfmap_class.py", line 343, in _populate
self._store_dataset(obj, hdf_path, name, external_file)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/scratch/grp66007/python/mmg_toolbox/.venv/lib/python3.14/site-packages/hdfmap/hdfmap_class.py", line 275, in _store_dataset
group = self.groups[SEP.join(hdf_path.split(SEP)[:-1])] # group is already stored
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: ''
- 主要语言
- Python
- 星标
- 2
- 派生
- 0
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
DiamondLightSource/hdfmap 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 65/100
DiamondLightSource/hdfmap#66 · 1 条评论 ·
查看 DiamondLightSource/hdfmap 的全部 Issue
相似的 Issue
-
cli good first issue help wanted python up-for-grabs
难度 2/5 1-3 小时 新手友好度 75/100
andrewsiah/agentswarm-data-tasks#36 ·
维护者通常 1 天内回复
-
bug drawing-tools
难度 2/5 1-3 小时 新手友好度 76/100
cofade/open-garden-planner#827 ·
维护者通常 1 天内回复
-
Methodology page未关闭documentation site texts
难度 2/5 1-3 小时 新手友好度 67/100
Krasnopjorovs/temet#66 ·
-
bug
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复