sciform 0.36.0__py3-none-any.whl → 0.38.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sciform
3
- Version: 0.36.0
3
+ Version: 0.38.0
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
@@ -9,6 +9,7 @@ Classifier: License :: OSI Approved :: MIT License
9
9
  Classifier: Development Status :: 4 - Beta
10
10
  Classifier: Programming Language :: Python
11
11
  Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.8
12
13
  Classifier: Programming Language :: Python :: 3.9
13
14
  Classifier: Programming Language :: Python :: 3.10
14
15
  Classifier: Programming Language :: Python :: 3.11
@@ -17,44 +18,56 @@ Classifier: Topic :: Education
17
18
  Classifier: Topic :: Scientific/Engineering
18
19
  Classifier: Topic :: Text Processing
19
20
  Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.8
20
22
  Description-Content-Type: text/x-rst
21
23
  License-File: LICENSE
22
- Provides-Extra: dev
23
- Requires-Dist: ruff ; extra == 'dev'
24
- Requires-Dist: coverage ; extra == 'dev'
25
- Requires-Dist: sphinx ; extra == 'dev'
26
- Requires-Dist: sphinx-rtd-theme ; extra == 'dev'
27
- Requires-Dist: sphinx-toolbox ; extra == 'dev'
28
- Requires-Dist: numpy ; extra == 'dev'
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
+ Provides-Extra: docs
29
+ Requires-Dist: sphinx ; extra == 'docs'
30
+ Requires-Dist: sphinx-rtd-dark-mode ; extra == 'docs'
31
+ Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
32
+ Requires-Dist: sphinx-toolbox ; extra == 'docs'
29
33
  Provides-Extra: examples
30
34
  Requires-Dist: numpy ; extra == 'examples'
31
35
  Requires-Dist: scipy ; extra == 'examples'
32
36
  Requires-Dist: matplotlib ; extra == 'examples'
33
37
  Requires-Dist: tabulate ; extra == 'examples'
34
38
  Requires-Dist: jupyter ; extra == 'examples'
39
+ Provides-Extra: test
40
+ Requires-Dist: coverage[toml] ; extra == 'test'
41
+ Requires-Dist: numpy ; extra == 'test'
42
+ Requires-Dist: ruff ==0.5.5 ; extra == 'test'
43
+ Requires-Dist: sciform[docs] ; extra == 'test'
35
44
 
36
- .. image:: https://www.repostatus.org/badges/latest/wip.svg
45
+ .. container::
46
+
47
+ |Repo Status| |pyOpenSci| |Documentation Status| |PyPI Version| |PyPI Python| |Coverage Status| |GH Workflow Status| |Zenodo|
48
+
49
+ .. |Repo Status| image:: https://www.repostatus.org/badges/latest/wip.svg
37
50
  :target: https://www.repostatus.org/#wip
38
51
  :alt: Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.
39
- .. image:: https://tinyurl.com/y22nb8up
52
+ .. |pyOpenSci| image:: https://tinyurl.com/y22nb8up
40
53
  :target: https://github.com/pyOpenSci/software-review/issues/121
41
54
  :alt: pyOpenSci
42
- .. image:: https://img.shields.io/readthedocs/sciform?logo=readthedocs&link=https%3A%2F%2Fsciform.readthedocs.io%2Fen%2Fstable%2F
55
+ .. |Documentation Status| image:: https://img.shields.io/readthedocs/sciform?logo=readthedocs&link=https%3A%2F%2Fsciform.readthedocs.io%2Fen%2Fstable%2F
43
56
  :target: https://sciform.readthedocs.io/en/stable/
44
57
  :alt: Read the Docs
45
- .. image:: https://img.shields.io/pypi/v/sciform?logo=pypi
58
+ .. |PyPI Version| image:: https://img.shields.io/pypi/v/sciform?logo=pypi
46
59
  :target: https://pypi.org/project/sciform/
47
60
  :alt: PyPI - Version
48
- .. image:: https://img.shields.io/pypi/pyversions/sciform?logo=python
61
+ .. |PyPI Python| image:: https://img.shields.io/pypi/pyversions/sciform?logo=python
49
62
  :target: https://pypi.org/project/sciform/
50
63
  :alt: PyPI - Python Version
