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

ENH: render particle name in Markdown as code #105

Merged
merged 6 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
"seealso",
"setuptools",
"sharey",
"simplefilter",
"startswith",
"suptitle",
"textwrap",
Expand Down
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ repos:
- |
cell.attachments
cell.metadata.code_folding
cell.metadata.editable
cell.metadata.id
cell.metadata.pycharm
cell.metadata.slideshow
cell.metadata.user_expressions
metadata.celltoolbar
metadata.colab.name
Expand All @@ -38,7 +40,7 @@ repos:
metadata.vscode

- repo: https://github.com/ComPWA/policy
rev: 0.3.4
rev: 0.3.6
hooks:
- id: check-dev-files
args:
Expand Down
3 changes: 3 additions & 0 deletions docs/comparison/d2kkk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"import itertools\n",
"import logging\n",
"import os\n",
"import warnings\n",
"from textwrap import dedent\n",
"from typing import TYPE_CHECKING, Iterable\n",
"\n",
Expand Down Expand Up @@ -82,6 +83,7 @@
"simplify_latex_rendering()\n",
"logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n",
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n",
"warnings.simplefilter(\"ignore\")\n",
"NO_TQDM = \"EXECUTE_NB\" in os.environ\n",
"if NO_TQDM:\n",
" logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n",
Expand Down Expand Up @@ -311,6 +313,7 @@
"source_hidden": true
},
"tags": [
"full-width",
"hide-input"
]
},
Expand Down
3 changes: 3 additions & 0 deletions docs/comparison/jpsi2phipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"import itertools\n",
"import logging\n",
"import os\n",
"import warnings\n",
"from textwrap import dedent\n",
"from typing import TYPE_CHECKING, Iterable\n",
"\n",
Expand Down Expand Up @@ -82,6 +83,7 @@
"simplify_latex_rendering()\n",
"logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n",
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n",
"warnings.simplefilter(\"ignore\")\n",
"NO_TQDM = \"EXECUTE_NB\" in os.environ\n",
"if NO_TQDM:\n",
" logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n",
Expand Down Expand Up @@ -301,6 +303,7 @@
"source_hidden": true
},
"tags": [
"full-width",
"hide-input"
]
},
Expand Down
3 changes: 3 additions & 0 deletions docs/comparison/jpsi2pipipi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"import itertools\n",
"import logging\n",
"import os\n",
"import warnings\n",
"from textwrap import dedent\n",
"from typing import TYPE_CHECKING, Iterable\n",
"\n",
Expand Down Expand Up @@ -82,6 +83,7 @@
"simplify_latex_rendering()\n",
"logging.getLogger(\"jax\").setLevel(logging.ERROR) # mute JAX\n",
"os.environ[\"TF_CPP_MIN_LOG_LEVEL\"] = \"3\" # mute TF\n",
"warnings.simplefilter(\"ignore\")\n",
"NO_TQDM = \"EXECUTE_NB\" in os.environ\n",
"if NO_TQDM:\n",
" logging.getLogger(\"ampform.sympy\").setLevel(logging.ERROR)\n",
Expand Down Expand Up @@ -301,6 +303,7 @@
"source_hidden": true
},
"tags": [
"full-width",
"hide-input"
]
},
Expand Down
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"sphinx.ext.githubpages",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.viewcode",
"sphinx_api_relink",
"sphinx_book_theme",
"sphinx_codeautolink",
Expand Down
2 changes: 1 addition & 1 deletion docs/jpsi2ksp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
" child1, child2, spectator = Σ, pbar, K\n",
" else:\n",
" raise NotImplementedError\n",
" prod_ls_couplings = _generate_ls(Jpsi, resonance, spectator, conserve_parity=False)\n",
" prod_ls_couplings = _generate_ls(Jpsi, resonance, spectator, conserve_parity=True)\n",
" dec_ls_couplings = _generate_ls(resonance, child1, child2, conserve_parity=True)\n",
" if min_ls:\n",
" decay = IsobarNode(\n",
Expand Down
2 changes: 1 addition & 1 deletion src/ampform_dpd/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def _as_resonance_markdown_table(items: Sequence[Particle]) -> str:
src = _create_markdown_table_header(column_names)
for particle in items:
row_items = [
particle.name,
f"`{particle.name}`",
f"${particle.latex}$",
Rf"${aslatex(particle, only_jp=True)}$",
f"{int(1e3 * particle.mass):,.0f}",
Expand Down
Loading