Skip to content

Commit

Permalink
use double backticks more uniformly (#240)
Browse files Browse the repository at this point in the history
this changes single quotes to double backticks for operators and
functions in the user guide, and in code comments.

see discussion at
#201 (reply in thread)
  • Loading branch information
newville committed Jun 7, 2024
1 parent 34a271f commit 2da3ca9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions doc/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ Basic math with uncertain Variables
=========================================

Uncertainties variables created in :func:`ufloat` or :func:`ufloat_fromstr` can
be used in basic mathematical calculations ('+', '-', '*', '/', '**') as with
other Python numbers and variables.
be used in basic mathematical calculations (``+``, ``-``, ``*``, ``/``, ``**``)
as with other Python numbers and variables.

>>> t = ufloat(0.2, 0.01)
>>> double = 2.0*t
Expand Down Expand Up @@ -160,18 +160,18 @@ are found in the :mod:`uncertainties.umath` module:

The functions in the :mod:`uncertainties.umath` module include:

'acos', 'acosh', 'asin', 'asinh', 'atan', 'atan2', 'atanh',
'ceil', 'copysign', 'cos', 'cosh', 'degrees', 'erf', 'erfc',
'exp', 'expm1', 'fabs', 'factorial', 'floor', 'fmod',
'frexp', 'fsum', 'gamma', 'hypot', 'isinf', 'isnan',
'ldexp', 'lgamma', 'log', 'log10', 'log1p', 'modf',
'pow', 'radians', 'sin', 'sinh', 'sqrt', 'tan', 'tanh', 'trunc'
``acos``, ``acosh``, ``asin``, ``asinh``, ``atan``, ``atan2``, ``atanh``,
``ceil``, ``copysign``, ``cos``, ``cosh``, ``degrees``, ``erf``, ``erfc``,
``exp``, ``expm1``, ``fabs``, ``factorial``, ``floor``, ``fmod``,
``frexp``, ``fsum``, ``gamma``, ``hypot``, ``isinf``, ``isnan``,
``ldexp``, ``lgamma``, ``log``, ``log10``, ``log1p``, ``modf``,
``pow``, ``radians``, ``sin``, ``sinh``, ``sqrt``, ``tan``, ``tanh``, ``trunc``


Comparison operators
====================

Comparison operators ('==', '!=', '>', '<', '>=', and '<=') for Variables with
Comparison operators (``==``, ``!=``, ``>``, ``<``, ``>=``, and ``<=``) for Variables with
uncertainties are somewhat complicated, and need special attention. As we
hinted at above, and will explore in more detail below and in the
:ref:`Technical Guide <comparison_operators>`, this relates to the correlation
Expand Down
6 changes: 3 additions & 3 deletions uncertainties/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,15 @@
approximated by a line around 0), which might not be precise enough
for all applications.
- Comparison operations (>, ==, etc.) on numbers with uncertainties
- Comparison operations (``>``, ``==``, etc.) on numbers with uncertainties
have a pragmatic semantics, in this package: numbers with
uncertainties can be used wherever Python numbers are used, most of
the time with a result identical to the one that would be obtained
with their nominal value only. However, since the objects defined in
this module represent probability distributions and not pure numbers,
comparison operator are interpreted in a specific way.
The result of a comparison operation ("==", ">", etc.) is defined so as
The result of a comparison operation (``==``, ``>``, etc.) is defined so as
to be essentially consistent with the requirement that uncertainties
be small: the value of a comparison operation is True only if the
operation yields True for all infinitesimal variations of its random
Expand All @@ -204,7 +204,7 @@
variables that almost never give the same value. However, x == x
still holds.
The boolean value (bool(x), "if x...") of a number with uncertainty x
The boolean value (bool(x), ``if x...``) of a number with uncertainty x
is the result of x != 0.
- The uncertainties package is for Python 2.3 and above.
Expand Down

0 comments on commit 2da3ca9

Please sign in to comment.