Skip to content

Commit

Permalink
Better testing of HTML particle names (#601)
Browse files Browse the repository at this point in the history
* Better testing of HTML particle names

* style: pre-commit fixes

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
eduardo-rodrigues and pre-commit-ci[bot] committed Jun 13, 2024
1 parent 4cbf371 commit c72363e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/particle/particle/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ def describe(self) -> str:

@property
def evtgen_name(self) -> str:
"This is the name used in EvtGen."
"The particle name as used in EvtGen."
return EvtGenName2PDGIDBiMap[self.pdgid]

@property
Expand All @@ -948,7 +948,7 @@ def programmatic_name(self) -> str:

@property
def html_name(self) -> str:
"This is the name in HTML."
"The particle name in HTML."
return latex_to_html_name(self.latex_name)

@classmethod
Expand Down
4 changes: 4 additions & 0 deletions tests/particle/test_particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,12 @@ def test_all_particles_are_loaded():
(11, "e<SUP>-</SUP>"), # e-
(-13, "&#x03bc;<SUP>+</SUP>"), # mu+
(-14, "&#x03bd;&#773;<SUB>&#x03bc;</SUB>"), # nu_mu_bar
(18, "&#x03bd;<SUB>&#x03c4;<SUP>&#8242;</SUP></SUB>"), # nu_tau_prime
(111, "&#x03c0;<SUP>0</SUP>"), # pi0
(-211, "&#x03c0;<SUP>-</SUP>"), # pi-
(-213, "&#x03c1;(770)<SUP>-</SUP>"), # rho(770)-
(331, "&#x03b7;<SUP>&#8242;</SUP>(958)"), # eta_prime
(335, "f<SUB>2</SUB><SUP>&#8242;</SUP>(1525)"), # f2'(1525)
(20213, "a<SUB>1</SUB>(1260)<SUP>+</SUP>"), # a_1(1260)+
(321, "K<SUP>+</SUP>"), # K+
(130, "K<SUB>L</SUB><SUP>0</SUP>"), # K_L
Expand All @@ -415,6 +418,7 @@ def test_all_particles_are_loaded():
(-2224, "&#x0394;&#773;(1232)<SUP>--</SUP>"), # Delta_bar(1232)--
(3322, "&#x039e;<SUP>0</SUP>"), # Xi0
(-3322, "&#x039e;&#773;<SUP>0</SUP>"), # Xi0_bar
(4312, "&#x039e;<SUB>c</SUB><SUP>&#8242; 0</SUP>"), # Xi_c'0
(-5122, "&#x039b;&#773;<SUB>b</SUB><SUP>0</SUP>"), # Lb0_bar
)

Expand Down

0 comments on commit c72363e

Please sign in to comment.