diff --git a/quantities/dimensionality.py b/quantities/dimensionality.py index d38038e..c00190b 100644 --- a/quantities/dimensionality.py +++ b/quantities/dimensionality.py @@ -284,6 +284,8 @@ def _d_check_uniform(q1, q2, out=None): p_dict[np.less_equal] = _d_check_uniform p_dict[np.greater] = _d_check_uniform p_dict[np.greater_equal] = _d_check_uniform +p_dict[np.maximum] = _d_check_uniform +p_dict[np.minimum] = _d_check_uniform def _d_arctan2(q1, q2, out=None): try: diff --git a/quantities/tests/test_umath.py b/quantities/tests/test_umath.py index 6df6490..a29231d 100644 --- a/quantities/tests/test_umath.py +++ b/quantities/tests/test_umath.py @@ -293,3 +293,13 @@ def test_greater_equal(self): arr2 = (1.0, 2.0) * pq.m self.assertTrue(np.all(np.greater_equal(arr2, arr1))) self.assertFalse(np.all(np.greater_equal(arr2*0.99, arr1))) + + def test_maximum(self): + arr1 = (998, 999) * pq.m + arr2 = (1e3, 5e2) * pq.m + self.assertQuantityEqual(np.maximum(arr1, arr2) - [1000, 999]*pq.m, [0, 0]*pq.m) + + def test_minimum(self): + arr1 = (998, 999) * pq.m + arr2 = (1e3, 5e2) * pq.m + self.assertQuantityEqual(np.minimum(arr1, arr2) - [998, 500]*pq.m, [0, 0]*pq.m)
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: