(self)
| 1708 | assert_equal(b.mask.shape, b.data.shape) |
| 1709 | |
| 1710 | def test_shape_scalar(self): |
| 1711 | # the atleast and diagflat function should work with scalars |
| 1712 | # GitHub issue #3367 |
| 1713 | # Additionally, the atleast functions should accept multiple scalars |
| 1714 | # correctly |
| 1715 | b = atleast_1d(1.0) |
| 1716 | assert_equal(b.shape, (1,)) |
| 1717 | assert_equal(b.mask.shape, b.shape) |
| 1718 | assert_equal(b.data.shape, b.shape) |
| 1719 | |
| 1720 | b = atleast_1d(1.0, 2.0) |
| 1721 | for a in b: |
| 1722 | assert_equal(a.shape, (1,)) |
| 1723 | assert_equal(a.mask.shape, a.shape) |
| 1724 | assert_equal(a.data.shape, a.shape) |
| 1725 | |
| 1726 | b = atleast_2d(1.0) |
| 1727 | assert_equal(b.shape, (1, 1)) |
| 1728 | assert_equal(b.mask.shape, b.shape) |
| 1729 | assert_equal(b.data.shape, b.shape) |
| 1730 | |
| 1731 | b = atleast_2d(1.0, 2.0) |
| 1732 | for a in b: |
| 1733 | assert_equal(a.shape, (1, 1)) |
| 1734 | assert_equal(a.mask.shape, a.shape) |
| 1735 | assert_equal(a.data.shape, a.shape) |
| 1736 | |
| 1737 | b = atleast_3d(1.0) |
| 1738 | assert_equal(b.shape, (1, 1, 1)) |
| 1739 | assert_equal(b.mask.shape, b.shape) |
| 1740 | assert_equal(b.data.shape, b.shape) |
| 1741 | |
| 1742 | b = atleast_3d(1.0, 2.0) |
| 1743 | for a in b: |
| 1744 | assert_equal(a.shape, (1, 1, 1)) |
| 1745 | assert_equal(a.mask.shape, a.shape) |
| 1746 | assert_equal(a.data.shape, a.shape) |
| 1747 | |
| 1748 | b = diagflat(1.0) |
| 1749 | assert_equal(b.shape, (1, 1)) |
| 1750 | assert_equal(b.mask.shape, b.data.shape) |
| 1751 | |
| 1752 | |
| 1753 | class TestNDEnumerate: |
nothing calls this directly
no test coverage detected