(self)
| 804 | assert_raises(MAError, lambda: int(a[0])) |
| 805 | |
| 806 | def test_oddfeatures_1(self): |
| 807 | # Test of other odd features |
| 808 | x = arange(20) |
| 809 | x = x.reshape(4, 5) |
| 810 | x.flat[5] = 12 |
| 811 | assert_(x[1, 0] == 12) |
| 812 | z = x + 10j * x |
| 813 | assert_equal(z.real, x) |
| 814 | assert_equal(z.imag, 10 * x) |
| 815 | assert_equal((z * conjugate(z)).real, 101 * x * x) |
| 816 | z.imag[...] = 0.0 |
| 817 | |
| 818 | x = arange(10) |
| 819 | x[3] = masked |
| 820 | assert_(str(x[3]) == str(masked)) |
| 821 | c = x >= 8 |
| 822 | assert_(count(where(c, masked, masked)) == 0) |
| 823 | assert_(shape(where(c, masked, masked)) == c.shape) |
| 824 | |
| 825 | z = masked_where(c, x) |
| 826 | assert_(z.dtype is x.dtype) |
| 827 | assert_(z[3] is masked) |
| 828 | assert_(z[4] is not masked) |
| 829 | assert_(z[7] is not masked) |
| 830 | assert_(z[8] is masked) |
| 831 | assert_(z[9] is masked) |
| 832 | assert_equal(x, z) |
| 833 | |
| 834 | def test_oddfeatures_2(self): |
| 835 | # Tests some more features. |
nothing calls this directly
no test coverage detected