| 881 | |
| 882 | @unittest.skipUnless(HAVE_NUMPY, "requires build with numpy-support") |
| 883 | def test_numpy_conversion_6(self): |
| 884 | a = integer(0, 2) |
| 885 | b = regular(2, 0, 2) |
| 886 | c = variable(0, 1, 2) |
| 887 | ref = numpy.array((0., 1., 2.)) |
| 888 | self.assertTrue(numpy.all(numpy.array(a) == ref)) |
| 889 | self.assertTrue(numpy.all(numpy.array(b) == ref)) |
| 890 | self.assertTrue(numpy.all(numpy.array(c) == ref)) |
| 891 | d = circular(4) |
| 892 | ref = numpy.array((0., 0.5 * pi, pi, 1.5 * pi, 2.0 * pi)) |
| 893 | self.assertTrue(numpy.all(numpy.array(d) == ref)) |
| 894 | e = category(1, 2) |
| 895 | ref = numpy.array((1, 2)) |
| 896 | self.assertTrue(numpy.all(numpy.array(e) == ref)) |
| 897 | |
| 898 | @unittest.skipUnless(HAVE_NUMPY, "requires build with numpy-support") |
| 899 | def test_fill_with_numpy_array_0(self): |