Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: add ampform-dpd notebook #82

Merged
merged 10 commits into from
Aug 16, 2024
Prev Previous commit
Next Next commit
ENH: create plots in Sphinx without ipympl
redeboer committed Aug 16, 2024

Verified

This commit was signed with the committer’s verified signature.
shlomi-noach Shlomi Noach
commit ab822a0c2ac53cf4db0a0abb716849a2bc5a89b5
20 changes: 16 additions & 4 deletions docs/lambda-k-pi/ampform-dpd.ipynb
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@
"from ampform_dpd.decay import DecayNode, ThreeBodyDecayChain\n",
"from ampform_dpd.dynamics.builder import create_mass_symbol, get_mandelstam_s\n",
"from ampform_dpd.io import aslatex\n",
"from IPython.display import Latex, Markdown, Math, display\n",
"from IPython.display import SVG, Image, Latex, Markdown, Math, display\n",
"from qrules.particle import Particle, Spin, create_particle, load_pdg\n",
"from tensorwaves.data import (\n",
" SympyDataTransformer,\n",
@@ -785,7 +785,14 @@
"interactive_plot = w.interactive_output(update_dalitz_plot, sliders)\n",
"fig_2d.tight_layout()\n",
"fig_2d.colorbar(mesh, ax=ax_2d)\n",
"display(UI, interactive_plot)"
"\n",
"if STATIC_PAGE:\n",
" filename = \"dalitz-plot-dpd.png\"\n",
" fig_2d.savefig(filename)\n",
" plt.close(fig_2d)\n",
" display(UI, Image(filename))\n",
"else:\n",
" display(UI, interactive_plot)"
]
},
{
@@ -867,8 +874,13 @@
"for ax in axes:\n",
" ax.legend(fontsize=\"small\")\n",
"\n",
"fig.tight_layout()\n",
"display(UI, interactive_plot)"
"if STATIC_PAGE:\n",
" filename = \"histogram-dpd.svg\"\n",
" fig.savefig(filename)\n",
" plt.close(fig)\n",
" display(UI, SVG(filename))\n",
"else:\n",
" display(UI, interactive_plot)"
]
}
],