Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Mar 7, 2024
1 parent 53177f8 commit 8e40ac3
Show file tree
Hide file tree
Showing 7 changed files with 123 additions and 177 deletions.
70 changes: 30 additions & 40 deletions docs/comparison/d2kkk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,7 @@
},
"outputs": [],
"source": [
"def generate_phase_space(\n",
" reaction: ReactionInfo, size: int\n",
") -> dict[str, jnp.ndarray]:\n",
"def generate_phase_space(reaction: ReactionInfo, size: int) -> dict[str, jnp.ndarray]:\n",
" rng = TFUniformRealNumberGenerator(seed=0)\n",
" phsp_generator = TFPhaseSpaceGenerator(\n",
" initial_state_mass=reaction.initial_state[-1].mass,\n",
Expand Down Expand Up @@ -542,8 +540,7 @@
"def unfold_intensity(model: HelicityModel) -> sp.Expr:\n",
" unfolded_intensity = perform_cached_doit(model.intensity)\n",
" unfolded_amplitudes = {\n",
" symbol: perform_cached_doit(expr)\n",
" for symbol, expr in model.amplitudes.items()\n",
" symbol: perform_cached_doit(expr) for symbol, expr in model.amplitudes.items()\n",
" }\n",
" return unfolded_intensity.xreplace(unfolded_amplitudes)\n",
"\n",
Expand Down Expand Up @@ -646,8 +643,7 @@
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
" if (\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\")\n",
" and \"+\" in symbol.name\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\") and \"+\" in symbol.name\n",
" ) and any(s in symbol.name for s in [\"{1}\", \"*\", \"rho\"]):\n",
" value = \"-1\"\n",
" sliders[symbol.name] = ToggleButtons(\n",
Expand Down Expand Up @@ -679,7 +675,7 @@
" options={to_unicode(p): p.latex for p in resonances},\n",
" value=[resonances[0].latex, resonances[1].latex],\n",
" layout=Layout(\n",
" height=f\"{14 * (len(resonances)+1)}pt\",\n",
" height=f\"{14 * (len(resonances) + 1)}pt\",\n",
" width=\"auto\",\n",
" ),\n",
")\n",
Expand All @@ -688,36 +684,32 @@
"ipywidgets.link((hide_expressions, \"value\"), (simplify_expressions, \"disabled\"))\n",
"\n",
"package_names = (\"AmpForm\", \"AmpForm-DPD\")\n",
"ui = HBox(\n",
" [\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox(\n",
" [\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" ]\n",
"ui = HBox([\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox([\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
" ]\n",
")"
" ])\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
"])"
]
},
{
Expand Down Expand Up @@ -821,9 +813,7 @@
" ampform_intensities = compute_sub_intensities(\n",
" ampform_func, ampform_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(\n",
" dpd_func, dpd_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(dpd_func, dpd_phsp, selected_resonances)\n",
"\n",
" s_edges = jnp.linspace(0.98, 1.38, num=50)\n",
" amp_values_s1, _ = jnp.histogram(\n",
Expand Down
70 changes: 30 additions & 40 deletions docs/comparison/jpsi2phipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@
},
"outputs": [],
"source": [
"def generate_phase_space(\n",
" reaction: ReactionInfo, size: int\n",
") -> dict[str, jnp.ndarray]:\n",
"def generate_phase_space(reaction: ReactionInfo, size: int) -> dict[str, jnp.ndarray]:\n",
" rng = TFUniformRealNumberGenerator(seed=0)\n",
" phsp_generator = TFPhaseSpaceGenerator(\n",
" initial_state_mass=reaction.initial_state[-1].mass,\n",
Expand Down Expand Up @@ -525,8 +523,7 @@
"def unfold_intensity(model: HelicityModel) -> sp.Expr:\n",
" unfolded_intensity = perform_cached_doit(model.intensity)\n",
" unfolded_amplitudes = {\n",
" symbol: perform_cached_doit(expr)\n",
" for symbol, expr in model.amplitudes.items()\n",
" symbol: perform_cached_doit(expr) for symbol, expr in model.amplitudes.items()\n",
" }\n",
" return unfolded_intensity.xreplace(unfolded_amplitudes)\n",
"\n",
Expand Down Expand Up @@ -629,8 +626,7 @@
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
" if (\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\")\n",
" and \"+\" in symbol.name\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\") and \"+\" in symbol.name\n",
" ) and any(s in symbol.name for s in [\"{1}\", \"*\", \"rho\"]):\n",
" value = \"-1\"\n",
" sliders[symbol.name] = ToggleButtons(\n",
Expand Down Expand Up @@ -662,7 +658,7 @@
" options={to_unicode(p): p.latex for p in resonances},\n",
" value=[resonances[0].latex, resonances[1].latex],\n",
" layout=Layout(\n",
" height=f\"{14 * (len(resonances)+1)}pt\",\n",
" height=f\"{14 * (len(resonances) + 1)}pt\",\n",
" width=\"auto\",\n",
" ),\n",
")\n",
Expand All @@ -671,36 +667,32 @@
"ipywidgets.link((hide_expressions, \"value\"), (simplify_expressions, \"disabled\"))\n",
"\n",
"package_names = (\"AmpForm\", \"AmpForm-DPD\")\n",
"ui = HBox(\n",
" [\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox(\n",
" [\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" ]\n",
"ui = HBox([\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox([\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
" ]\n",
")"
" ])\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
"])"
]
},
{
Expand Down Expand Up @@ -804,9 +796,7 @@
" ampform_intensities = compute_sub_intensities(\n",
" ampform_func, ampform_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(\n",
" dpd_func, dpd_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(dpd_func, dpd_phsp, selected_resonances)\n",
"\n",
" s1_edges = jnp.linspace(0.2, 2.1, num=50)\n",
" s23_edges = jnp.linspace(1.1, 3.0, num=50)\n",
Expand Down
70 changes: 30 additions & 40 deletions docs/comparison/jpsi2pipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,7 @@
},
"outputs": [],
"source": [
"def generate_phase_space(\n",
" reaction: ReactionInfo, size: int\n",
") -> dict[str, jnp.ndarray]:\n",
"def generate_phase_space(reaction: ReactionInfo, size: int) -> dict[str, jnp.ndarray]:\n",
" rng = TFUniformRealNumberGenerator(seed=0)\n",
" phsp_generator = TFPhaseSpaceGenerator(\n",
" initial_state_mass=reaction.initial_state[-1].mass,\n",
Expand Down Expand Up @@ -525,8 +523,7 @@
"def unfold_intensity(model: HelicityModel) -> sp.Expr:\n",
" unfolded_intensity = perform_cached_doit(model.intensity)\n",
" unfolded_amplitudes = {\n",
" symbol: perform_cached_doit(expr)\n",
" for symbol, expr in model.amplitudes.items()\n",
" symbol: perform_cached_doit(expr) for symbol, expr in model.amplitudes.items()\n",
" }\n",
" return unfolded_intensity.xreplace(unfolded_amplitudes)\n",
"\n",
Expand Down Expand Up @@ -629,8 +626,7 @@
" for symbol, value in all_parameters.items():\n",
" value = \"+1\"\n",
" if (\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\")\n",
" and \"+\" in symbol.name\n",
" symbol.name.startswith(R\"\\mathcal{H}^\\mathrm{decay}\") and \"+\" in symbol.name\n",
" ) and any(s in symbol.name for s in [\"{1}\", \"*\", \"rho\"]):\n",
" value = \"-1\"\n",
" sliders[symbol.name] = ToggleButtons(\n",
Expand Down Expand Up @@ -662,7 +658,7 @@
" options={to_unicode(p): p.latex for p in resonances},\n",
" value=[resonances[0].latex, resonances[1].latex],\n",
" layout=Layout(\n",
" height=f\"{14 * (len(resonances)+1)}pt\",\n",
" height=f\"{14 * (len(resonances) + 1)}pt\",\n",
" width=\"auto\",\n",
" ),\n",
")\n",
Expand All @@ -671,36 +667,32 @@
"ipywidgets.link((hide_expressions, \"value\"), (simplify_expressions, \"disabled\"))\n",
"\n",
"package_names = (\"AmpForm\", \"AmpForm-DPD\")\n",
"ui = HBox(\n",
" [\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox(\n",
" [\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" ]\n",
"ui = HBox([\n",
" VBox([resonance_selector, hide_expressions, simplify_expressions]),\n",
" Tab(\n",
" children=[\n",
" Accordion(\n",
" children=[\n",
" GridBox([\n",
" sliders[key]\n",
" for key in sorted(sliders)\n",
" if p.latex in key\n",
" if (\n",
" key[0] in {\"C\", \"H\"}\n",
" if package == \"AmpForm\"\n",
" else key.startswith(R\"\\mathcal{H}\")\n",
" )\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
" ]\n",
")"
" ])\n",
" for package in package_names\n",
" ],\n",
" selected_index=1,\n",
" titles=package_names,\n",
" )\n",
" for p in resonances\n",
" ],\n",
" titles=[to_unicode(p) for p in resonances],\n",
" ),\n",
"])"
]
},
{
Expand Down Expand Up @@ -804,9 +796,7 @@
" ampform_intensities = compute_sub_intensities(\n",
" ampform_func, ampform_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(\n",
" dpd_func, dpd_phsp, selected_resonances\n",
" )\n",
" dpd_intensities = compute_sub_intensities(dpd_func, dpd_phsp, selected_resonances)\n",
"\n",
" s_edges = jnp.linspace(0.2, 3.0, num=50)\n",
" amp_values_s1, _ = jnp.histogram(\n",
Expand Down
44 changes: 20 additions & 24 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,19 @@
set_intersphinx_version_remapping,
)

