Skip to content

Commit

Permalink
Update the resume file check to see if the file is empty (#890)
Browse files Browse the repository at this point in the history
  • Loading branch information
GregoryAshton authored Jan 10, 2025
1 parent 82bdf36 commit 36470d5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bilby/core/sampler/dynesty.py
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,9 @@ def read_saved_state(self, continuing=False):
from ... import __version__ as bilby_version

versions = dict(bilby=bilby_version, dynesty=dynesty_version)
if os.path.isfile(self.resume_file):

# Check if the file exists and is not empty (empty resume files are created for HTCondor file transfer)
if os.path.isfile(self.resume_file) and os.stat(self.resume_file).st_size > 0:
logger.info(f"Reading resume file {self.resume_file}")
with open(self.resume_file, "rb") as file:
try:
Expand Down

0 comments on commit 36470d5

Please sign in to comment.