Skip to content

Commit

Permalink
fix doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
sdat2 committed Sep 25, 2024
1 parent 5e56bb6 commit e888319
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions sithom/unc.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ def tex_uf(
>>> from sithom.unc import tex_uf
>>> uf = ufloat(1, 0.5)
>>> tex_uf(uf, bracket=True, force_latex=True)
'$\\left( 1.0 \\pm 0.5 \\right)$'
'$\\\\left( 1.0 \\\\pm 0.5 \\\\right)$'
>>> uf = ufloat(10, 5)
>>> tex_uf(uf, bracket=True, force_latex=True)
'$\\left( \\left(1.0 \\pm 0.5\\right) \\times 10^{1} \\right)$'
'$\\\\left( \\\\left(1.0 \\\\pm 0.5\\\\right) \\\\times 10^{1} \\\\right)$'
>>> tex_uf(ufloat(0.0, 0.0), bracket=True, force_latex=True) # works weirdly
'$\\left( 0.0 \\pm 0 \\right)$'
'$\\\\left( 0.0 \\\\pm 0 \\\\right)$'
>>> tex_uf(ufloat(2, 0.06), bracket=True, force_latex=True)
'$\\left( 2.0 \\pm 0.1 \\right)$'
'$\\\\left( 2.0 \\\\pm 0.1 \\\\right)$'
(Had to add twice as many backslashes for pytest to run.)
TODO: Fix connsistency to get bullet points right.
TODO: Fix consistency to get bullet points right.
"""
# trying to deal with divide by zero possibility.
if ufloat_input.n == 0.0:
Expand Down
2 changes: 1 addition & 1 deletion sithom/xr.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def _latexify(units: str) -> str:
>>> _latexify("kg m s**-2")
'kg m s$^{-2}$'
>>> _latexify("degree_Celsius")
'$^{\\circ}$C'
'$^{\\\\circ}$C'
>>> _latexify("degK")
'K'
Expand Down

0 comments on commit e888319

Please sign in to comment.