Skip to content

Commit

Permalink
Code update
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 690821682
  • Loading branch information
zhong1wan authored and The swirl_dynamics Authors committed Oct 29, 2024
1 parent b07ffdc commit 49ded0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions swirl_dynamics/data/hdf5_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,10 @@ def save_array_dict(save_path: epath.PathLike, data: Mapping[str, Any]) -> None:
with h5py.File(bio, "w") as f:
_save_array_dict(f, data)

# Creates parent directory if it does not exist.
save_dir = epath.Path(save_path).parent
if not filesys.exists(save_dir):
filesys.makedirs(save_dir)

with filesys.gfile.GFile(save_path, "w") as f:
f.write(bio.getvalue())

0 comments on commit 49ded0f

Please sign in to comment.