Skip to content

Commit

Permalink
halfway of comments improvment
Browse files Browse the repository at this point in the history
  • Loading branch information
shenvitor committed Aug 21, 2024
1 parent 122370c commit 9c2d83e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
52 changes: 14 additions & 38 deletions docs/eta-pi-p/manual.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,9 @@
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import sympy as sp\n",
"from ampform.io import aslatex\n",
"from ampform.kinematics.angles import (\n",
" Phi,\n",
" Theta,\n",
")\n",
"from ampform.kinematics.angles import Phi, Theta\n",
"from ampform.kinematics.lorentz import (\n",
" ArrayMultiplication,\n",
" ArraySize,\n",
Expand Down Expand Up @@ -299,11 +295,7 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"jupyter": {
"source_hidden": true
}
},
"metadata": {},
"outputs": [],
"source": [
"p1 = FourMomentumSymbol(\"p1\", shape=[])\n",
Expand All @@ -329,13 +321,13 @@
"Bz23 = BoostZMatrix(beta23, n_events=ArraySize(beta23))\n",
"Bz31 = BoostZMatrix(beta31, n_events=ArraySize(beta31))\n",
"\n",
"Ry12 = RotationYMatrix(-theta12, n_events=ArraySize(theta12))\n",
"Ry23 = RotationYMatrix(-theta23, n_events=ArraySize(theta23))\n",
"Ry31 = RotationYMatrix(-theta31, n_events=ArraySize(theta31))\n",
"Ry12 = RotationYMatrix(-Theta(p12), n_events=ArraySize(Theta(p12)))\n",
"Ry23 = RotationYMatrix(-Theta(p23), n_events=ArraySize(Theta(p23)))\n",
"Ry31 = RotationYMatrix(-Theta(p31), n_events=ArraySize(Theta(p31)))\n",
"\n",
"Rz12 = RotationZMatrix(-phi12, n_events=ArraySize(theta12))\n",
"Rz23 = RotationZMatrix(-phi23, n_events=ArraySize(theta23))\n",
"Rz31 = RotationZMatrix(-phi31, n_events=ArraySize(theta31))\n",
"Rz12 = RotationZMatrix(-Phi(p12), n_events=ArraySize(Phi(p12)))\n",
"Rz23 = RotationZMatrix(-Phi(p23), n_events=ArraySize(Phi(p23)))\n",
"Rz31 = RotationZMatrix(-Phi(p31), n_events=ArraySize(Phi(p31)))\n",
"\n",
"m12_square = SquaredInvariantMass(p12)\n",
"m23_square = SquaredInvariantMass(p23)\n",
Expand Down Expand Up @@ -480,19 +472,6 @@
"phsp_momenta = phsp_generator.generate(500_000, rng)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pd.DataFrame({\n",
" (k, label): np.transpose(v)[i]\n",
" for k, v in phsp_momenta.items()\n",
" for i, label in enumerate([\"E\", \"px\", \"py\", \"pz\"])\n",
"})"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -650,7 +629,11 @@
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"metadata": {
"tags": [
"hide-input"
]
},
"outputs": [],
"source": [
"%config InlineBackend.figure_formats = ['png']\n",
Expand All @@ -669,17 +652,10 @@
"ax.set_title(\"Model-weighted Phase space Dalitz Plot\")\n",
"ax.set_xlabel(R\"$m^2(\\eta \\pi^0)\\;\\left[\\mathrm{GeV}^2\\right]$\")\n",
"ax.set_ylabel(R\"$m^2(\\pi^0 p)\\;\\left[\\mathrm{GeV}^2\\right]$\")\n",
"cbar = fig.colorbar(hist[3], ax=ax)\n",
"fig.colorbar(hist[3], ax=ax)\n",
"fig.tight_layout()\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ select = ["ALL"]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["display"]

[tool.ruff.lint.isort]
split-on-trailing-comma = false

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = [
"ANN",
Expand Down

0 comments on commit 9c2d83e

Please sign in to comment.