From 891b067bebf4ed741e195e583c25c2ac739e5ef9 Mon Sep 17 00:00:00 2001 From: orioncohen Date: Wed, 10 Apr 2024 14:39:15 -0700 Subject: [PATCH] Check that dcd exists before loading. --- emmet-core/emmet/core/classical_md/openmm/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emmet-core/emmet/core/classical_md/openmm/tasks.py b/emmet-core/emmet/core/classical_md/openmm/tasks.py index 19903928d4..6a22934af6 100644 --- a/emmet-core/emmet/core/classical_md/openmm/tasks.py +++ b/emmet-core/emmet/core/classical_md/openmm/tasks.py @@ -172,7 +172,7 @@ def from_directory( traj_is_not_empty = traj_file.exists() and traj_file.stat().st_size > 0 traj_file_name = traj_file_name if traj_is_not_empty else None # type: ignore - if embed_traj: + if embed_traj and traj_is_not_empty: with open(traj_file, "rb") as f: traj_blob = f.read() else: