diff options
| author | Keewis <keewis@posteo.de> | 2022-02-10 21:06:30 +0100 |
|---|---|---|
| committer | Keewis <keewis@posteo.de> | 2022-02-10 21:06:30 +0100 |
| commit | 08bb69bb529fec00c12fc4e3763b96bae6b31dda (patch) | |
| tree | 323b25963a7c122ebbc676349becca2c9d4a3c25 /docs | |
| parent | 14be79218a8e1ea75f8413a27418584d4b5b717d (diff) | |
| parent | 5403f46ecf636d0749cf54cddf725d177d60af61 (diff) | |
| download | pint-08bb69bb529fec00c12fc4e3763b96bae6b31dda.tar.gz | |
Merge branch 'master' into formatter-docs
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/_templates/sidebarintro.html | 2 | ||||
| -rw-r--r-- | docs/_themes/flask/static/flasky.css_t | 50 | ||||
| -rw-r--r-- | docs/_themes/flask/theme.conf | 2 | ||||
| -rw-r--r-- | docs/defining-quantities.rst | 14 | ||||
| -rw-r--r-- | docs/getting.rst | 2 | ||||
| -rw-r--r-- | docs/index.rst | 2 | ||||
| -rw-r--r-- | docs/numpy.ipynb | 2 | ||||
| -rw-r--r-- | docs/performance.rst | 12 |
8 files changed, 49 insertions, 37 deletions
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html index ff0666d..8e382a8 100644 --- a/docs/_templates/sidebarintro.html +++ b/docs/_templates/sidebarintro.html @@ -16,5 +16,3 @@ You are currently looking at the documentation of version {{ version }}. <li><a href="https://github.com/hgrecco/pint">Code in GitHub</a></li> <li><a href="https://github.com/hgrecco/pint/issues">Issue Tracker</a></li> </ul> - - diff --git a/docs/_themes/flask/static/flasky.css_t b/docs/_themes/flask/static/flasky.css_t index b5ca39b..4f78308 100644 --- a/docs/_themes/flask/static/flasky.css_t +++ b/docs/_themes/flask/static/flasky.css_t @@ -8,11 +8,11 @@ {% set page_width = '940px' %} {% set sidebar_width = '220px' %} - + @import url("basic.css"); - + /* -- page layout ----------------------------------------------------------- */ - + body { font-family: 'Georgia', serif; font-size: 17px; @@ -43,7 +43,7 @@ div.sphinxsidebar { hr { border: 1px solid #B1B4B6; } - + div.body { background-color: #ffffff; color: #3E4349; @@ -54,7 +54,7 @@ img.floatingflask { padding: 0 0 10px 10px; float: right; } - + div.footer { width: {{ page_width }}; margin: 20px auto 30px auto; @@ -70,7 +70,7 @@ div.footer a { div.related { display: none; } - + div.sphinxsidebar a { color: #444; text-decoration: none; @@ -80,7 +80,7 @@ div.sphinxsidebar a { div.sphinxsidebar a:hover { border-bottom: 1px solid #999; } - + div.sphinxsidebar { font-size: 14px; line-height: 1.5; @@ -95,7 +95,7 @@ div.sphinxsidebarwrapper p.logo { margin: 0; text-align: center; } - + div.sphinxsidebar h3, div.sphinxsidebar h4 { font-family: 'Garamond', 'Georgia', serif; @@ -109,7 +109,7 @@ div.sphinxsidebar h4 { div.sphinxsidebar h4 { font-size: 20px; } - + div.sphinxsidebar h3 a { color: #444; } @@ -120,7 +120,7 @@ div.sphinxsidebar p.logo a:hover, div.sphinxsidebar h3 a:hover { border: none; } - + div.sphinxsidebar p { color: #555; margin: 10px 0; @@ -131,25 +131,25 @@ div.sphinxsidebar ul { padding: 0; color: #000; } - + div.sphinxsidebar input { border: 1px solid #ccc; font-family: 'Georgia', serif; font-size: 1em; } - + /* -- body styles ----------------------------------------------------------- */ - + a { color: #004B6B; text-decoration: underline; } - + a:hover { color: #6D4100; text-decoration: underline; } - + div.body h1, div.body h2, div.body h3, @@ -169,25 +169,25 @@ div.indexwrapper h1 { height: {{ theme_index_logo_height }}; } {% endif %} - + div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } div.body h2 { font-size: 180%; } div.body h3 { font-size: 150%; } div.body h4 { font-size: 130%; } div.body h5 { font-size: 100%; } div.body h6 { font-size: 100%; } - + a.headerlink { color: #ddd; padding: 0 4px; text-decoration: none; } - + a.headerlink:hover { color: #444; background: #eaeaea; } - + div.body p, div.body dd, div.body li { line-height: 1.4em; } @@ -234,20 +234,20 @@ div.note { background-color: #eee; border: 1px solid #ccc; } - + div.seealso { background-color: #ffc; border: 1px solid #ff6; } - + div.topic { background-color: #eee; } - + p.admonition-title { display: inline; } - + p.admonition-title:after { content: ":"; } @@ -341,7 +341,7 @@ ul, ol { margin: 10px 0 10px 30px; padding: 0; } - + pre { background: #eee; padding: 7px 30px; @@ -358,7 +358,7 @@ dl dl pre { margin-left: -90px; padding-left: 90px; } - + tt { background-color: #ecf0f3; color: #222; diff --git a/docs/_themes/flask/theme.conf b/docs/_themes/flask/theme.conf index 420c609..0b3d313 100644 --- a/docs/_themes/flask/theme.conf +++ b/docs/_themes/flask/theme.conf @@ -6,5 +6,5 @@ pygments_style = flask_theme_support.FlaskyStyle [options] index_logo = '' index_logo_height = 120px -touch_icon = +touch_icon = github_fork = hgrecco/pint diff --git a/docs/defining-quantities.rst b/docs/defining-quantities.rst index 7ab7157..845c81c 100644 --- a/docs/defining-quantities.rst +++ b/docs/defining-quantities.rst @@ -144,6 +144,20 @@ brackets to get the expected result: >>> Q_('3 l / (100 km)') <Quantity(0.03, 'liter / kilometer')> +Special strings for NaN (Not a Number) and inf(inity) are also handled in a case-insensitive fashion. +Note that, as usual, NaN != NaN. + +.. doctest:: + + >>> Q_('inf m') + <Quantity(inf, 'meter')> + >>> Q_('-INFINITY m') + <Quantity(-inf, 'meter')> + >>> Q_('nan m') + <Quantity(nan, 'meter')> + >>> Q_('NaN m') + <Quantity(nan, 'meter')> + .. note:: Since version 0.7, Pint **does not** use eval_ under the hood. This change removes the `serious security problems`_ that the system is exposed to when parsing information from untrusted sources. diff --git a/docs/getting.rst b/docs/getting.rst index c6f35cc..0afcea3 100644 --- a/docs/getting.rst +++ b/docs/getting.rst @@ -3,7 +3,7 @@ Installation ============ -Pint has no dependencies except Python_ itself. In runs on Python 3.7+. +Pint has no dependencies except Python_ itself. In runs on Python 3.8+. You can install it (or upgrade to the latest version) using pip_:: diff --git a/docs/index.rst b/docs/index.rst index 108b43e..806c0ff 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ Due to its modular design, you can extend (or even rewrite!) the complete list without changing the source code. It supports a lot of numpy mathematical operations **without monkey patching or wrapping numpy**. -It has a complete test coverage. It runs in Python 3.7+ with no other +It has a complete test coverage. It runs in Python 3.8+ with no other dependencies. It is licensed under a `BSD 3-clause style license`_. It is extremely easy and natural to use: diff --git a/docs/numpy.ipynb b/docs/numpy.ipynb index c221b53..34cbef4 100644 --- a/docs/numpy.ipynb +++ b/docs/numpy.ipynb @@ -503,4 +503,4 @@ }, "nbformat": 4, "nbformat_minor": 4 -}
\ No newline at end of file +} diff --git a/docs/performance.rst b/docs/performance.rst index 74a11d8..d2d3e64 100644 --- a/docs/performance.rst +++ b/docs/performance.rst @@ -37,23 +37,23 @@ This is especially important when using pint Quantities in conjunction with an i In [2]: def foobar_with_quantity(x): # find the value of x that equals q2 - + # assign x the same units as q2 qx = ureg(str(x)+str(q2.units)) - + # compare the two quantities, then take their magnitude because # brentq requires a dimensionless return type return (qx - q2).magnitude - + In [3]: def foobar_with_magnitude(x): # find the value of x that equals q2 - + # don't bother converting x to a quantity, just compare it with q2's magnitude return x - q2.magnitude - + In [4]: %timeit brentq(foobar_with_quantity,0,q2.magnitude) 1000 loops, best of 3: 310 µs per loop - + In [5]: %timeit brentq(foobar_with_magnitude,0,q2.magnitude) 1000000 loops, best of 3: 1.63 µs per loop |
