Skip to content

Commit 8743fdd

Browse files
BUG: ensure directory exists when reweighting (#923)
* BUG: ensure directory exists when reweighting * BUG: change os.split to os.path.split --------- Co-authored-by: Aditya Vijaykumar <vijaykumar.aditya@gmail.com>
1 parent 65bcde3 commit 8743fdd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

bilby/core/result.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,9 @@ def get_weights_for_reweighting(
194194

195195
starting_index = np.argmin(np.abs(old_log_likelihood_array))
196196
logger.info(f'Checkpoint resuming from {starting_index}.')
197-
197+
elif resume_file is not None:
198+
basedir = os.path.split(resume_file)[0]
199+
check_directory_exists_and_if_not_mkdir(basedir)
198200
else:
199201
old_log_likelihood_array = np.zeros(nposterior)
200202
old_log_prior_array = np.zeros(nposterior)

0 commit comments

Comments
 (0)