Migrate notebook A3 to Python3
"cell_type": "markdown",
"metadata": {},
"source": [
- "# MadMiner particle physics tutorial\n",
- "\n",
- "# Appendix 3: reweighting existing MC samples\n",
+ "# Appendix 3: reweighting existing samples\n",
"\n",
"Johann Brehmer, Felix Kling, Irina Espejo, and Kyle Cranmer 2018-2019"
]
"metadata": {},
"outputs": [],
"source": [
- "from __future__ import absolute_import, division, print_function, unicode_literals\n",
- "\n",
"import logging\n",
"import numpy as np\n",
"import matplotlib\n",
"from matplotlib import pyplot as plt\n",
+ "\n",
"%matplotlib inline\n",
"\n",
- "from madminer.core import MadMiner\n"
+ "from madminer.core import MadMiner"
]
},
{
"source": [
"# MadMiner output\n",
"logging.basicConfig(\n",
- " format='%(asctime)-5.5s %(name)-20.20s %(levelname)-7.7s %(message)s',\n",
- " datefmt='%H:%M',\n",
- " level=logging.INFO\n",
+ " format=\"%(asctime)-5.5s %(name)-20.20s %(levelname)-7.7s %(message)s\",\n",
+ " datefmt=\"%H:%M\",\n",
+ " level=logging.INFO,\n",
")\n",
"\n",
"# Output of all other modules (e.g. matplotlib)\n",
"source": [
"miner = MadMiner()\n",
"miner.load(\"data/setup.h5\")\n",
- "miner.add_benchmark({'CWL2':10., 'CPWL2':8.}, 'oh_shit_we_forgot_this')\n",
- "miner.save('data/setup_with_extra_benchmark.h5')\n"
+ "miner.add_benchmark({\"CWL2\": 10.0, \"CPWL2\": 8.0}, \"oh_shit_we_forgot_this\")\n",
+ "miner.save(\"data/setup_with_extra_benchmark.h5\")"
]
},
{
" reweight_benchmarks=[\"oh_shit_we_forgot_this\"],\n",
")"
]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
}
],
"metadata": {
"kernelspec": {
- "display_name": "Python (higgs_inference)",
+ "display_name": "Python 3 (Higgs inference)",
"language": "python",
- "name": "higgs_inference"
+ "name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.6.7"
+ "version": "3.8.2"
}
},
"nbformat": 4,
