diff --git a/.travis.yml b/.travis.yml index 0ec0e7c..ee38391 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,10 +30,3 @@ matrix: env: NUMPY_VERSION=1.6 - python: "3.3" env: NUMPY_VERSION=1.6 - allow_failures: - - python: "2.7" - env: NUMPY_VERSION=1.8 - - python: "3.2" - env: NUMPY_VERSION=1.8 - - python: "3.3" - env: NUMPY_VERSION=1.8 diff --git a/CHANGES b/CHANGES index e093b9e..5048f4d 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,8 @@ Pint Changelog - Implemented default formatting for quantities. - Changed comparison between Quantities containing NumPy arrays. (Issue #75) - BACKWARDS INCOMPATIBLE CHANGE +- Fixes for NumPy 1.8 due to changes in handling binary ops. + (Issue #73) 0.3.3 (2013-11-29) @@ -22,7 +24,9 @@ Pint Changelog - Fix comparison of quantities. (Issue #74) - Fix Inequality operator. - (Issue #70) + (Issue #70, thanks muggenhor) +- Improved travis configuration. + (thanks muggenhor) 0.3.2 (2013-10-22) diff --git a/pint/quantity.py b/pint/quantity.py index 735e8e9..bc3398e 100644 --- a/pint/quantity.py +++ b/pint/quantity.py @@ -301,7 +301,8 @@ class _Quantity(object): def __sub__(self, other): return self.add_sub(other, operator.isub) - __rsub__ = __sub__ + def __rsub__(self, other): + return -self.add_sub(other, operator.isub) def __imul__(self, other): if _check(self, other): diff --git a/pint/testsuite/__init__.py b/pint/testsuite/__init__.py index 3a09617..652745d 100644 --- a/pint/testsuite/__init__.py +++ b/pint/testsuite/__init__.py @@ -11,9 +11,11 @@ try: import numpy as np HAS_NUMPY = True ndarray = np.ndarray + NUMPY_VER = np.__version__ except ImportError: np = None HAS_NUMPY = False + NUMPY_VER = 0 class ndarray(object): pass diff --git a/pint/testsuite/test_issues.py b/pint/testsuite/test_issues.py index 8af9df7..0947830 100644 --- a/pint/testsuite/test_issues.py +++ b/pint/testsuite/test_issues.py @@ -8,7 +8,7 @@ from pint import UnitRegistry from pint.unit import UnitsContainer from pint.util import ParserHelper -from pint.testsuite import HAS_NUMPY, np, TestCase, ndarray +from pint.testsuite import HAS_NUMPY, np, TestCase, ndarray, NUMPY_VER class TestIssues(unittest.TestCase):