metrolopy 0.6.3__py3-none-any.whl → 0.6.5__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.
metrolopy/unitparser.py CHANGED
@@ -134,7 +134,7 @@ class _UnitParser:
134
134
  c = self.txt[self.i]
135
135
  if c == '(':
136
136
  if par == 0:
137
- if cl.ispace() or cl == '*':
137
+ if cl.isspace() or cl == '*':
138
138
  f = float(et)
139
139
  if np.modf(f)[0] == 0:
140
140
  return int(f)
@@ -147,7 +147,7 @@ class _UnitParser:
147
147
  else:
148
148
  par += 1
149
149
  elif c == '[':
150
- if cl.ispace() or cl == '*':
150
+ if cl.isspace() or cl == '*':
151
151
  f = float(et)
152
152
  if np.modf(f)[0] == 0:
153
153
  return int(f)
metrolopy/version.py CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # module version
4
4
 
5
- # Copyright (C) 2019 National Research Council Canada
5
+ # Copyright (C) 2025 National Research Council Canada
6
6
  # Author: Harold Parks
7
7
 
8
8
  # This file is part of MetroloPy.
@@ -20,4 +20,4 @@
20
20
  # You should have received a copy of the GNU General Public License along with
21
21
  # MetroloPy. If not, see <http://www.gnu.org/licenses/>.
22
22
 
