MCPcopy Create free account
hub / github.com/boostorg/histogram / test_numpy_conversion_1

Method test_numpy_conversion_1

test/python_suite_test.py:780–788  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

778
779 @unittest.skipUnless(HAVE_NUMPY, "requires build with numpy-support")
780 def test_numpy_conversion_1(self):
781 a = histogram(integer(0, 3))
782 for i in range(10):
783 a(1, weight=3)
784 c = numpy.array(a) # a copy
785 v = numpy.asarray(a) # a view
786 self.assertEqual(c.dtype, numpy.float64)
787 self.assertTrue(numpy.all(c == numpy.array(((0, 30, 0, 0, 0), (0, 90, 0, 0, 0)))))
788 self.assertTrue(numpy.all(v == c))
789
790 @unittest.skipUnless(HAVE_NUMPY, "requires build with numpy-support")
791 def test_numpy_conversion_2(self):

Callers

nothing calls this directly

Calls 2

integerClass · 0.90
histogramClass · 0.50

Tested by

no test coverage detected