diff --git a/bilby/core/sampler/ptemcee.py b/bilby/core/sampler/ptemcee.py index da13250a48b46a2fc45dffa375bfb8594a924c8f..1ee756c4084ffff4209897e9c95d94ebdecdaf21 100644 --- a/bilby/core/sampler/ptemcee.py +++ b/bilby/core/sampler/ptemcee.py @@ -13,7 +13,7 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt -from ..utils import logger +from ..utils import logger, check_directory_exists_and_if_not_mkdir from .base_sampler import SamplerError, MCMCSampler @@ -517,6 +517,7 @@ class Ptemcee(MCMCSampler): sys.exit(self.exit_code) def write_current_state(self, plot=True): + check_directory_exists_and_if_not_mkdir(self.outdir) checkpoint( self.iteration, self.outdir,