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 /scripts | |
| parent | 4707f109e2bc35c6e6f6b737607323c0a5931e48 (diff) | |
| download | GolemFlavor-018cf806e2d852df164b0c795d4e3ffcd122dda0.tar.gz GolemFlavor-018cf806e2d852df164b0c795d4e3ffcd122dda0.zip | |
add brackets to all print statements
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/contour.py | 8 | ||||
| -rw-r--r-- | scripts/fr.py | 8 | ||||
| -rw-r--r-- | scripts/mc_texture.py | 8 | ||||
| -rw-r--r-- | scripts/mc_unitary.py | 8 | ||||
| -rw-r--r-- | scripts/mc_x.py | 8 | ||||
| -rw-r--r-- | scripts/plot_sens.py | 24 | ||||
| -rw-r--r-- | scripts/sens.py | 22 |
7 files changed, 43 insertions, 43 deletions
diff --git a/scripts/contour.py b/scripts/contour.py index 6f08617..cbb6c87 100644 --- a/scripts/contour.py +++ b/scripts/contour.py @@ -194,10 +194,10 @@ def main(): prefix = '' outfile = args.datadir + '/contour' + prefix + gen_identifier(args) - print '== {0:<25} = {1}'.format('outfile', outfile) + print('== {0:<25} = {1}'.format('outfile', outfile)) - print 'asimov_paramset', asimov_paramset - print 'hypo_paramset', hypo_paramset + print('asimov_paramset', asimov_paramset) + print('hypo_paramset', hypo_paramset) if args.run_mcmc: gf_utils.setup_fitter(args, asimov_paramset) @@ -250,7 +250,7 @@ def main(): labels = labels ) - print "DONE!" + print("DONE!") main.__doc__ = __doc__ diff --git a/scripts/fr.py b/scripts/fr.py index e32d7d0..25cc1f8 100644 --- a/scripts/fr.py +++ b/scripts/fr.py @@ -171,13 +171,13 @@ def main(): outfile = args.datadir + '/{0}/{1}/chains_'.format( *map(misc_utils.parse_enum, [args.stat_method, args.data]) ) + misc_utils.gen_identifier(args) - print '== {0:<25} = {1}'.format('outfile', outfile) + print('== {0:<25} = {1}'.format('outfile', outfile)) if args.run_mcmc: gf_utils.setup_fitter(args, asimov_paramset) - print 'asimov_paramset', asimov_paramset - print 'llh_paramset', llh_paramset + print('asimov_paramset', asimov_paramset) + print('llh_paramset', llh_paramset) ln_prob = partial( llh_utils.ln_prob, @@ -240,7 +240,7 @@ def main(): labels = labels, ranges = ranges ) - print "DONE!" + print("DONE!") main.__doc__ = __doc__ diff --git a/scripts/mc_texture.py b/scripts/mc_texture.py index 2813dc0..9e3f0eb 100644 --- a/scripts/mc_texture.py +++ b/scripts/mc_texture.py @@ -182,10 +182,10 @@ def main(): prefix = '' outfile = args.datadir + '/mc_texture' + prefix + gen_identifier(args) - print '== {0:<25} = {1}'.format('outfile', outfile) + print('== {0:<25} = {1}'.format('outfile', outfile)) - print 'asimov_paramset', asimov_paramset - print 'llh_paramset', llh_paramset + print('asimov_paramset', asimov_paramset) + print('llh_paramset', llh_paramset) if args.run_mcmc: ln_prob_eval = partial( @@ -223,7 +223,7 @@ def main(): frs_scale = np.vstack((frs.T, samples[:-1].T)).T mcmc_utils.save_chains(frs_scale, outfile) - print "DONE!" + print("DONE!") main.__doc__ = __doc__ diff --git a/scripts/mc_unitary.py b/scripts/mc_unitary.py index bbd5a28..0f0e8f4 100644 --- a/scripts/mc_unitary.py +++ b/scripts/mc_unitary.py @@ -155,10 +155,10 @@ def main(): prefix = '' outfile = args.datadir + '/mc_unitary' + prefix + gen_identifier(args) - print '== {0:<25} = {1}'.format('outfile', outfile) + print('== {0:<25} = {1}'.format('outfile', outfile)) - print 'asimov_paramset', asimov_paramset - print 'hypo_paramset', hypo_paramset + print('asimov_paramset', asimov_paramset) + print('hypo_paramset', hypo_paramset) if args.run_mcmc: ln_prob_eval = partial( @@ -193,7 +193,7 @@ def main(): ) mcmc_utils.save_chains(frs, outfile) - print "DONE!" + print("DONE!") main.__doc__ = __doc__ diff --git a/scripts/mc_x.py b/scripts/mc_x.py index 04319c4..875c40b 100644 --- a/scripts/mc_x.py +++ b/scripts/mc_x.py @@ -151,10 +151,10 @@ def main(): prefix = '' outfile = args.datadir + '/mc_x' + prefix - print '== {0:<25} = {1}'.format('outfile', outfile) + print('== {0:<25} = {1}'.format('outfile', outfile)) - print 'asimov_paramset', asimov_paramset - print 'hypo_paramset', hypo_paramset + print('asimov_paramset', asimov_paramset) + print('hypo_paramset', hypo_paramset) if args.run_mcmc: ln_prob_eval = partial( @@ -192,7 +192,7 @@ def main(): ) mcmc_utils.save_chains(frs, outfile) - print "DONE!" + print("DONE!") main.__doc__ = __doc__ diff --git a/scripts/plot_sens.py b/scripts/plot_sens.py index 18e0c03..2c827ca 100644 --- a/scripts/plot_sens.py +++ b/scripts/plot_sens.py @@ -82,7 +82,7 @@ def process_args(args): skip = False for a in anon: if (a[1] > x) & (x > a[0]): - print 'Skipping src', x + print('Skipping src', x) skip = True break if skip: continue @@ -171,7 +171,7 @@ def main(): # Initialise data structure. statistic_arr = np.full((dims, srcs, texs, args.segments, 2), np.nan) - print 'Loading data' + print('Loading data') argsc = deepcopy(args) for idim, dim in enumerate(args.dimensions): argsc.dimension = dim @@ -194,7 +194,7 @@ def main(): *map(parse_enum, [args.stat_method, args.data]) ) + r'{0}/fr_stat'.format(prefix) + gen_identifier(argsc) - print '== {0:<25} = {1}'.format('base_infile', base_infile) + print('== {0:<25} = {1}'.format('base_infile', base_infile)) if args.split_jobs: for idx_sc, scale in enumerate(eval_scales): @@ -202,31 +202,31 @@ def main(): np.power(10, scale) ) try: - print 'Loading from {0}'.format(infile+'.npy') + print('Loading from {0}'.format(infile+'.npy')) statistic_arr[idim][isrc][itex][idx_sc] = \ np.load(infile+'.npy')[0] except: - print 'Unable to load file {0}'.format( + print('Unable to load file {0}'.format( infile+'.npy' - ) + )) # raise continue else: - print 'Loading from {0}'.format(base_infile+'.npy') + print('Loading from {0}'.format(base_infile+'.npy')) try: statistic_arr[idim][isrc][itex] = \ np.load(base_infile+'.npy') except: - print 'Unable to load file {0}'.format( + print('Unable to load file {0}'.format( base_infile+'.npy' - ) + )) continue data = ma.masked_invalid(statistic_arr) - print 'data', data + print('data', data) if args.plot_statistic: - print 'Plotting statistic' + print('Plotting statistic') for idim, dim in enumerate(args.dimensions): argsc.dimension = dim @@ -268,7 +268,7 @@ def main(): argsc = deepcopy(args) if args.plot_x: for idim, dim in enumerate(args.dimensions): - print '|||| DIM = {0}'.format(dim) + print('|||| DIM = {0}'.format(dim)) argsc.dimension = dim plot_utils.plot_x( data = data[idim], diff --git a/scripts/sens.py b/scripts/sens.py index 6368159..5198016 100644 --- a/scripts/sens.py +++ b/scripts/sens.py @@ -209,8 +209,8 @@ def main(): ) + misc_utils.gen_identifier(args) if not args.overwrite and os.path.isfile(outfile+'.npy'): - print 'FILE EXISTS {0}'.format(outfile+'.npy') - print 'Exiting...' + print('FILE EXISTS {0}'.format(outfile+'.npy')) + print('Exiting...') return # Setup Golemfit. @@ -225,16 +225,16 @@ def main(): if idx_sc == args.eval_segment: outfile += '_scale_{0:.0E}'.format(np.power(10, scale)) else: continue - print '|||| SCALE = {0:.0E}'.format(np.power(10, scale)) + print('|||| SCALE = {0:.0E}'.format(np.power(10, scale))) if not args.overwrite and os.path.isfile(outfile+'.npy'): - print 'FILE EXISTS {0}'.format(outfile+'.npy') + print('FILE EXISTS {0}'.format(outfile+'.npy')) t = np.load(outfile+'.npy') if np.any(~np.isfinite(t)): - print 'nan found, rerunning...' + print('nan found, rerunning...') pass else: - print 'Exiting...' + print('Exiting...') return # Lower scale boundary for first (NULL) point and set the scale param. @@ -262,9 +262,9 @@ def main(): prefix = prefix ) except: - print 'Failed run' + print('Failed run') raise - print '## Evidence = {0}'.format(stat) + print('## Evidence = {0}'.format(stat)) if args.eval_segment is not None: stat_arr[0] = np.array([scale, stat]) @@ -278,14 +278,14 @@ def main(): if args.run_mn and not args.debug: try: for f in glob.glob(prefix + '*'): - print 'cleaning file {0}'.format(f) + print('cleaning file {0}'.format(f)) os.remove(f) except: - print 'got error trying to cleanup, continuing' + print('got error trying to cleanup, continuing') pass misc_utils.make_dir(outfile) - print 'Saving to {0}'.format(outfile+'.npy') + print('Saving to {0}'.format(outfile+'.npy')) np.save(outfile+'.npy', stat_arr) |
