From 244161691fdfec430a62c90ed60abcf8ace3911b Mon Sep 17 00:00:00 2001 From: David Straub Date: Wed, 10 Jan 2018 10:13:34 +0100 Subject: [PATCH] Small fixes after YETI --- 1 Installation.ipynb | 24 ++++++++--------- 2 Basic concepts.ipynb | 51 +++++++++++++++++-------------------- 3 Wilson coefficients.ipynb | 14 +--------- 4 Fits.ipynb | 18 ++++++++----- 5 Extending.ipynb | 2 +- requirements.txt | 2 ++ 6 files changed, 51 insertions(+), 60 deletions(-) diff --git a/1 Installation.ipynb b/1 Installation.ipynb index 3cc8cd9..31c94e7 100644 --- a/1 Installation.ipynb +++ b/1 Installation.ipynb @@ -365,6 +365,17 @@ "Unit tests play an important role in making the code as reliable as possible and making development easier " ] }, + { + "cell_type": "markdown", + "metadata": { + "slideshow": { + "slide_type": "subslide" + } + }, + "source": [ + "(If the `nosetests` command doesn't work on your system, try running `python3 -m nose flavio` instead)" + ] + }, { "cell_type": "markdown", "metadata": { @@ -376,7 +387,7 @@ "### Installing Jupyter & IPython\n", "\n", "```bash\n", - "pip3 install jupyter --user\n", + "pip3 install ipython jupyter --user\n", "```\n", "\n", "... and the run it:\n", @@ -421,17 +432,6 @@ "4. [Fits](4 Fits.ipynb) (statistical inference)\n", "5. [Extending flavio](5 Extending.ipynb) (adding new observables)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "slideshow": { - "slide_type": "slide" - } - }, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/2 Basic concepts.ipynb b/2 Basic concepts.ipynb index 212f9ec..4864b6d 100644 --- a/2 Basic concepts.ipynb +++ b/2 Basic concepts.ipynb @@ -380,8 +380,9 @@ "metadata": {}, "outputs": [], "source": [ - "%time flavio.sm_uncertainty('(B0->K*mumu)',\n", - " q2min=1, q2max=6, N=100)" + "%%time\n", + "flavio.sm_uncertainty('(B0->K*mumu)',\n", + " q2min=1, q2max=6, N=100)" ] }, { @@ -390,8 +391,9 @@ "metadata": {}, "outputs": [], "source": [ - "%time flavio.sm_uncertainty('(B0->K*mumu)',\n", - " q2min=1, q2max=6, N=100, threads=2)" + "%%time\n", + "flavio.sm_uncertainty('(B0->K*mumu)',\n", + " q2min=1, q2max=6, N=100, threads=2)" ] }, { @@ -421,11 +423,24 @@ "cell_type": "markdown", "metadata": { "slideshow": { - "slide_type": "fragment" + "slide_type": "subslide" } }, "source": [ - "This can now be visualized:" + "This can now be visualized.\n", + "\n", + "Necessary imports:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "import flavio.plots as fpl\n", + "%matplotlib inline\n", + "%config InlineBackend.figure_format = 'svg'" ] }, { @@ -524,36 +539,18 @@ "### Things to do with measurements: e.g. plots" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Necessary imports" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import flavio.plots as fpl\n", - "import matplotlib.pyplot as plt\n", - "%matplotlib inline\n", - "%config InlineBackend.figure_format = 'svg'" - ] - }, { "cell_type": "code", "execution_count": null, "metadata": { - "scrolled": true, + "scrolled": false, "slideshow": { - "slide_type": "subslide" + "slide_type": "" } }, "outputs": [], "source": [ + "import matplotlib.pyplot as plt\n", "obs = '(B0->K*mumu)';\n", "fpl.bin_plot_exp(obs, col_dict={'LHCb': 'C0', 'CMS': 'C1', 'ATLAS': 'C2'});\n", "plt.legend()\n", diff --git a/3 Wilson coefficients.ipynb b/3 Wilson coefficients.ipynb index c4991aa..d7c2dce 100644 --- a/3 Wilson coefficients.ipynb +++ b/3 Wilson coefficients.ipynb @@ -404,7 +404,7 @@ }, "outputs": [], "source": [ - "! cat 'SPheno.spc.MSSM'" + "! cat 'files/SPheno.spc.MSSM'" ] }, { @@ -495,18 +495,6 @@ "source": [ "Next: [Fits](4 Fits.ipynb)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "scrolled": true, - "slideshow": { - "slide_type": "slide" - } - }, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/4 Fits.ipynb b/4 Fits.ipynb index 65a7221..db12a7d 100644 --- a/4 Fits.ipynb +++ b/4 Fits.ipynb @@ -804,6 +804,17 @@ "Plotting the result" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "fpl.density_contour_joint(scan.result[:, -2], scan.result[:, -1]);\n", + "plt.xlim([-0.07, 0.07]);\n", + "plt.ylim([-2, 2]);" + ] + }, { "cell_type": "markdown", "metadata": { @@ -900,13 +911,6 @@ "source": [ "Next: [Extending flavio](5 Extending.ipynb)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { diff --git a/5 Extending.ipynb b/5 Extending.ipynb index 2d7b27f..d04eb0b 100644 --- a/5 Extending.ipynb +++ b/5 Extending.ipynb @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": null, "metadata": { "slideshow": { "slide_type": "" diff --git a/requirements.txt b/requirements.txt index cd3023c..53ff708 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,5 @@ flavio==0.27 matplotlib>=2.1 nose RISE +emcee +iminuit