51
- .. image:: https://img.shields.io/codecov/c/github/jagerber48/sciform?logo=codecov
64
+ .. |Coverage Status| image:: https://img.shields.io/codecov/c/github/jagerber48/sciform?logo=codecov
52
65
  :target: https://codecov.io/gh/jagerber48/sciform
53
66
  :alt: Codecov
54
- .. image:: https://img.shields.io/github/actions/workflow/status/jagerber48/sciform/python-package.yml?logo=github%20actions
67
+ .. |GH Workflow Status| image:: https://img.shields.io/github/actions/workflow/status/jagerber48/sciform/python-package.yml?logo=github%20actions
55
68
  :target: https://github.com/jagerber48/sciform/blob/main/.github/workflows/python-package.yml
56
69
  :alt: GitHub Workflow Status
57
- .. image:: https://zenodo.org/badge/645611310.svg
70
+ .. |Zenodo| image:: https://zenodo.org/badge/645611310.svg
58
71
  :target: https://zenodo.org/doi/10.5281/zenodo.10645272
59
72
  :alt: Zenodo
60
73
 
@@ -63,9 +76,9 @@ Requires-Dist: jupyter ; extra == 'examples'
63
76
  sciform
64
77
  #######
65
78
 
66
- | **Repository:** `<https://github.com/jagerber48/sciform>`_
67
- | **Documentation:** `<https://sciform.readthedocs.io/en/stable/>`_
68
- | **PyPi:** `<https://pypi.org/project/sciform/>`_
79
+ | **Repository:** `<https://github.com/jagerber48/sciform>`_
80
+ | **Documentation:** `<https://sciform.readthedocs.io/en/stable/>`_
81
+ | **PyPi:** `<https://pypi.org/project/sciform/>`_
69
82
 
70
83
  We would greatly appreciate you taking the time to fill out the
71
84
  `User Experience Survey <https://forms.gle/TkkKgywYyEMKu9U37>`_ to help
@@ -100,7 +113,7 @@ or install the latest development version from
100
113
 
101
114
  python -m pip install git+https://github.com/jagerber48/sciform.git
102
115
 
103
- ``sciform`` is compatible with Python versions >=3.9.
116
+ ``sciform`` is compatible with Python versions >=3.8.
104
117
 
105
118
  =====
106
119
  Usage
@@ -112,55 +125,55 @@ For many more details see
112
125
 
113
126
  ``sciform`` provides a wide variety of formatting options which can be
114
127
  controlled when constructing ``Formatter`` objects which are then used
115
- to format numbers into strings according to the selected options.
116
-
117
- >>> from sciform import Formatter
118
- >>> formatter = Formatter(
119
- ... round_mode="dec_place", ndigits=6, upper_separator=" ", lower_separator=" "
120
- ... )
121
- >>> print(formatter(51413.14159265359))
122
- 51 413.141 593
123
- >>> formatter = Formatter(round_mode="sig_fig", ndigits=4, exp_mode="engineering")
124
- >>> print(formatter(123456.78))
125
- 123.5e+03
128
+ to format numbers into strings according to the selected options::
129
+
130
+ >>> from sciform import Formatter
131
+ >>> formatter = Formatter(
132
+ ... round_mode="dec_place", ndigits=6, upper_separator=" ", lower_separator=" "
133
+ ... )
134
+ >>> print(formatter(51413.14159265359))
135
+ 51 413.141 593
136
+ >>> formatter = Formatter(round_mode="sig_fig", ndigits=4, exp_mode="engineering")
137
+ >>> print(formatter(123456.78))
138
+ 123.5e+03
126
139
 
127
140
  Users can also format numbers by constructing ``SciNum`` objects and
128
141
  using string formatting to format the ``SciNum`` instances according
129
- to a custom FSML.
142
+ to a custom FSML::
130
143
 
131
- >>> from sciform import SciNum
132
- >>> num = SciNum(12345)
133
- >>> print(f"{num:!2f}")
134
- 12000
135
- >>> print(f"{num:!2r}")
136
- 12e+03
144
+ >>> from sciform import SciNum
145
+ >>> num = SciNum(12345)
146
+ >>> print(f"{num:!2f}")
147
+ 12000
148
+ >>> print(f"{num:!2r}")
149
+ 12e+03
137
150
 
