From 7b32b3e2c437f65f6ac946d16463691e7496be29 Mon Sep 17 00:00:00 2001 From: Shivesh Mandalia Date: Sat, 29 Feb 2020 01:22:24 +0000 Subject: Minor fixes --- README.md | 3 ++- golemflavor/fr.py | 5 +++++ golemflavor/misc.py | 5 ----- golemflavor/plot.py | 5 +++-- scripts/contour.py | 2 +- setup.py | 2 +- 6 files changed, 12 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 08d2ce3..e93d223 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # GolemFlavor [![Build Status](https://api.travis-ci.org/ShiveshM/GolemFlavor.svg?branch=master)](https://travis-ci.org/ShiveshM/GolemFlavor) +![Python 2.7](https://img.shields.io/badge/python-2.7-blue.svg) [![license](https://img.shields.io/github/license/ShiveshM/GolemFlavor 'license')](https://github.com/ShiveshM/GolemFlavor/blob/master/LICENSE) GolemFlavor is a Python package for running an analysis pipeline using @@ -11,7 +12,7 @@ GolemFlavor is a Python package for running an analysis pipeline using ## Installation GolemFlavor can be installed using `pip` ``` -pip install git+https://github.com/ShiveshM/flavour_ratio.git +pip install git+https://github.com/ShiveshM/GolemFlavor.git ``` This installs GolemFlavor, along with all the necessary dependencies such as NumPy and SciPy. diff --git a/golemflavor/fr.py b/golemflavor/fr.py index 6692609..9171972 100644 --- a/golemflavor/fr.py +++ b/golemflavor/fr.py @@ -162,6 +162,11 @@ def angles_to_u(bsm_angles): return u +def flat_angles_to_u(x): + """Convert from angles to mixing elements.""" + return abs(angles_to_u(x)).astype(np.float32).flatten().tolist() + + def cardano_eqn(ham): """Diagonalise the effective Hamiltonian 3x3 matrix into the form h_{eff} = UE_{eff}U^{dagger} using the procedure in PRD91, 052003 (2015). diff --git a/golemflavor/misc.py b/golemflavor/misc.py index d83bb99..57fe6f7 100644 --- a/golemflavor/misc.py +++ b/golemflavor/misc.py @@ -212,11 +212,6 @@ def interval(arr, percentile=68.): return sarr[curr_low], center, sarr[curr_up] -def flat_angles_to_u(x): - """Convert from angles to mixing elements.""" - return abs(angles_to_u(x)).astype(np.float32).flatten().tolist() - - def myround(x, base=2, up=False, down=False): if up == down and up is True: assert 0 if up: return int(base * np.round(float(x)/base-0.5)) diff --git a/golemflavor/plot.py b/golemflavor/plot.py index caaed47..110032f 100644 --- a/golemflavor/plot.py +++ b/golemflavor/plot.py @@ -48,7 +48,8 @@ from scipy.spatial import Delaunay from golemflavor.enums import DataType, str_enum from golemflavor.enums import Likelihood, ParamTag, StatCateg, Texture from golemflavor.misc import get_units, make_dir, solve_ratio, interval -from golemflavor.fr import angles_to_u, angles_to_fr, SCALE_BOUNDARIES +from golemflavor.fr import angles_to_u, flat_angles_to_u, angles_to_fr +from golemflavor.fr import SCALE_BOUNDARIES BAYES_K = 1. # Strong degree of belief. @@ -528,7 +529,7 @@ def chainer_plot(infile, outfile, outformat, args, llh_paramset, fig_text=None, trns_ranges = np.array(ranges)[nu_index,].tolist() trns_axes_labels = np.array(axes_labels)[nu_index,].tolist() - if args.fix_mixing is not MixingScenario.NONE: + if args.fix_mixing is not Texture.NONE: trns_axes_labels += \ [r'\mid \tilde{U}_{e1} \mid' , r'\mid \tilde{U}_{e2} \mid' , r'\mid \tilde{U}_{e3} \mid' , \ r'\mid \tilde{U}_{\mu1} \mid' , r'\mid \tilde{U}_{\mu2} \mid' , r'\mid \tilde{U}_{\mu3} \mid' , \ diff --git a/scripts/contour.py b/scripts/contour.py index cbb6c87..60b117f 100644 --- a/scripts/contour.py +++ b/scripts/contour.py @@ -146,7 +146,7 @@ def gen_figtext(args): elif args.data in [DataType.ASIMOV, DataType.REALISATION]: t += r'{\rm\bf IceCube\:Simulation}' + '$\n$' t += r'\rm{Injected\:composition}'+r'\:=\:({0})_\oplus'.format( - solve_ratio(args.injected_ratio).replace('_', ':') + misc_utils.solve_ratio(args.injected_ratio).replace('_', ':') ) + '$' return t diff --git a/setup.py b/setup.py index f8ed6a3..1492e4a 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ NAME = 'GolemFlavor' DESCRIPTION = 'GolemFlavor: A Python package for Astrophysical Flavor analysis with GolemFit' MAINTAINER = 'Shivesh Mandalia' MAINTAINER_EMAIL = 's.p.mandalia@qmul.ac.uk' -URL = 'https://github.com/ShiveshM/flavour_ratio' +URL = 'https://github.com/ShiveshM/GolemFlavor' LICENSE = 'MIT' here = os.path.abspath(os.path.dirname(__file__)) -- cgit v1.2.3