Skip to content

Commit

Permalink
Merge pull request #1252 from pyiron/datacontainer_cleanup
Browse files Browse the repository at this point in the history
Simplify the datacontainer clean up during to_hdf()
  • Loading branch information
jan-janssen authored Dec 18, 2023
2 parents c46434e + 441b66a commit 2fdf726
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyiron_base/storage/datacontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,9 @@ def _to_hdf(self, hdf):
"Error saving {} (key {}): DataContainer doesn't support saving elements "
'of type "{}" to HDF!'.format(v, k, type(v))
) from None
for n in hdf.list_nodes():
for n in hdf.list_nodes() + hdf.list_groups():
if n not in written_keys:
del hdf[n]
for g in hdf.list_groups():
if g not in written_keys:
del hdf[g]

def _from_hdf(self, hdf, version=None):
self.clear()
Expand Down

0 comments on commit 2fdf726

Please sign in to comment.