From a9b73997136b77603a3d9928e3d68e8b3f156bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinclert=20P=C3=A9rez?= Date: Fri, 15 Oct 2021 13:22:20 -0400 Subject: [PATCH 1/2] Refactor mg_dir variables to point to env. var. --- .../tutorial_particle_physics/2a_parton_level_analysis.ipynb | 5 +++-- .../2b_delphes_level_analysis.ipynb | 5 +++-- .../tutorial_particle_physics/4c_information_geometry.ipynb | 5 ----- .../A1_systematic_uncertainties.ipynb | 5 +++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/examples/tutorial_particle_physics/2a_parton_level_analysis.ipynb b/examples/tutorial_particle_physics/2a_parton_level_analysis.ipynb index ab4e3ac5f..bf5745ea5 100644 --- a/examples/tutorial_particle_physics/2a_parton_level_analysis.ipynb +++ b/examples/tutorial_particle_physics/2a_parton_level_analysis.ipynb @@ -36,6 +36,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "import logging\n", "import numpy as np\n", "\n", @@ -69,7 +70,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Please enter here the path to your MG5 root directory:" + "Please enter here the environment variable pointing to your MG5 installation folder." ] }, { @@ -78,7 +79,7 @@ "metadata": {}, "outputs": [], "source": [ - "mg_dir = \"/madminer/software/MG5_aMC_v2_9_4\"" + "mg_dir = os.getenv(\"MG_FOLDER_PATH\")" ] }, { diff --git a/examples/tutorial_particle_physics/2b_delphes_level_analysis.ipynb b/examples/tutorial_particle_physics/2b_delphes_level_analysis.ipynb index 073f9ad61..70229df7b 100644 --- a/examples/tutorial_particle_physics/2b_delphes_level_analysis.ipynb +++ b/examples/tutorial_particle_physics/2b_delphes_level_analysis.ipynb @@ -36,6 +36,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "import logging\n", "import numpy as np\n", "\n", @@ -68,7 +69,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Please enter here the path to your MG5 root directory. This notebook assumes that you installed Delphes and Pythia through MG5." + "Please enter here the environment variable pointing to your MG5 installation folder." ] }, { @@ -77,7 +78,7 @@ "metadata": {}, "outputs": [], "source": [ - "mg_dir = \"/madminer/software/MG5_amC_v2_9_4/\"" + "mg_dir = os.getenv(\"MG_FOLDER_PATH\")" ] }, { diff --git a/examples/tutorial_particle_physics/4c_information_geometry.ipynb b/examples/tutorial_particle_physics/4c_information_geometry.ipynb index 82382a365..f8d9ec534 100644 --- a/examples/tutorial_particle_physics/4c_information_geometry.ipynb +++ b/examples/tutorial_particle_physics/4c_information_geometry.ipynb @@ -22,11 +22,6 @@ "metadata": {}, "outputs": [], "source": [ - "import sys\n", - "\n", - "madminer_src_path = \"/madminer/software/MG5_aMC_v2_9_4/\"\n", - "sys.path.append(madminer_src_path)\n", - "\n", "import logging\n", "import numpy as np\n", "import matplotlib\n", diff --git a/examples/tutorial_particle_physics/A1_systematic_uncertainties.ipynb b/examples/tutorial_particle_physics/A1_systematic_uncertainties.ipynb index 199c6da97..491e535ec 100755 --- a/examples/tutorial_particle_physics/A1_systematic_uncertainties.ipynb +++ b/examples/tutorial_particle_physics/A1_systematic_uncertainties.ipynb @@ -36,6 +36,7 @@ "metadata": {}, "outputs": [], "source": [ + "import os\n", "import logging\n", "import numpy as np\n", "\n", @@ -53,7 +54,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Please enter here the path to your MG5 root directory." + "Please enter here the environment variable pointing to your MG5 installation folder." ] }, { @@ -62,7 +63,7 @@ "metadata": {}, "outputs": [], "source": [ - "mg_dir = \"/madminer/software/MG5_amC_v2_9_4/\"" + "mg_dir = os.getenv(\"MG_FOLDER_PATH\")" ] }, { From 3df19f03611c0748c7197c6f74c02717982fb855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sinclert=20P=C3=A9rez?= Date: Fri, 15 Oct 2021 13:23:37 -0400 Subject: [PATCH 2/2] Fix notebooks 4C typos --- .../tutorial_particle_physics/4c_information_geometry.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorial_particle_physics/4c_information_geometry.ipynb b/examples/tutorial_particle_physics/4c_information_geometry.ipynb index f8d9ec534..cfaa7fb4f 100644 --- a/examples/tutorial_particle_physics/4c_information_geometry.ipynb +++ b/examples/tutorial_particle_physics/4c_information_geometry.ipynb @@ -414,7 +414,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In the next step, we initialize the `InformationGeoemtry` class using this input data. Using the function `information_from_grid()`, the provided grid is interpolated using a piecewise linear function and the information can be calculated at every point. " + "In the next step, we initialize the `InformationGeometry` class using this input data. Using the function `information_from_grid()`, the provided grid is interpolated using a piecewise linear function and the information can be calculated at every point." ] }, {