Skip to content

Commit

Permalink
Save version info with Solution (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
loganbvh authored Feb 6, 2024
1 parent 0a2e0be commit 4926f81
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tdgl/solution/solution.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,7 @@ def serialize_func(func, name, h5group):
save_context = nullcontext(h5file)

with save_context as f:
f.require_group("version_info").attrs.update(self.version_info)
if "mesh" in f:
del f["mesh"]
data_grp = f.require_group("data")
Expand Down Expand Up @@ -974,9 +975,7 @@ def deserialize_func(name, h5group):

with h5py.File(path, "r") as f:
grp = f["solution"]
options_kwargs = dict()
for k, v in grp["options"].attrs.items():
options_kwargs[k] = v
options_kwargs = dict(grp["options"].attrs)
options = SolverOptions(**options_kwargs)
options.validate()
time_created = datetime.fromisoformat(grp.attrs["time_created"])
Expand Down

0 comments on commit 4926f81

Please sign in to comment.