sciform 0.39.0__py3-none-any.whl → 0.39.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sciform/formatting/number_formatting.py +8 -2
- {sciform-0.39.0.dist-info → sciform-0.39.1.dist-info}/METADATA +21 -20
- {sciform-0.39.0.dist-info → sciform-0.39.1.dist-info}/RECORD +6 -6
- {sciform-0.39.0.dist-info → sciform-0.39.1.dist-info}/WHEEL +1 -1
- {sciform-0.39.0.dist-info → sciform-0.39.1.dist-info/licenses}/LICENSE +0 -0
- {sciform-0.39.0.dist-info → sciform-0.39.1.dist-info}/top_level.txt +0 -0
@@ -4,6 +4,7 @@ from __future__ import annotations
|
|
4
4
|
|
5
5
|
from dataclasses import replace
|
6
6
|
from decimal import Decimal
|
7
|
+
from math import isfinite
|
7
8
|
from typing import TYPE_CHECKING, cast
|
8
9
|
|
9
10
|
from sciform.api.formatted_number import FormattedNumber
|
@@ -177,7 +178,7 @@ def format_num(num: Decimal, options: FinalizedOptions) -> str:
|
|
177
178
|
return result
|
178
179
|
|
179
180
|
|
180
|
-
def format_val_unc(val: Decimal, unc: Decimal, options: FinalizedOptions) -> str:
|
181
|
+
def format_val_unc(val: Decimal, unc: Decimal, options: FinalizedOptions) -> str: # noqa: PLR0915
|
181
182
|
"""Format value/uncertainty pair according to input options."""
|
182
183
|
exp_mode = options.exp_mode
|
183
184
|
|
@@ -259,7 +260,12 @@ def format_val_unc(val: Decimal, unc: Decimal, options: FinalizedOptions) -> str
|
|
259
260
|
ndigits that will be used for separate digits-past-the-decimal rounding for the
|
260
261
|
value and uncertainty.
|
261
262
|
"""
|
262
|
-
|
263
|
+
if (isfinite(val) and val_rounded != 0) or (
|
264
|
+
isfinite(unc_rounded) and unc_rounded != 0
|
265
|
+
):
|
266
|
+
ndigits = -round_digit + exp_val
|
267
|
+
else:
|
268
|
+
ndigits = 0
|
263
269
|
|
264
270
|
val_mantissa, _ = get_mantissa_exp(
|
265
271
|
val_rounded,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: sciform
|
3
|
-
Version: 0.39.
|
3
|
+
Version: 0.39.1
|
4
4
|
Summary: A package for formatting numbers into scientific formatted strings.
|
5
5
|
Author-email: Justin Gerber <justin.gerber48@gmail.com>
|
6
6
|
Project-URL: homepage, https://github.com/jagerber48/sciform
|
@@ -21,26 +21,27 @@ Classifier: Topic :: Utilities
|
|
21
21
|
Requires-Python: >=3.8
|
22
22
|
Description-Content-Type: text/x-rst
|
23
23
|
License-File: LICENSE
|
24
|
-
Provides-Extra: all
|
25
|
-
Requires-Dist: sciform[docs] ; extra == 'all'
|
26
|
-
Requires-Dist: sciform[test] ; extra == 'all'
|
27
|
-
Requires-Dist: sciform[examples] ; extra == 'all'
|
28
24
|
Provides-Extra: docs
|
29
|
-
Requires-Dist: sphinx
|
30
|
-
Requires-Dist: sphinx-rtd-dark-mode
|
31
|
-
Requires-Dist: sphinx-rtd-theme
|
32
|
-
Requires-Dist: sphinx-toolbox
|
33
|
-
Provides-Extra: examples
|
34
|
-
Requires-Dist: numpy ; extra == 'examples'
|
35
|
-
Requires-Dist: scipy ; extra == 'examples'
|
36
|
-
Requires-Dist: matplotlib ; extra == 'examples'
|
37
|
-
Requires-Dist: tabulate ; extra == 'examples'
|
38
|
-
Requires-Dist: jupyter ; extra == 'examples'
|
25
|
+
Requires-Dist: sphinx; extra == "docs"
|
26
|
+
Requires-Dist: sphinx-rtd-dark-mode; extra == "docs"
|
27
|
+
Requires-Dist: sphinx-rtd-theme; extra == "docs"
|
28
|
+
Requires-Dist: sphinx-toolbox; extra == "docs"
|
39
29
|
Provides-Extra: test
|
40
|
-
Requires-Dist: coverage[toml]
|
41
|
-
Requires-Dist: numpy
|
42
|
-
Requires-Dist: ruff
|
43
|
-
Requires-Dist: sciform[docs]
|
30
|
+
Requires-Dist: coverage[toml]; extra == "test"
|
31
|
+
Requires-Dist: numpy; extra == "test"
|
32
|
+
Requires-Dist: ruff==0.5.5; extra == "test"
|
33
|
+
Requires-Dist: sciform[docs]; extra == "test"
|
34
|
+
Provides-Extra: examples
|
35
|
+
Requires-Dist: numpy; extra == "examples"
|
36
|
+
Requires-Dist: scipy; extra == "examples"
|
37
|
+
Requires-Dist: matplotlib; extra == "examples"
|
38
|
+
Requires-Dist: tabulate; extra == "examples"
|
39
|
+
Requires-Dist: jupyter; extra == "examples"
|
40
|
+
Provides-Extra: all
|
41
|
+
Requires-Dist: sciform[docs]; extra == "all"
|
42
|
+
Requires-Dist: sciform[test]; extra == "all"
|
43
|
+
Requires-Dist: sciform[examples]; extra == "all"
|
44
|
+
Dynamic: license-file
|
44
45
|
|
45
46
|
.. container::
|
46
47
|
|
@@ -13,7 +13,7 @@ sciform/format_utils/numbers.py,sha256=Se3F9qTooRrtBw_b9n-Nx4Nd1tkV-44glO1KZ9kCj
|
|
13
13
|
sciform/format_utils/rounding.py,sha256=VkvIg_UNpGfBG8QQQVGLZPwNfw5Tj3jlM8Wgx1r6ils,3491
|
14
14
|
sciform/formatting/__init__.py,sha256=T_DnF4vkeAQx1xuzff7rRZbWj-hEbNI6Pj2D2831L9E,38
|
15
15
|
sciform/formatting/fsml.py,sha256=-dLnJ0ZfmQw4XdeAi1EF9brgiGsFLOIJmBWCzr9bTEc,3679
|
16
|
-
sciform/formatting/number_formatting.py,sha256=
|
16
|
+
sciform/formatting/number_formatting.py,sha256=88RbmgUsomNeZVzCiviT4DpziiUa5NgmsyQkDfGscsQ,12006
|
17
17
|
sciform/formatting/output_conversion.py,sha256=kwYJsj33RE1BVPMfK28wYni6KhcMhfHNap78cQfE-qo,5136
|
18
18
|
sciform/formatting/parser.py,sha256=j9rdxXrV_6gMD0_AdvdS4PJ5aGMAxyJ9yRSr2_WvDLM,15190
|
19
19
|
sciform/options/__init__.py,sha256=tw_CZHaNrdixZoQyG6ZD5UMKkQxXok0qBQCxt28Gh20,51
|
@@ -24,8 +24,8 @@ sciform/options/input_options.py,sha256=0PIc4JINvY2XRPpv9s4zhclPsII3MTT77j4Kf1tW
|
|
24
24
|
sciform/options/option_types.py,sha256=nEzkj3QHRSGEYr6R2hCOKtRcHIwhHS9BD8QRAX931vM,2262
|
25
25
|
sciform/options/populated_options.py,sha256=0n0vWH8ixNxwWGxAJdGzi46--noDfiOrOJpx4Hu6iaw,4865
|
26
26
|
sciform/options/validation.py,sha256=8Zg5dcp-sPqyZWo5zMZVMzAmFS5KlA8kTjdMGBG9VmU,7754
|
27
|
-
sciform-0.39.
|
28
|
-
sciform-0.39.
|
29
|
-
sciform-0.39.
|
30
|
-
sciform-0.39.
|
31
|
-
sciform-0.39.
|
27
|
+
sciform-0.39.1.dist-info/licenses/LICENSE,sha256=-oyCEZu-6HLrRSfRg44uuNDE0c59GVEdqYIgidqSP70,1056
|
28
|
+
sciform-0.39.1.dist-info/METADATA,sha256=l6WuT6agTe35n1sTH1i43y_EQKqv3a6Vp9pbLJ-xTRk,8942
|
29
|
+
sciform-0.39.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
30
|
+
sciform-0.39.1.dist-info/top_level.txt,sha256=mC01YOQ-1u5pDk9BJia-pQKLUMvkreMsldDpFcp7NV8,8
|
31
|
+
sciform-0.39.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|