138
151
  In addition to formatting individual numbers, ``sciform`` can be used
139
152
  to format pairs of numbers as value/uncertainty pairs.
140
153
  This can be done by passing two numbers into a ``Formatter`` call or by
141
- using the ``SciNum`` object.
154
+ using the ``SciNum`` object::
142
155
 
143
- >>> formatter = Formatter(ndigits=2, upper_separator=" ", lower_separator=" ")
144
- >>> print(formatter(123456.654321, 0.00345))
145
- 123 456.654 3 ± 0.003 4
146
- >>> formatter = Formatter(ndigits=4, exp_mode="engineering")
147
- >>> print(formatter(123456.654321, 0.00345))
148
- (123.456654321 ± 0.000003450)e+03
156
+ >>> formatter = Formatter(ndigits=2, upper_separator=" ", lower_separator=" ")
157
+ >>> print(formatter(123456.654321, 0.00345))
158
+ 123 456.654 3 ± 0.003 4
159
+ >>> formatter = Formatter(ndigits=4, exp_mode="engineering")
160
+ >>> print(formatter(123456.654321, 0.00345))
161
+ (123.456654321 ± 0.000003450)e+03
149
162
 
150
- >>> num = SciNum(123456.654321, 0.00345)
151
- >>> print(f"{num:!2f}")
152
- 123456.6543 ± 0.0034
153
- >>> print(f"{num:!2f()}")
154
- 123456.6543(34)
163
+ >>> num = SciNum(123456.654321, 0.00345)
164
+ >>> print(f"{num:!2f}")
165
+ 123456.6543 ± 0.0034
166
+ >>> print(f"{num:!2f()}")
167
+ 123456.6543(34)
155
168
 
156
169
  Note that the above examples demonstrate that ``sciform`` uses
157
170
  `"round-to-even" <https://en.wikipedia.org/wiki/Rounding#Rounding_half_to_even>`_
158
- rounding.
171
+ rounding::
159
172
 
160
- >>> print(f"{SciNum(865):!2}")
161
- 860
162
- >>> print(f"{SciNum(875):!2}")
163
- 880
173
+ >>> print(f"{SciNum(865):!2}")
174
+ 860
175
+ >>> print(f"{SciNum(875):!2}")
176
+ 880
164
177
 
165
178
  See `Formatting Options <https://sciform.readthedocs.io/en/stable/options.html>`_,
166
179
  `Format Specification Mini-Language <https://sciform.readthedocs.io/en/stable/fsml.html>`_
