metrolopy 1.0.1__tar.gz → 1.0.2__tar.gz

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.
Files changed (49) hide show
  1. {metrolopy-1.0.1 → metrolopy-1.0.2}/PKG-INFO +1 -1
  2. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/gummy.py +9 -3
  3. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/ummy.py +6 -2
  4. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/version.py +1 -1
  5. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/PKG-INFO +1 -1
  6. {metrolopy-1.0.1 → metrolopy-1.0.2}/LICENSE +0 -0
  7. {metrolopy-1.0.1 → metrolopy-1.0.2}/README.md +0 -0
  8. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/__init__.py +0 -0
  9. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/budget.py +0 -0
  10. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/builtin_constants.py +0 -0
  11. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/constant.py +0 -0
  12. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/constcom.py +0 -0
  13. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/dfunc.py +0 -0
  14. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/distributions.py +0 -0
  15. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/exceptions.py +0 -0
  16. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/fit.py +0 -0
  17. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/functions.py +0 -0
  18. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/indexed.py +0 -0
  19. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/license.txt +0 -0
  20. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/logunit.py +0 -0
  21. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/mean.py +0 -0
  22. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/miscunits.py +0 -0
  23. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/nonlinearunit.py +0 -0
  24. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/nummy.py +0 -0
  25. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/offsetunit.py +0 -0
  26. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/pmethod.py +0 -0
  27. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/prefixedunit.py +0 -0
  28. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/printing.py +0 -0
  29. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/relunits.py +0 -0
  30. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/siunits.py +0 -0
  31. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/__init__.py +0 -0
  32. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/common.py +0 -0
  33. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_complex.py +0 -0
  34. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_create.py +0 -0
  35. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_gummy.py +0 -0
  36. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_misc.py +0 -0
  37. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_operations.py +0 -0
  38. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/tests/test_ubreakdown.py +0 -0
  39. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/unit.py +0 -0
  40. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/unitparser.py +0 -0
  41. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/unitutils.py +0 -0
  42. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy/usunits.py +0 -0
  43. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/SOURCES.txt +0 -0
  44. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/dependency_links.txt +0 -0
  45. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/requires.txt +0 -0
  46. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/top_level.txt +0 -0
  47. {metrolopy-1.0.1 → metrolopy-1.0.2}/metrolopy.egg-info/zip-safe +0 -0
  48. {metrolopy-1.0.1 → metrolopy-1.0.2}/setup.cfg +0 -0
  49. {metrolopy-1.0.1 → metrolopy-1.0.2}/setup.py +0 -0
@@ -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
@@ -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:
@@ -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
@@ -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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes