diff options
| author | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-03-19 15:48:11 -0500 |
|---|---|---|
| committer | shivesh <s.p.mandalia@qmul.ac.uk> | 2018-03-19 15:48:11 -0500 |
| commit | 24ab29995d7aa30162d8d17fd2557bf28c5ea6e0 (patch) | |
| tree | f7b98f9c9d70da852428a47f9af07c85bcb08110 /utils/mcmc.py | |
| parent | 128470d9296a7c8d39aa8defa00f99f5ca5c36fd (diff) | |
| download | GolemFlavor-24ab29995d7aa30162d8d17fd2557bf28c5ea6e0.tar.gz GolemFlavor-24ab29995d7aa30162d8d17fd2557bf28c5ea6e0.zip | |
more refactoring
Diffstat (limited to 'utils/mcmc.py')
| -rw-r--r-- | utils/mcmc.py | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/utils/mcmc.py b/utils/mcmc.py index d91764f..aebe12f 100644 --- a/utils/mcmc.py +++ b/utils/mcmc.py @@ -9,9 +9,6 @@ Useful functions to use an MCMC for the BSM flavour ratio analysis from __future__ import absolute_import, division -import os -import errno - import argparse from functools import partial @@ -23,7 +20,7 @@ from scipy.stats import multivariate_normal from utils import fr as fr_utils from utils.enums import Likelihood -from utils.misc import enum_keys, enum_parse, parse_bool +from utils.misc import enum_keys, enum_parse, make_dir, parse_bool def lnprior(theta, paramset): @@ -115,13 +112,7 @@ def save_chains(chains, outfile): Output file location of chains """ - try: - os.makedirs(outfile[:-len(os.path.basename(outfile))]) - except OSError as exc: # Python >2.5 - if exc.errno == errno.EEXIST and os.path.isdir(outfile[:-len(os.path.basename(outfile))]): - pass - else: - raise + make_dir(outfile) print 'Saving chains to location {0}'.format(outfile+'.npy') np.save(outfile+'.npy', chains) |