23
- __version__ = '0.6.3'
23
+ __version__ = '0.6.5'
@@ -1,95 +1,102 @@
1
- Metadata-Version: 2.1
2
- Name: metrolopy
3
- Version: 0.6.3
4
- Summary: tools for dealing with measured quantities: uncertainty propagation and unit conversion
5
- Home-page: http://nrc-cnrc.github.io/MetroloPy/
6
- Author: Harold Parks, National Research Council Canada
7
- Author-email: parksh@nrc.ca
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Operating System :: OS Independent
12
- Classifier: Development Status :: 4 - Beta
13
- Classifier: Framework :: Jupyter
14
- Classifier: Framework :: IPython
15
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
16
- Classifier: Intended Audience :: Science/Research
17
- Classifier: Intended Audience :: Education
18
- Classifier: Topic :: Scientific/Engineering :: Physics
19
- Requires-Python: >=3.5
20
- Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: numpy (>=1.13)
23
- Requires-Dist: scipy
24
- Requires-Dist: matplotlib
25
- Requires-Dist: pandas
26
- Provides-Extra: pretty
27
- Requires-Dist: IPython ; extra == 'pretty'
28
-
29
- # MetroloPy
30
-
31
- tools for dealing with physical quantities: uncertainty propagation and unit conversion
32
-
33
- ---
34
-
35
- MetroloPy is a pure python package and requires Python 3.5 or later and the SciPy stack (NumPy, SciPy and Pandas). It looks best in a Jupyter Notebook.
36
-
37
- Install MetroloPy with `pip install metrolopy` or
38
- `conda install -c conda-forge metrolopy`.
39
-
40
- Physical quantities can then be represented in Python as `gummy` objects with an uncertainty and (or) a unit:
41
-
42
- <pre><code>&gt;&gt;&gt; import metrolopy as uc
43
- &gt;&gt;&gt; a = uc.gummy(1.2345,u=0.0234,unit='cm')
44
- &gt;&gt;&gt; a
45
- 1.234(23) cm
46
-
47
- &gt;&gt;&gt; b = uc.gummy(3.034,u=0.174,unit='mm')
48
- &gt;&gt;&gt; f = uc.gummy(uc.UniformDist(center=0.9345,half_width=0.096),unit='N')
49
- &gt;&gt;&gt; p = f/(a*b)
50
- &gt;&gt;&gt; p
51
- 2.50(21) N/cm<sup>2</sup>
52
-
53
- &gt;&gt;&gt; p.unit = 'kPa'
54
- &gt;&gt;&gt; p.uunit = '%'
55
- &gt;&gt;&gt; p
56
- 25.0 kPa &plusmn; 8.5%
57
- </code></pre>
58
-
59
- MetroloPy can do much more including Monte-Carlo uncertainty propagation, generating uncertainty budget tables, and curve fitting. It can also handle expanded uncertainties, degrees of freedom, correlated quantities, and complex valued quantities. See:
60
-
61
- * [a tutorial](https://nrc-cnrc.github.io/MetroloPy/_build/html/_static/tutorial.html) (or <a href="https://nrc-cnrc.github.io/MetroloPy/_build/html/_downloads/tutorial.ipynb" download> download the tutorial as Jupyter notebook</a>)
62
- * [the documentation](https://nrc-cnrc.github.io/MetroloPy/)
63
- * [the issues page on GitHub](https://github.com/nrc-cnrc/Metrolopy/issues)
64
- * [a list of the units built into MetroloPy](https://nrc-cnrc.github.io/MetroloPy/_static/units.html)
65
- * [a list of the physical constants built into MetroloPy](https://nrc-cnrc.github.io/MetroloPy/_static/constants.html)
66
-
67
- ## new in version 0.6.0
68
-
69
- * A constant library has been added with physical constants that can be accessed
70
- by name or alias with the `constant` function. The `search_constants` function
71
- with no argument gives a listing of all built-in constants. Each constant
72
- definition includes any correlations with other constants.
73
-
74
- * The `Quantity` class has been added to represent a general numerical value
75
- multiplied by a unit and the `unit` function has been added to retrieve
76
- `Unit` instances from the unit library by name or alias. `Unit` instances
77
- can now be multiplied and divided by other `Unit` instances to produce
78
- composite units, can be multiplied and divided by numbers to produce
79
- `Quantity` instances or multiply or divide `Quantity` instances. The
80
- `gummy` class is now a subclass of `Quantity` with a `nummy` value rather
81
- than a subclass of `nummy`. A `QuantityArray` class has been introduced
82
- to represent an array of values all with the same unit. Multiplying a `Unit`
83
- instance by a list, tuple, or numpy array produces a `QuantityArray` instance.
84
-
85
- * The `immy` class has been introduced as an `ummy` valued counterpart of the
86
- `jummy` class for representing complex values with uncertainties. `immy`
87
- and `jummy` values can now be displayed in a polar representation in addition
88
- to a cartesian representation. `immy` and `jummy` .r and .phi properties
89
- have been added to access the magnitude and argument of the values as a
90
- complement to the .real and .imag properties.
91
-
92
-
93
-
94
-
95
-
1
+ Metadata-Version: 2.4
2
+ Name: metrolopy
3
+ Version: 0.6.5
4
+ Summary: tools for dealing with measured quantities: uncertainty propagation and unit conversion
5
+ Home-page: http://nrc-cnrc.github.io/MetroloPy/
6
+ Author: Harold Parks, National Research Council Canada
7
+ Author-email: parksh@nrc.ca
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Framework :: Jupyter
12
+ Classifier: Framework :: IPython
13
+ Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: Intended Audience :: Education
16
+ Classifier: Topic :: Scientific/Engineering :: Physics
17
+ Requires-Python: >=3.5
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: numpy>=1.13
21
+ Requires-Dist: scipy
22
+ Requires-Dist: matplotlib
23
+ Requires-Dist: pandas
24
+ Provides-Extra: pretty
25
+ Requires-Dist: IPython; extra == "pretty"
26
+ Dynamic: author
27
+ Dynamic: author-email
28
+ Dynamic: classifier
29
+ Dynamic: description
30
+ Dynamic: description-content-type
31
+ Dynamic: home-page
32
+ Dynamic: license-file
33
+ Dynamic: provides-extra
34
+ Dynamic: requires-dist
35
+ Dynamic: requires-python
36
+ Dynamic: summary
37
+
38
+ # MetroloPy
39
+
40
+ tools for dealing with physical quantities: uncertainty propagation and unit conversion
41
+
42
+ ---
43
+
44
+ MetroloPy is a pure python package and requires Python 3.5 or later and the SciPy stack (NumPy, SciPy and Pandas). It looks best in a Jupyter Notebook.
45
+
46
+ Install MetroloPy with `pip install metrolopy` or
47
+ `conda install -c conda-forge metrolopy`.
48
+
49
+ Physical quantities can then be represented in Python as `gummy` objects with an uncertainty and (or) a unit:
50
+
51
+ <pre><code>&gt;&gt;&gt; import metrolopy as uc
52
+ &gt;&gt;&gt; a = uc.gummy(1.2345,u=0.0234,unit='cm')
53
+ &gt;&gt;&gt; a
54
+ 1.234(23) cm
55
+
56
+ &gt;&gt;&gt; b = uc.gummy(3.034,u=0.174,unit='mm')
57
+ &gt;&gt;&gt; f = uc.gummy(uc.UniformDist(center=0.9345,half_width=0.096),unit='N')
58
+ &gt;&gt;&gt; p = f/(a*b)
59
+ &gt;&gt;&gt; p
60
+ 2.50(21) N/cm<sup>2</sup>
61
+
62
+ &gt;&gt;&gt; p.unit = 'kPa'
63
+ &gt;&gt;&gt; p.uunit = '%'
64
+ &gt;&gt;&gt; p
65
+ 25.0 kPa &plusmn; 8.5%
66
+ </code></pre>
67
+
68
+ MetroloPy can do much more including Monte-Carlo uncertainty propagation, generating uncertainty budget tables, and curve fitting. It can also handle expanded uncertainties, degrees of freedom, correlated quantities, and complex valued quantities. See:
69
+
70
+ * [a tutorial](https://nrc-cnrc.github.io/MetroloPy/_build/html/_static/tutorial.html) (or <a href="https://nrc-cnrc.github.io/MetroloPy/_build/html/_downloads/tutorial.ipynb" download> download the tutorial as Jupyter notebook</a>)
71
+ * [the documentation](https://nrc-cnrc.github.io/MetroloPy/)
72
+ * [the issues page on GitHub](https://github.com/nrc-cnrc/Metrolopy/issues)
73
+ * [a list of the units built into MetroloPy](https://nrc-cnrc.github.io/MetroloPy/_static/units.html)
74
+ * [a list of the physical constants built into MetroloPy](https://nrc-cnrc.github.io/MetroloPy/_static/constants.html)
75
+
76
+ ## new in version 0.6.0
77
+
78
+ * A constant library has been added with physical constants that can be accessed
79
+ by name or alias with the `constant` function. The `search_constants` function
80
+ with no argument gives a listing of all built-in constants. Each constant
81
+ definition includes any correlations with other constants.
82
+
83
+ * The `Quantity` class has been added to represent a general numerical value
84
+ multiplied by a unit and the `unit` function has been added to retrieve
85
+ `Unit` instances from the unit library by name or alias. `Unit` instances
86
+ can now be multiplied and divided by other `Unit` instances to produce
87
+ composite units, can be multiplied and divided by numbers to produce
88
+ `Quantity` instances or multiply or divide `Quantity` instances. The
89
+ `gummy` class is now a subclass of `Quantity` with a `nummy` value rather
90
+ than a subclass of `nummy`. A `QuantityArray` class has been introduced
91
+ to represent an array of values all with the same unit. Multiplying a `Unit`
92
+ instance by a list, tuple, or numpy array produces a `QuantityArray` instance.
93
+
94
+ * The `immy` class has been introduced as an `ummy` valued counterpart of the
95
+ `jummy` class for representing complex values with uncertainties. `immy`
96
+ and `jummy` values can now be displayed in a polar representation in addition
97
+ to a cartesian representation. `immy` and `jummy` .r and .phi properties
98
+ have been added to access the magnitude and argument of the values as a
99
+ complement to the .real and .imag properties.
100
+
101
+
102
+
@@ -1,14 +1,14 @@
1
1
  metrolopy/__init__.py,sha256=0v85v_dekYLX9ZdvqWL5G9mYAhWmGB6BjhpKDQ590O8,1567
2
- metrolopy/budget.py,sha256=RJHuUCG19iphadETFbRzshmv6ceNUDy538x4wi7FYMA,51387
2
+ metrolopy/budget.py,sha256=UFABTvfJvOyI_a8BX6BtJTjAJA-ufZ2YYW1lf7B2GgA,51388
3
3
  metrolopy/codata2018.py,sha256=LBQwebsLZ_ZqPdfLYkY0770C0bQUgglvVXazZg4y8OM,37547
4
4
  metrolopy/constant.py,sha256=2wz1FT850DEwLW6Ai6C3golEZGBQWuTKn8MMrQMA_PY,16083
5
5
  metrolopy/constcom.py,sha256=ZVNaFcOVOQQ__Vm56hUyiPp4796IA7dotpDG5rBIw4w,7917
6
- metrolopy/dfunc.py,sha256=IkZ_T633Lh5cSJB3eOwyhk6d5WQT5ZrZTw3HXegqIPM,12343
7
- metrolopy/distributions.py,sha256=QmAr48P6PWvG0Qfby7GNLdTfABIebaxN80YgdL-3rbE,45676
6
+ metrolopy/dfunc.py,sha256=_0XvFeOHfZzZp4vZZ1LRCSg2QEIEFvmVjm_DUMjtJLU,12439
7
+ metrolopy/distributions.py,sha256=oIRBgkU_S_kaBzQJcf-ydITVhMRUsc58yjL0wtmuUP0,45680
8
8
  metrolopy/exceptions.py,sha256=tISrU8mLvqLCcan32n-wFnR2oj2-wICjbnYk0RGT0Jc,1804
9
- metrolopy/fit.py,sha256=Rad3Ig99GCrScZe0HY_XreVIU03om5BQvTcT7VWuaSU,101132
9
+ metrolopy/fit.py,sha256=DFi6drCOUiJqZTvD8lfh59D4pgSZrm9RYrcDp-4yQyc,101138
10
10
  metrolopy/functions.py,sha256=EIXvpqgeZ1iVFD8ygPByvWsp6EEvQ3qHBro9bX6YZqs,10051
11
- metrolopy/gummy.py,sha256=LwuzMLRjxfTeXX4tPBxr8Rdy20CgkdfV4Eqp5dsiZPw,141062
11
+ metrolopy/gummy.py,sha256=3MU0DZERggsH0gaV8yMVvJOr04VnDF3AAAQrzAqT2Ww,141054
12
12
  metrolopy/indexed.py,sha256=wFgTeCOKcZFVxUCsNhjyqWCmG3rbgk2t04m4kQ6AFew,6676
13
13
  metrolopy/license.txt,sha256=hOKIMVY_W-ijJs8Q2Xo7gf2LE_r88c7eYO3-n0FYyFs,33041
14
14
  metrolopy/logunit.py,sha256=pvo5j2TpR4yXcTEBKZPBht1blDFTfNRRMojV4Wgap3k,7468
@@ -24,21 +24,21 @@ metrolopy/relunits.py,sha256=L3rvCpwWgUJa3ec-fYmf_UwfyI2DypoJnkQWjnIKgQA,2193
24
24
  metrolopy/siunits.py,sha256=TppienkBMQ4ndF43ed-GE6gyKitkKiWa4oOmr75u-tU,8541
25
25
  metrolopy/ummy.py,sha256=klkvVauuWRDckQLYySPFjNHk2dukDfLUs6u7X0oaFpc,74302
26
26
  metrolopy/unit.py,sha256=SG7pxcNlMGzMat9UO3KfmUF72LKZHTTTfhoDMk_gf7M,61159
27
- metrolopy/unitparser.py,sha256=epGAJ0-c_1PJc8IFKhfQ82-87Dy_zdu623jaa_ZneXg,9576
27
+ metrolopy/unitparser.py,sha256=nCXbA3S-0AG2QoSqvylGB01U_O_OOFLR-clxPlw75DM,9578
28
28
  metrolopy/unitutils.py,sha256=vkVJK1X2QcVbspW6A0BvBw4_FcAsoij2epmJdwEuKSc,12687
29
29
  metrolopy/usunits.py,sha256=FivB92A0lwCf0Ptie9z1EVKTS-v79oYaLBuqn0Jx4nA,11202
30
- metrolopy/version.py,sha256=LuiQXZ6p0Fez2NHH07hfbbWlB3W8oVFnmhE6SzhlRoY,829
31
- metrolopy/tests/__init__.py,sha256=fNBw3043jxDpCxo_b4CujgD3ZzLsL4TwXa9XPJpl3qE,236
30
+ metrolopy/version.py,sha256=qdP-E9kxZGFATxDBBjyf2fDZFPlwZIqavNaAvbZSAP0,829
31
+ metrolopy/tests/__init__.py,sha256=J9UlhmiF967vTW40zh2tBFFDOf8rOP9ep4LKaMtXkw8,199
32
32
  metrolopy/tests/common.py,sha256=-AUUXiz5vuORxpYDKdUkUG9j6jLRVp5fBGRlRTKI0kE,3474
33
- metrolopy/tests/test_complex.py,sha256=d15tnd3hZTs0Gv63S-LPLjv7NA8Fyzd5HqFVF-C4rIs,6831
34
- metrolopy/tests/test_create.py,sha256=XiAmcaElGQwV0ml-dq7lsFIuhQgeOW-lCFhCLOU_OCs,15905
35
- metrolopy/tests/test_gummy.py,sha256=i9h8H5eCL2kvNxQwUMib2Bmc3kDzrWyeeZqmS9kps_I,17879
36
- metrolopy/tests/test_misc.py,sha256=hxmncHR9z3E_BfBdx20auaOJKzDHz-LkzP4RKVVfmzE,3406
37
- metrolopy/tests/test_operations.py,sha256=JUGqjBcAqPRswOFtCcEouJFWsZY3foXRel3BCsAUis8,10678
38
- metrolopy/tests/test_ubreakdown.py,sha256=ThCAXj673SwO0pV0Sh08zKo_ZHpLfi5FsDlNW-rAeSo,11001
39
- metrolopy-0.6.3.dist-info/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
40
- metrolopy-0.6.3.dist-info/METADATA,sha256=M933S49sNh1MmMe2Qhsouu0pqY35a9Rob2rOJBGcSy8,4282
41
- metrolopy-0.6.3.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
42
- metrolopy-0.6.3.dist-info/top_level.txt,sha256=TTY_Gf2M3yWScmUStgI-RYOc0YKVcr108GaTl4sedSo,10
43
- metrolopy-0.6.3.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
44
- metrolopy-0.6.3.dist-info/RECORD,,
33
+ metrolopy/tests/test_complex.py,sha256=pSKujsTr8smV21_3JbPdeJxVVtgUqjPm6lOGw3-1NI0,7862
34
+ metrolopy/tests/test_create.py,sha256=k0boYIdTL0m2m5GRnf6U6kKh0QwgjN8WNCcF0wvI32E,17886
35
+ metrolopy/tests/test_gummy.py,sha256=EGIqGSBM8VmoiSx5B_0lV-cPa-a6LXVWAMdYZRlYJ1Y,23248
36
+ metrolopy/tests/test_misc.py,sha256=lGlrZyAoWaKKTjyOpS7b8Zu79shOSvX5AQAnxdkCSnA,4325
37
+ metrolopy/tests/test_operations.py,sha256=VXGA9cVQL-eGeAdfIHryF8Hf8TeN8uOlZ7VRgdSsBYQ,12944
38
+ metrolopy/tests/test_ubreakdown.py,sha256=r1IlMa2cB8iOAq0AmCOqgZ9L2WvBaZvfdml3Xhcx6Qk,13655
39
+ metrolopy-0.6.5.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
40
+ metrolopy-0.6.5.dist-info/METADATA,sha256=PG1GF7ohO45sTQtBdYnfAMzy8fIO06DPEFXNwbT413E,4586
41
+ metrolopy-0.6.5.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
42
+ metrolopy-0.6.5.dist-info/top_level.txt,sha256=TTY_Gf2M3yWScmUStgI-RYOc0YKVcr108GaTl4sedSo,10
43
+ metrolopy-0.6.5.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
44
+ metrolopy-0.6.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.1)
2
+ Generator: setuptools (80.8.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5