metrolopy 1.0.1__py3-none-any.whl → 1.0.2__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/gummy.py CHANGED
@@ -2758,14 +2758,18 @@ class gummy(Quantity,metaclass=MetaGummy):
2758
2758
  x = self.x
2759
2759
 
2760
2760
  xd = _to_decimal(x,max_digits=self.max_digits)
2761
- with localcontext(prec=nsig + 2):
2761
+ #with localcontext(prec=nsig + 2):
2762
+ with localcontext() as ctx:
2763
+ ctx.prec = nsig + 2
2762
2764
  ud = _to_decimal(u)*_to_decimal(self._k)
2763
2765
 
2764
2766
  elip = ''
2765
2767
  uexp = 0
2766
2768
  xexp = 0
2767
2769
  dp = 0
2768
- with localcontext(prec=self.max_digits):
2770
+ #with localcontext(prec=self.max_digits):
2771
+ with localcontext() as ctx:
2772
+ ctx.prec = self.max_digits
2769
2773
  if ud == 0 or not ud.is_finite():
2770
2774
  if style != 'xf':
2771
2775
  style = 'x'
@@ -2870,7 +2874,9 @@ class gummy(Quantity,metaclass=MetaGummy):
2870
2874
  style = 'pmi'
2871
2875
  return tuple([style,xret] + uret)
2872
2876
 
2873
- with localcontext(prec=nsig + 2):
2877
+ #with localcontext(prec=nsig + 2):
2878
+ with localcontext() as ctx:
2879
+ ctx.prec = nsig + 2
2874
2880
  if sim:
2875
2881
  u = abs(_to_decimal(self.cisim[1] - self.cisim[0]))
2876
2882
  else:
metrolopy/ummy.py CHANGED
@@ -152,7 +152,9 @@ def _to_decimal(x,max_digits=None):
152
152
  elif isinstance(x,Rational):
153
153
  if max_digits is None:
154
154
  max_digits = ummy.max_digits
155
- with localcontext(prec=max_digits):
155
+ #with localcontext(prec=max_digits):
156
+ with localcontext() as ctx:
157
+ ctx.prec = max_digits
156
158
  try:
157
159
  xd = Decimal(x.numerator)/Decimal(x.denominator)
158
160
  except:
@@ -754,7 +756,9 @@ class ummy(Dfunc,PrettyPrinter,Number,metaclass=MetaUmmy):
754
756
  dp = 0
755
757
  xd = _to_decimal(self._x,max_digits=self.max_digits)
756
758
  ud = _to_decimal(self.u)
757
- with localcontext(prec=self.max_digits):
759
+ #with localcontext(prec=self.max_digits):
760
+ with localcontext() as ctx:
761
+ ctx.prec = self.max_digits
758
762
  if ud == 0 or not ud.is_finite():
759
763
  if xd.is_finite():
760
764
  nm = False
metrolopy/version.py CHANGED
@@ -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__ = '1.0.1'
23
+ __version__ = '1.0.2'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: metrolopy
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: tools for dealing with measured quantities: uncertainty propagation and unit conversion
5
5
  Home-page: http://nrc-cnrc.github.io/MetroloPy/
6
6
  Author: Harold Parks, National Research Council Canada
@@ -9,7 +9,7 @@ metrolopy/distributions.py,sha256=rh5qRRocXn9_JZ1zmhxCy2O3kwy6XtYIyPHyNxdqefo,48
9
9
  metrolopy/exceptions.py,sha256=N9IvZvNRBNLtKV-t-zYIpOj6SuKpnd6lZUckL8LEBuY,1774
10
10
  metrolopy/fit.py,sha256=cocdQjj13fIrj70cnibFcVYliqKbaGUr95-eAWDLNXY,101174
11
11
  metrolopy/functions.py,sha256=PIZ1nQwMzOunT6qjDr2Al26Robr8AE7NGGHnkEL_p2c,10057
12
- metrolopy/gummy.py,sha256=YxM_Vrg2RwB69oRGKPrNiEpIWhBfpxHrR8Xz1OCQkoE,141539
12
+ metrolopy/gummy.py,sha256=4zbOmhsid2sziOqy3ynMDJue3xGMCrH1R86iR7n7l3A,141759
13
13
  metrolopy/indexed.py,sha256=29Ev_S6noFLDem9jti_kiBWv_96WIShVhYNN_l-q2aI,8534
14
14
  metrolopy/license.txt,sha256=hOKIMVY_W-ijJs8Q2Xo7gf2LE_r88c7eYO3-n0FYyFs,33041