set_intersphinx_version_remapping(
{
"ipython": {
"8.12.2": "8.12.1",
"8.12.3": "8.12.1",
},
"ipywidgets": {
"8.0.3": "8.0.5",
"8.0.4": "8.0.5",
"8.0.6": "8.0.5",
"8.1.1": "8.1.2",
},
"mpl-interactions": {"0.24.1": "0.24.0"},
}
)
set_intersphinx_version_remapping({
"ipython": {
"8.12.2": "8.12.1",
"8.12.3": "8.12.1",
},
"ipywidgets": {
"8.0.3": "8.0.5",
"8.0.4": "8.0.5",
"8.0.6": "8.0.5",
"8.1.1": "8.1.2",
},
"mpl-interactions": {"0.24.1": "0.24.0"},
})

BRANCH = get_branch_name()
ORGANIZATION = "ComPWA"
Expand Down Expand Up @@ -54,15 +52,13 @@
api_target_types: dict[str, str] = {}
author = "Common Partial Wave Analysis"
autodoc_default_options = {
"exclude-members": ", ".join(
[
"default_assumptions",
"doit",
"evaluate",
"is_commutative",
"is_extended_real",
]
),
"exclude-members": ", ".join([
"default_assumptions",
"doit",
"evaluate",
"is_commutative",
"is_extended_real",
]),
"members": True,
"undoc-members": True,
"show-inheritance": True,
Expand Down
Loading

0 comments on commit 8e40ac3

Please sign in to comment.