Skip to content

Commit

Permalink
Update particle data in doc(test)s accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardo-rodrigues committed Aug 9, 2024
1 parent 60ecfe9 commit ca41b99
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/particle/lhcb/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def to_lhcb_name(p: Particle) -> str:
--------
>>> p = Particle.from_pdgid(-531)
>>> p
<Particle: name="B(s)~0", pdgid=-531, mass=5366.92 ± 0.10 MeV>
<Particle: name="B(s)~0", pdgid=-531, mass=5366.93 ± 0.10 MeV>
>>> to_lhcb_name(p)
'B_s~0'
"""
Expand All @@ -31,7 +31,7 @@ def from_lhcb_name(name: str) -> Particle:
Examples
--------
>>> from_lhcb_name("B_s~0")
<Particle: name="B(s)~0", pdgid=-531, mass=5366.92 ± 0.10 MeV>
<Particle: name="B(s)~0", pdgid=-531, mass=5366.93 ± 0.10 MeV>
Raises
------
Expand Down
10 changes: 5 additions & 5 deletions src/particle/particle/particle.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ def to_list(
>>> print(tabulate(query_as_list, headers='firstrow'))
pdgid name mass charge
------- ------ ------- --------
15 tau- 1776.86 -1
-15 tau+ 1776.86 1
15 tau- 1776.93 -1
-15 tau+ 1776.93 1
Save it to a file:
Expand Down Expand Up @@ -492,16 +492,16 @@ def to_dict(
======= ====== =============== ========
11 e- 0.5109989461 -1
13 mu- 105.6583745 -1
15 tau- 1776.86 -1
15 tau- 1776.93 -1
17 tau'- -1
======= ====== =============== ========
>>> query_as_dict = Particle.to_dict(filter_fn=lambda p: p.pdgid.is_lepton, pdg_name='tau', exclusive_fields=['pdgid', 'name', 'mass', 'charge'])
>>> print(tabulate(query_as_dict, headers='keys')) # doctest: +SKIP
pdgid name mass charge
------- ------ ------- --------
15 tau- 1776.86 -1
-15 tau+ 1776.86 1
15 tau- 1776.93 -1
-15 tau+ 1776.93 1
Save it to a file:
Expand Down

0 comments on commit ca41b99

Please sign in to comment.