@@ -0,0 +1,31 @@
1
+ sciform/__init__.py,sha256=Lnb1fep9vjJ7n4U5YdNqRkq9saXuRvppedpW1TZm99Y,781
2
+ sciform/api/__init__.py,sha256=kWXKOuVgwn3580EBGGs4t2uK7_uBgjfvQq2r8b9ZPrM,24
3
+ sciform/api/formatted_number.py,sha256=VdQGRXmUy_Pwc2SeYT8KlZMJBJDu0maI0HHv9DXu1fQ,2804
4
+ sciform/api/formatter.py,sha256=0eOLQmrNnhDO05rbMMOhPjYUYYkW5fT-SiUAxGKXWEI,15554
5
+ sciform/api/global_configuration.py,sha256=iSmGcnfs-2cvWz27t9ka9ibDuN732sLwDsLJTi8SA-g,6866
6
+ sciform/api/scinum.py,sha256=XF4QiBAlehEKnk_NwDDVWmLnRDwfEalmuzC8b2qUE4Q,3363
7
+ sciform/format_utils/__init__.py,sha256=9tCbjsOOiqvw0DoMUo9qcIC8pFykfVZZ8wkEIRAh-OE,132
8
+ sciform/format_utils/exp_translations.py,sha256=uh9ZxDKcGcMVSNwj7qkr5TSA6MINIaU1RHZeqKVwEQ0,575
9
+ sciform/format_utils/exponents.py,sha256=khG9mkHRG-qb2Xnd_lpkLXwV8KcHUJekgC8MwgfSL_U,3976
10
+ sciform/format_utils/grouping.py,sha256=1hZjjVKRUy477LGGFniZwwEHHBDaSb6E0K3SAeCACVY,1641
11
+ sciform/format_utils/make_strings.py,sha256=4g1E3UBDLeoF272OpIGCiuzeZ4KsDjWNiXvbMIfr3sg,5258
12
+ sciform/format_utils/numbers.py,sha256=L3J8B7GR6RWNaYthDmnY5d4bLYBviCYw-Evqb754VTw,5799
13
+ sciform/format_utils/rounding.py,sha256=VkvIg_UNpGfBG8QQQVGLZPwNfw5Tj3jlM8Wgx1r6ils,3491
14
+ sciform/formatting/__init__.py,sha256=T_DnF4vkeAQx1xuzff7rRZbWj-hEbNI6Pj2D2831L9E,38
15
+ sciform/formatting/fsml.py,sha256=J2Zd7RD4E32hNTP2Vo_2PEvzHBt3aIUerhLT72stovQ,3843
16
+ sciform/formatting/number_formatting.py,sha256=_4SxAzo3VLp6_ThrJfn9yQu3rH_0_27NOftNSPfIMA8,12268
17
+ sciform/formatting/output_conversion.py,sha256=TdcfQa0p7S7iIkqcwVYbxCGwoGu4mPOV3XzjABnaGmA,5523
18
+ sciform/formatting/parser.py,sha256=58noOOyg5m3NKJwGfEEwiUivzm5vGPG3K1_OXIrrVAk,16310
19
+ sciform/options/__init__.py,sha256=tw_CZHaNrdixZoQyG6ZD5UMKkQxXok0qBQCxt28Gh20,51
20
+ sciform/options/conversion.py,sha256=2ad0Mwwb7qqJ5xClevxaUVkVznokQBmAVVewh_5-7jU,4146
21
+ sciform/options/finalized_options.py,sha256=r38T1qp2sLD0mVIOovfax2Q46zb7yjjypr1CpUsqMCA,1262
22
+ sciform/options/global_options.py,sha256=T_OXFKi2qO5PV-LTZt9ClppWYsUmStBgyQqFuoX6idM,697
23
+ sciform/options/input_options.py,sha256=ibUMS9q_hdf9lms90hA6FzbEZpe-KVdZg5K-A1H7j3Q,3806
24
+ sciform/options/option_types.py,sha256=nZa_HZHlRf6ILbKxXbP1lqB3s9WoJRYv0uLQonY5ud8,2346
25
+ sciform/options/populated_options.py,sha256=7TBuSxBvcUopF16NIMQuGoAT6B0vq0HLigO7qrIld1A,4961
26
+ sciform/options/validation.py,sha256=b70AE6AqbNjEsBkVXwYDQRCQnwVbqWWJ7eUxh2jkyqU,8092
27
+ sciform-0.38.0.dist-info/LICENSE,sha256=-oyCEZu-6HLrRSfRg44uuNDE0c59GVEdqYIgidqSP70,1056
28
+ sciform-0.38.0.dist-info/METADATA,sha256=nkbgc_oPKFgkBrPK3wRVXuXIWJvMnXSbp7ugU-PTUGk,8990
29
+ sciform-0.38.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
30
+ sciform-0.38.0.dist-info/top_level.txt,sha256=mC01YOQ-1u5pDk9BJia-pQKLUMvkreMsldDpFcp7NV8,8
31
+ sciform-0.38.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: setuptools (75.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,31 +0,0 @@
1
- sciform/__init__.py,sha256=gE7q7AYCOqjjy98_H1mIW3CSqPBbkP-SI8clpVFVKZw,881
2
- sciform/api/__init__.py,sha256=kWXKOuVgwn3580EBGGs4t2uK7_uBgjfvQq2r8b9ZPrM,24
3
- sciform/api/formatted_number.py,sha256=VdQGRXmUy_Pwc2SeYT8KlZMJBJDu0maI0HHv9DXu1fQ,2804
4
- sciform/api/formatter.py,sha256=t0AduoIny7HlCBzjlBwFPXzN00tiaMvZCTs8tWqHfnA,16083
5
- sciform/api/global_configuration.py,sha256=jqX-bWTtYjghtfyx3B7S5OIi88PMZC4YMmRBtaNxGVE,7052
6
- sciform/api/scinum.py,sha256=XF4QiBAlehEKnk_NwDDVWmLnRDwfEalmuzC8b2qUE4Q,3363
7
- sciform/format_utils/__init__.py,sha256=9tCbjsOOiqvw0DoMUo9qcIC8pFykfVZZ8wkEIRAh-OE,132
8
- sciform/format_utils/exp_translations.py,sha256=uh9ZxDKcGcMVSNwj7qkr5TSA6MINIaU1RHZeqKVwEQ0,575
9
- sciform/format_utils/exponents.py,sha256=fXRoZ1pqY2kuW9UliTDs0fdcKMJTtWFnHpqe2e2AidE,4017
10
- sciform/format_utils/grouping.py,sha256=1hZjjVKRUy477LGGFniZwwEHHBDaSb6E0K3SAeCACVY,1641
11
- sciform/format_utils/make_strings.py,sha256=REyFe7taSq6ay5IgM2iPvfB5A9SAFT7Ie4Uo6_6I5PU,4802
12
- sciform/format_utils/numbers.py,sha256=DTkHxAhTrwKqOdbjt5qjTVJwdyJP4lTar-olmyLWbq4,5845
13
- sciform/format_utils/rounding.py,sha256=Ie09AIpQmiCaSi4cH98VyR34u3gsBxM1X5AWqZ3CgbE,3655
14
- sciform/formatting/__init__.py,sha256=T_DnF4vkeAQx1xuzff7rRZbWj-hEbNI6Pj2D2831L9E,38
15
- sciform/formatting/fsml.py,sha256=r22RiBPrkDaiPgE2VQrtGms9aBmWqolymsmmnp-z57s,3378
16
- sciform/formatting/number_formatting.py,sha256=mvT15rwSFtogaM_JFqXzFQMA9zdT5vmW8QWfYMrJ-AM,10947
17
- sciform/formatting/output_conversion.py,sha256=TdcfQa0p7S7iIkqcwVYbxCGwoGu4mPOV3XzjABnaGmA,5523
18
- sciform/formatting/parser.py,sha256=58noOOyg5m3NKJwGfEEwiUivzm5vGPG3K1_OXIrrVAk,16310
19
- sciform/options/__init__.py,sha256=tw_CZHaNrdixZoQyG6ZD5UMKkQxXok0qBQCxt28Gh20,51
20
- sciform/options/conversion.py,sha256=HdFUoUmYFhcMjhB5i-LikE20seDJkb9sq3RblERxkck,4079
21
- sciform/options/finalized_options.py,sha256=CdNTcASBYnYIr9wDZ_NLN8HiU3fdbtoL2CQbfJhV7go,1487
22
- sciform/options/global_options.py,sha256=bSOd3J7-U-R-t-JqZdQI2Jo2F6O9xNijmCkTpcrOybY,805
23
- sciform/options/input_options.py,sha256=c3mihX5BjmFNeqH4N1rJ9emtOFQf43Enj2YLmy8RP4Y,3885
24
- sciform/options/option_types.py,sha256=8slohyIPHeAdgq3aszoNq9RJl6ibageFqDMxeC9NhrQ,3893
25
- sciform/options/populated_options.py,sha256=eo2MNTXUElTMnhgp1CcEp9ym5G9E6v9GxSZwHt3AnKI,5085
26
- sciform/options/validation.py,sha256=ghkfGBp29AMdGsgYU90YFtfuj8KxCiYDJngsAMuJ0ys,8064
27
- sciform-0.36.0.dist-info/LICENSE,sha256=-oyCEZu-6HLrRSfRg44uuNDE0c59GVEdqYIgidqSP70,1056
28
- sciform-0.36.0.dist-info/METADATA,sha256=zYiyov5H0ValkjgGQ_e-FcKkmWAHpW9adzVPSdTJ8yo,8278
29
- sciform-0.36.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
30
- sciform-0.36.0.dist-info/top_level.txt,sha256=mC01YOQ-1u5pDk9BJia-pQKLUMvkreMsldDpFcp7NV8,8
31
- sciform-0.36.0.dist-info/RECORD,,