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: generate particle property table from database #55

Merged
merged 18 commits into from
Aug 2, 2024
Merged

ENH: generate particle property table from database #55

merged 18 commits into from
Aug 2, 2024

Conversation

shenvitor
Copy link
Member

@shenvitor shenvitor commented Jul 12, 2024

see the diff.

rtd preview

@shenvitor shenvitor self-assigned this Jul 12, 2024
@shenvitor
Copy link
Member Author

shenvitor commented Jul 12, 2024

by the way I suggest disabling ruff: D103 Missing docstring in public function

otherwise, I need to add words in even a small function... :(

(see https://github.com/ComPWA/gluex-nstar/pull/55/files#diff-926bf65d7b8ac9f10f92d4ba35cb6efb961aedac678bd078db398a6f1769352bR119
I need to add those in the function to pass the check...)

@shenvitor shenvitor changed the title Change md table to directly obtained values from particle_db html table Change md table to html table that directly obtained values from particle_db Jul 12, 2024
@shenvitor shenvitor requested review from redeboer and a team July 13, 2024 00:42
@shenvitor shenvitor changed the title Change md table to html table that directly obtained values from particle_db DOC: Change md table to html table that directly obtained values from particle_db Jul 13, 2024
@redeboer redeboer changed the title DOC: Change md table to html table that directly obtained values from particle_db ENH: generate particle property table from database Jul 13, 2024
@redeboer redeboer added the ⚙️ Enhancement Improvements and optimizations of existing features label Jul 13, 2024
@redeboer
Copy link
Member

by the way I suggest disabling ruff: D103 Missing docstring in public function

Yes good point. But only for notebooks, i.e. through the per-file-ignores table. I think there already is an entry for **.ipynb.

@redeboer
Copy link
Member

I would try to make the table more concise, e.g. combine spin, parity, isospin etc into one row with a $J^{PC}(I^G)$ string. See also https://qrules--274.org.readthedocs.build/274/usage/visualize.html#other-state-renderings from ComPWA/qrules#274.

@shenvitor
Copy link
Member Author

I would try to make the table more concise, e.g. combine spin, parity, isospin etc into one row with a JPC(IG) string. See also https://qrules--274.org.readthedocs.build/274/usage/visualize.html#other-state-renderings from ComPWA/qrules#274.

By the way, I understand that to show it in the form of $J^{PC}(I^{G})$.
And so in my original table, what about $I_3$ (We have this information from the database, maybe I keep it in another row right?)?
In the database, $J$ is not directly shown, I think I need to find a way to find/calculate it?

@redeboer
Copy link
Member

redeboer commented Jul 18, 2024

In the database, $J$ is not directly shown, I think I need to find a way to find/calculate it?

No you can just use the existing attributes of each Particle instance. $J$ is spin, $I$ is isospin.magnitude etc. (Of course, you need to check whether these values are defined at all or None.)
It is uncommon to render $I_z$, but you can do so in another column.

@shenvitor
Copy link
Member Author

In the database, J is not directly shown, I think I need to find a way to find/calculate it?

No you can just use the existing attributes of each Particle instance. J is spin, I is isospin.magnitude etc. (Of course, you need to check whether these values are defined at all or None.) It is uncommon to render Iz, but you can do so in another column.

I see... originally I was thinking about $J=L+S$, and so $L=0$ here you mean?

@redeboer
Copy link
Member

Exactly, just have a look at what's happening in this PR (there the $J^{PC}(I^G)$ values are inserted into graphviz with unicode, but same idea for a latex table).

I would try to make the table more concise, e.g. combine spin, parity, isospin etc into one row with a JPC(IG) string. See also https://qrules--274.org.readthedocs.build/274/usage/visualize.html#other-state-renderings from ComPWA/qrules#274.

@shenvitor shenvitor marked this pull request as draft July 23, 2024 18:06
@shenvitor shenvitor marked this pull request as ready for review July 23, 2024 18:06
@shenvitor
Copy link
Member Author

shenvitor commented Jul 23, 2024

OK now it's ready for review :)
Oh wait seems like the mathjax is not working in html website but ok in notebook 🐙

@shenvitor
Copy link
Member Author

shenvitor commented Jul 24, 2024

Weird... Now all the math/equation/symbols of markdown/latex are not loading in the RTD website preview 🤔

@redeboer
Copy link
Member

Yes it's an old issue with the Sphinx rendering, see e.g. jupyter-book/jupyter-book#1501. That's why I usually resort to building a custom Markdown table string and rendering it with Markdown. That also allows you to do more advanced renderings, but it is a bit more work.

docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
docs/ampform/LambdaKpi0.ipynb Outdated Show resolved Hide resolved
problem of rendering math on website of the html table to be done...
@shenvitor shenvitor marked this pull request as draft July 30, 2024 12:11
@redeboer
Copy link
Member

@shenvitor For the rendering of Markdown table in Sphinx that you implemented in 4073d24: the problem is that you need to set nb_render_markdown_format = "myst" in conf.py 🎉

pyproject.toml Outdated Show resolved Hide resolved
@redeboer redeboer marked this pull request as ready for review August 2, 2024 14:46
@redeboer redeboer enabled auto-merge (squash) August 2, 2024 14:47
Copy link
Member

@redeboer redeboer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome 🧇

@redeboer redeboer merged commit 48e48a8 into main Aug 2, 2024
4 checks passed
@redeboer redeboer deleted the table branch August 2, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Enhancement Improvements and optimizations of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants