Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDF interface: fix read_dict_from_hdf() #1267

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions pyiron_base/storage/helper_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,20 @@ def resolve_nested_dict(group_path, data_dict):
with open_hdf5(file_name, mode="r") as store:
output_dict = get_dict_from_nodes(store=store, h5_path=h5_path, slash=slash)
for group_path in group_paths:
output_dict.update(
resolve_nested_dict(
group_path=group_path,
data_dict=get_dict_from_nodes(
store=store,
h5_path=get_h5_path(h5_path=h5_path, name=group_path),
slash=slash,
),
)
read_dict = resolve_nested_dict(
group_path=group_path,
data_dict=get_dict_from_nodes(
store=store,
h5_path=get_h5_path(h5_path=h5_path, name=group_path),
slash=slash,
),
)
for k, v in read_dict.items():
if k in output_dict.keys() and isinstance(v, dict):
for sk, vs in v.items():
output_dict[k][sk] = vs
else:
output_dict[k] = v
return output_dict


Expand Down
Loading