diff options
-rw-r--r-- | numpy/core/getlimits.py | 2 | ||||
-rw-r--r-- | numpy/core/tests/test_regression.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/numpy/core/getlimits.py b/numpy/core/getlimits.py index 97c12cc6b..4fa020e86 100644 --- a/numpy/core/getlimits.py +++ b/numpy/core/getlimits.py @@ -145,7 +145,7 @@ class finfo(object): 'machep']: setattr(self,word,getattr(machar, word)) for word in ['tiny','resolution','epsneg']: - setattr(self,word,getattr(machar, word).squeeze()) + setattr(self,word,getattr(machar, word).flat[0]) self.max = machar.huge.flat[0] self.min = -self.max self.eps = machar.eps.flat[0] diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py index 3dc1a653e..2aac2fb1c 100644 --- a/numpy/core/tests/test_regression.py +++ b/numpy/core/tests/test_regression.py @@ -1302,7 +1302,7 @@ class TestRegression(TestCase): # Ticket #1345: the following should not cause a crash np.fromstring(asbytes('aa, aa, 1.0'), sep=',') - def test_issue1539(self): + def test_ticket_1539(self): dtypes = [x for x in np.typeDict.values() if (issubclass(x, np.number) and not issubclass(x, np.timeinteger))] @@ -1319,6 +1319,11 @@ class TestRegression(TestCase): if failures: raise AssertionError("Failures: %r" % failures) + def test_ticket_1538(self): + x = np.finfo(np.float32) + for name in 'eps epsneg max min resolution tiny'.split(): + assert_equal(type(getattr(x, name)), np.float32, + err_msg=name) if __name__ == "__main__": run_module_suite() |