Skip to content

ENH: load particle definitions from pdg package - #371

Draft
Flomber wants to merge 11 commits into
mainfrom
load_from_pdg
Draft

ENH: load particle definitions from pdg package#371
Flomber wants to merge 11 commits into
mainfrom
load_from_pdg

Conversation

@Flomber

@Flomber Flomber commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Closes #332

@Flomber Flomber added this to the 0.11.0 milestone Sep 7, 2026
@Flomber
Flomber requested a review from redeboer September 7, 2026 14:35
@Flomber Flomber self-assigned this Sep 7, 2026
@Flomber Flomber added ❗ Behavior Changes that may affect the framework output ⚙️ Enhancement Improvements and optimizations of existing features labels Sep 7, 2026
Comment thread src/qrules/_pdg.py

class _UnsupportedParticleError(ValueError):
"""Raised when a PDG entry cannot be represented by QRules."""

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Don't know if this is really needed 🤔

Comment thread src/qrules/_pdg_latex.py
"rho": R"\rho",
"tau": R"\tau",
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't like, that there is another dictionary defined, like in in _labels.py.

Comment thread src/qrules/_pdg_latex.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

pdg package doesn't come with its own LaTeX names for particles. When we want to migrate to pdg we need an own conversion of particle names to its LaTeX variant. This is the task of this module...

@redeboer redeboer Sep 7, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh okay, that's bad... Does make me wonder where PDG Live gets its LaTeX names 🤔 Maybe @mmikhasenko knows?

@Flomber

Flomber commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author
image

Naming convention changes with migration. Do we want to keep aliases for backwards compatibility?

@Flomber Flomber changed the title Load definitions from pdg ENH: load particle definitions from pdg package Sep 7, 2026
@Flomber

Flomber commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

When replacing the load_pdg() function all tests have to be edited because of the new naming convention.
There are many issues with this and I will work on it in time. But not today

Comment thread tests/conftest.py
return f"{pytestconfig.rootpath}/tests/output/"


@pytest.fixture(scope="session")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This seemed to be used for version checks of the particle package, right?
Should we also implement version tests for pdg package?

@redeboer redeboer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

General feedback without reading the code to closely: this PR should not switch to the pdg package as input, but should offer that as an additional source. For instance, with a flag in the load_pdg() function.

Comment thread pyproject.toml
"frozendict",
"jsonschema",
"particle",
"pdg >=2026.0,<2027",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe better to avoid an upper limit here. But not sure.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ohhh, okay...
Then I will revert most changes and implement this as an additional source. Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❗ Behavior Changes that may affect the framework output ⚙️ Enhancement Improvements and optimizations of existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Load particle definitions from pdg package

3 participants