| 1521 | np.fromstring(b'aa, aa, 1.0', sep=',') |
| 1522 | |
| 1523 | def test_ticket_1539(self): |
| 1524 | dtypes = [x for x in np.sctypeDict.values() |
| 1525 | if (issubclass(x, np.number) |
| 1526 | and not issubclass(x, np.timedelta64))] |
| 1527 | a = np.array([], np.bool_) # not x[0] because it is unordered |
| 1528 | failures = [] |
| 1529 | |
| 1530 | for x in dtypes: |
| 1531 | b = a.astype(x) |
| 1532 | for y in dtypes: |
| 1533 | c = a.astype(y) |
| 1534 | try: |
| 1535 | d = np.dot(b, c) |
| 1536 | except TypeError: |
| 1537 | failures.append((x, y)) |
| 1538 | else: |
| 1539 | if d != 0: |
| 1540 | failures.append((x, y)) |
| 1541 | if failures: |
| 1542 | raise AssertionError("Failures: %r" % failures) |
| 1543 | |
| 1544 | def test_ticket_1538(self): |
| 1545 | x = np.finfo(np.float32) |