Skip to content
Snippets Groups Projects

Catch error if trying to load zero bytes resume file

1 file
+ 5
1
Compare changes
  • Side-by-side
  • Inline
@@ -415,7 +415,11 @@ class Ptemcee(MCMCSampler):
# This is a very ugly hack to support numpy>=1.24
ptemcee.sampler.np.float = float
if os.path.isfile(self.resume_file) and self.resume is True:
if (
os.path.isfile(self.resume_file) and
os.path.getsize(self.resume_file) and
self.resume is True
):
import dill
logger.info(f"Resume data {self.resume_file} found")
Loading