From 02f3be11c0f2aa6fbf4752dd416a7941e021af99 Mon Sep 17 00:00:00 2001 From: Matthew Newville Date: Tue, 14 May 2024 20:29:54 -0500 Subject: [PATCH] doc fixes and spelling check as per @andrewgsavage review --- doc/formatting.rst | 2 +- doc/index.rst | 4 ++-- doc/install.rst | 12 ++++++------ doc/numpy_guide.rst | 6 +++--- doc/tech_guide.rst | 6 +++--- doc/user_guide.rst | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/doc/formatting.rst b/doc/formatting.rst index 5d320d66..27270ba1 100644 --- a/doc/formatting.rst +++ b/doc/formatting.rst @@ -112,7 +112,7 @@ formatting options. They can be added at the end of the format string: - ``L`` for a **LaTeX** output: - >>> print x*1e7 + >>> print(x*1e7) (2.00+/-0.10)e+06 >>> print('{:L}'.format(x*1e7)) # Automatic exponent form, LaTeX \left(2.00 \pm 0.10\right) \times 10^{6} diff --git a/doc/index.rst b/doc/index.rst index 2a47aad0..496c4d49 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -8,7 +8,7 @@ Uncertainties The `uncertainties package`_ is an open source Python library for doing calculations on numbers that have uncertainties (like 3.14±0.01) that are -common in many scientific fields. The calcualtions done with this package will +common in many scientific fields. The calculations done with this package will propagate the uncertainties to the result of mathematical calculations. The :mod:`uncertainties` package takes the pain and complexity out of uncertainty calculations and error propagation. Here is a @@ -33,7 +33,7 @@ values. For other approaches, see soerp_ (using higher-order terms) and mcerp_ (using a Monte-Carlo approach). The `source code`_ for the uncertainties package is licensed under the `Revised -BSD License`_. This dcoumentation is licensed under the `CC-SA-3 License`_. +BSD License`_. This documentation is licensed under the `CC-SA-3 License`_. .. _uncertainties package: https://pypi.python.org/pypi/uncertainties/ .. _error propagation theory: https://en.wikipedia.org/wiki/Propagation_of_uncertainty diff --git a/doc/install.rst b/doc/install.rst index 65983e31..44ad8296 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -28,7 +28,7 @@ You can upgrade from an older version of :mod:`uncertainties` with: Other packaging systems such as `Anaconda `_, -`MacPorts `_, or Linux package managrer may also +`MacPorts `_, or Linux package manager may also maintain packages for :mod:`uncertainties`, so that you may also be able to install using something like @@ -50,8 +50,8 @@ depending on your platform and installation of Python. For all installations of Python, using `pip` should work and is therefore recommended. -Souce code and Development Version -================================== +Source code and Development Version +===================================== .. _download: https://pypi.python.org/pypi/uncertainties/#files .. _GitHub releases: https://github.com/lmfit/uncertainties/releases @@ -59,8 +59,8 @@ Souce code and Development Version You can `download`_ the latest source package archive from the Python Package Index (PyPI) and unpack it, or from the `GitHub releases`_ page. This package -can be unpacked using `unzip`, `tar xf` , or other similar utilites, and then -installeed with +can be unpacked using `unzip`, `tar xf` , or other similar utilities, and then +installed with .. code-block:: sh @@ -103,7 +103,7 @@ Credits The :mod:`uncertainties` package was written and developed by `Eric O. LEBIGOT (EOL)`_. EOL also maintained the package until 2024, when the GitHub project was moved to the `lmfit GitHub organization`_ to allow more sustainable -development and maintenance. Currentt members of the devlopment and +development and maintenance. Current members of the devlopment and maintenance team include `Andrew G Savage `_, `Justin Gerber `_, `Eric O Legibot `_, diff --git a/doc/numpy_guide.rst b/doc/numpy_guide.rst index 2194e388..2483cb95 100644 --- a/doc/numpy_guide.rst +++ b/doc/numpy_guide.rst @@ -66,7 +66,7 @@ Arrays of numbers with uncertainties can be built from values and uncertainties: >>> arr = unumpy.uarray([1, 2], [0.01, 0.002]) ->>> print arr +>>> print(arr) [1.0+/-0.01 2.0+/-0.002] NumPy arrays of numbers with uncertainties can also be built directly @@ -100,7 +100,7 @@ work). This is why the :class:`unumpy.matrix` class is provided: both the inverse and the pseudo-inverse of a matrix can be calculated in the usual way: if :data:`mat` is a :class:`unumpy.matrix`, ->>> print mat.I +>>> print(mat.I) does calculate the inverse or pseudo-inverse of :data:`mat` with uncertainties. @@ -132,7 +132,7 @@ This module defines uncertainty-aware mathematical functions that generalize those from :mod:`uncertainties.umath` so that they work on NumPy arrays of numbers with uncertainties instead of just scalars: ->>> print unumpy.cos(arr) # Cosine of each array element +>>> print(unumpy.cos(arr)) # Cosine of each array element NumPy's function names are used, and not those from the :mod:`math` module (for instance, :func:`unumpy.arccos` is defined, like in NumPy, diff --git a/doc/tech_guide.rst b/doc/tech_guide.rst index fea244c4..f3dc5284 100644 --- a/doc/tech_guide.rst +++ b/doc/tech_guide.rst @@ -357,7 +357,7 @@ If the variable :data:`a` above is modified, the value of :data:`poly` is not modified, as is usual in Python: >>> a = 123 ->>> print poly +>>> print(poly) 46.0+/-0.4 # Still equal to x**2 + 42, not x**2 + 123 Random variables can, on the other hand, have their uncertainty @@ -365,7 +365,7 @@ updated on the fly, because quantities with uncertainties (like :data:`poly`) keep track of them: >>> x.std_dev = 0 ->>> print poly +>>> print(poly) 46+/-0 # Zero uncertainty, now As usual, Python keeps track of objects as long as they are used. @@ -374,7 +374,7 @@ Thus, redefining the value of :data:`x` does not change the fact that in :data:`x`: >>> x = 10000 ->>> print poly +>>> print(poly) 46+/-0 # Unchanged These mechanisms make quantities with uncertainties behave mostly like diff --git a/doc/user_guide.rst b/doc/user_guide.rst index 1f7f59cc..4a3f307e 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -27,9 +27,9 @@ Creating Variables: numbers with uncertainties ================================================ To create a number with uncertainties or *Variable*, use the :func:`ufloat` -function, which takes a *nominal value* ( (which can be interpreted as the most +function, which takes a *nominal value* (which can be interpreted as the most likely value, or the mean or central value of the distribution of values), a -*standard error* ( (the standard deviation or :math:`1-\sigma` uncertainty), and +*standard error* (the standard deviation or :math:`1-\sigma` uncertainty), and an optional *tag*: >>> x = ufloat(2.7, 0.01) # x = 2.7+/-0.01 @@ -220,7 +220,7 @@ The concept of comparing the magnitude of values with uncertainties is a bit complicated. That is, a Variable with a value of 25 +/- 10 might be greater than a Variable with a value of 24 +/- 8 most of the time, but *sometimes* it might be less than it. The :mod:`uncertainties` package takes the simple -approach of comparing. That is +approach of comparing nominal values. That is >>> a = ufloat(25, 10) >>> b = ufloat(24, 8)