| 1509 | np.fromstring(b'aa, aa, 1.0', sep=',') |
| 1510 | |
| 1511 | def test_ticket_1539(self): |
| 1512 | dtypes = [x for x in np._core.sctypeDict.values() |
| 1513 | if (issubclass(x, np.number) |
| 1514 | and not issubclass(x, np.timedelta64))] |
| 1515 | a = np.array([], np.bool) # not x[0] because it is unordered |
| 1516 | failures = [] |
| 1517 | |
| 1518 | for x in dtypes: |
| 1519 | b = a.astype(x) |
| 1520 | for y in dtypes: |
| 1521 | c = a.astype(y) |
| 1522 | try: |
| 1523 | d = np.dot(b, c) |
| 1524 | except TypeError: |
| 1525 | failures.append((x, y)) |
| 1526 | else: |
| 1527 | if d != 0: |
| 1528 | failures.append((x, y)) |
| 1529 | if failures: |
| 1530 | raise AssertionError(f"Failures: {failures!r}") |
| 1531 | |
| 1532 | def test_ticket_1538(self): |
| 1533 | x = np.finfo(np.float32) |