Skip to content

Commit

Permalink
Mark docstrings with backslashes as raw strings (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
wshanks authored May 16, 2024
1 parent 3255816 commit cbf4917
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions tests/test_uncertainties.py
Original file line number Diff line number Diff line change
Expand Up @@ -1272,10 +1272,10 @@ def test_format():
(1234.56789, 0.1): {
'eL': r'\left(1.23457 \pm 0.00010\right) \times 10^{3}',
'EL': r'\left(1.23457 \pm 0.00010\right) \times 10^{3}',
'fL': '1234.57 \pm 0.10',
'FL': '1234.57 \pm 0.10',
'fL': '1234.57 \pm 0.10',
'FL': '1234.57 \pm 0.10',
'fL': r'1234.57 \pm 0.10',
'FL': r'1234.57 \pm 0.10',
'fL': r'1234.57 \pm 0.10',
'FL': r'1234.57 \pm 0.10',
'%L': r'\left(123457 \pm 10\right) \%'
},
#
Expand Down Expand Up @@ -1315,7 +1315,7 @@ def test_format():
'15GS': ' -1.2(%s)E-12' % NaN_EFG,
'SL': r'-1.2(\mathrm{nan}) \times 10^{-12}', # LaTeX NaN
# Pretty-print priority, but not for NaN:
'PSL': u'-1.2(\mathrm{nan})×10⁻¹²',
'PSL': r'-1.2(\mathrm{nan})×10⁻¹²',
'L': r'\left(-1.2 \pm \mathrm{nan}\right) \times 10^{-12}',
# Uppercase NaN and LaTeX:
'.1EL': (r'\left(-1.2 \pm \mathrm{%s}\right) \times 10^{-12}'
Expand Down Expand Up @@ -1394,8 +1394,8 @@ def test_format():
# Default precision = 6
'eL': r'\left(1.234568 \pm 0\right) \times 10^{3}',
'EL': r'\left(1.234568 \pm 0\right) \times 10^{3}',
'fL': '1234.567890 \pm 0',
'FL': '1234.567890 \pm 0',
'fL': r'1234.567890 \pm 0',
'FL': r'1234.567890 \pm 0',
'%L': r'\left(123456.789000 \pm 0\right) \%'
},

Expand Down Expand Up @@ -1560,9 +1560,9 @@ def test_format():
# options:
(float('-inf'), float('inf')): {
'S': '-inf(inf)',
'LS': '-\infty(\infty)',
'L': '-\infty \pm \infty',
'LP': u'-\infty±\infty',
'LS': r'-\infty(\infty)',
'L': r'-\infty \pm \infty',
'LP': r'-\infty±\infty',
# The following is consistent with Python's own
# formatting, which depends on the version of Python:
# formatting float("-inf") with format(..., "020") gives
Expand All @@ -1586,9 +1586,9 @@ def test_format():
},
(-float('nan'), float('inf')): {
'S': 'nan(inf)',
'LS': '\mathrm{nan}(\infty)',
'L': '\mathrm{nan} \pm \infty',
'LP': u'\mathrm{nan}±\infty'
'LS': r'\mathrm{nan}(\infty)',
'L': r'\mathrm{nan} \pm \infty',
'LP': r'\mathrm{nan}±\infty'
},

# Leading zeroes in the shorthand notation:
Expand Down

0 comments on commit cbf4917

Please sign in to comment.