diff options
| author | Shivesh Mandalia <shivesh.mandalia@outlook.com> | 2020-02-28 22:38:40 +0000 |
|---|---|---|
| committer | Shivesh Mandalia <shivesh.mandalia@outlook.com> | 2020-02-28 22:38:40 +0000 |
| commit | 018cf806e2d852df164b0c795d4e3ffcd122dda0 (patch) | |
| tree | 08efc6310ae929d60d9c9881b40a0b337da8841d /golemflavor/mcmc.py | |
| parent | 4707f109e2bc35c6e6f6b737607323c0a5931e48 (diff) | |
| download | GolemFlavor-018cf806e2d852df164b0c795d4e3ffcd122dda0.tar.gz GolemFlavor-018cf806e2d852df164b0c795d4e3ffcd122dda0.zip | |
add brackets to all print statements
Diffstat (limited to 'golemflavor/mcmc.py')
| -rw-r--r-- | golemflavor/mcmc.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/golemflavor/mcmc.py b/golemflavor/mcmc.py index 606da2d..4cad6e7 100644 --- a/golemflavor/mcmc.py +++ b/golemflavor/mcmc.py @@ -26,26 +26,26 @@ def mcmc(p0, ln_prob, ndim, nwalkers, burnin, nsteps, args, threads=1): nwalkers, ndim, ln_prob, threads=threads ) - print "Running burn-in" + print("Running burn-in") for result in tqdm.tqdm(sampler.sample(p0, iterations=burnin), total=burnin): pos, prob, state = result sampler.reset() - print "Finished burn-in" + print("Finished burn-in") args.burnin = False - print "Running" + print("Running") for _ in tqdm.tqdm(sampler.sample(pos, iterations=nsteps), total=nsteps): pass - print "Finished" + print("Finished") samples = sampler.chain.reshape((-1, ndim)) - print 'acceptance fraction', sampler.acceptance_fraction - print 'sum of acceptance fraction', np.sum(sampler.acceptance_fraction) - print 'np.unique(samples[:,0]).shape', np.unique(samples[:,0]).shape + print('acceptance fraction', sampler.acceptance_fraction) + print('sum of acceptance fraction', np.sum(sampler.acceptance_fraction)) + print('np.unique(samples[:,0]).shape', np.unique(samples[:,0]).shape) try: - print 'autocorrelation', sampler.acor + print('autocorrelation', sampler.acor) except: - print 'WARNING : NEED TO RUN MORE SAMPLES' + print('WARNING : NEED TO RUN MORE SAMPLES') return samples @@ -115,6 +115,6 @@ def save_chains(chains, outfile): """ make_dir(outfile) - print 'Saving chains to location {0}'.format(outfile+'.npy') + print('Saving chains to location {0}'.format(outfile+'.npy')) np.save(outfile+'.npy', chains) |