15
15
  metrolopy/logunit.py,sha256=Ap7HoJhWrByO9lEHboibubsXTwjFGgM044IQ_bA9nrQ,7468
@@ -23,12 +23,12 @@ metrolopy/prefixedunit.py,sha256=rsG_AKWIignQVIrOsahjw0kgOA6NvC3iafu_tKoO7yM,103
23
23
  metrolopy/printing.py,sha256=I_TVH3CWcwWxm82ER44v0_IP9oPUSYHTYR5pfWRdRNo,8993
24
24
  metrolopy/relunits.py,sha256=fPuzkx352bnI1_mCTDDVbKHZ1ifsvdgR0gBZ1s9uYfI,2174
25
25
  metrolopy/siunits.py,sha256=9eFc8N6namSeZCyqiMrkIcUvatFHiFwr4v05TKRMm5I,8611
26
- metrolopy/ummy.py,sha256=yMnMjGMnltNAkjYyrwZdZPdID_gRzr35OR9w_NFASME,76826
26
+ metrolopy/ummy.py,sha256=Qx2pcqNsfxbb5ZuN9rCfdZ6ZAGevHa3kBrRB1_PwiqI,76985
27
27
  metrolopy/unit.py,sha256=_UF8WSHFbOyPZbyebW73jSHD2jO_RKg2_Z60smBhinM,64514
28
28
  metrolopy/unitparser.py,sha256=L-eCt_ubIy0rQEG9uttNnkBa3-BpkSnkHW9scHSHKmg,9015
29
29
  metrolopy/unitutils.py,sha256=2lw1JWo-xPgE42zIJP3fTsZIOtwDJqnq3Si9CTsIEuY,13802
30
30
  metrolopy/usunits.py,sha256=R1BdlW24DMdeq7YUpKgBk83YAibHEkWsu9ylMEW2qmU,11249
31
- metrolopy/version.py,sha256=KEHcsMWkEkX0EyzEbrA_ixx_JIzj4NN56k2wAFo11qc,829
31
+ metrolopy/version.py,sha256=mlx2kVkFVNnPS7nZ_M0Day_5iZSrF7YA59Fm9PBBc38,829
32
32
  metrolopy/tests/__init__.py,sha256=8xPi7YxTaZ1Z7AJwxsTgY82iOj9Ysv7VqU8gOWoF92E,259
33
33
  metrolopy/tests/common.py,sha256=-AUUXiz5vuORxpYDKdUkUG9j6jLRVp5fBGRlRTKI0kE,3474
34
34
  metrolopy/tests/test_complex.py,sha256=D3pn1BMI4rvYXHDrEyTvAWfqHUe2-8cVDSB49VyUCp0,8388
@@ -37,9 +37,9 @@ metrolopy/tests/test_gummy.py,sha256=Euejbmz2tA6m0wQbwsAajJYBgL8rhICZmEvUj7l27n0
37
37
  metrolopy/tests/test_misc.py,sha256=YGMyJwAlCaggVDesvpzy9VPa4KnfhXBvdsJkoOc_mXY,4402
38
38
  metrolopy/tests/test_operations.py,sha256=O7v22xyS6pIUr57PiLAwTIULR8qNtjFgVoPKrRXmAJ4,14247
39
39
  metrolopy/tests/test_ubreakdown.py,sha256=xABI5N31jZ9aJMae85tUFPnGCowXnnuvwML5_v3ziPM,13768
40
- metrolopy-1.0.1.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
41
- metrolopy-1.0.1.dist-info/METADATA,sha256=Ebew2Uwz33K3gYeoaBN7kOCltgj4THx7awkpXo6TOag,5495
42
- metrolopy-1.0.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
43
- metrolopy-1.0.1.dist-info/top_level.txt,sha256=TTY_Gf2M3yWScmUStgI-RYOc0YKVcr108GaTl4sedSo,10
44
- metrolopy-1.0.1.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
45
- metrolopy-1.0.1.dist-info/RECORD,,
40
+ metrolopy-1.0.2.dist-info/licenses/LICENSE,sha256=IwGE9guuL-ryRPEKi6wFPI_zOhg7zDZbTYuHbSt_SAk,35823
41
+ metrolopy-1.0.2.dist-info/METADATA,sha256=GQIPXZjnVcqsMjGuSVvoJe3H-iGzhfhiuW3TJ_4FcWA,5495
42
+ metrolopy-1.0.2.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
43
+ metrolopy-1.0.2.dist-info/top_level.txt,sha256=TTY_Gf2M3yWScmUStgI-RYOc0YKVcr108GaTl4sedSo,10
44
+ metrolopy-1.0.2.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
45
+ metrolopy-1.0.2.dist-info/RECORD,,