Test correct broadcasting when the array atom is not scalar.
(self)
| 2575 | class BroadcastTest(common.TempFileMixin, common.PyTablesTestCase): |
| 2576 | |
| 2577 | def test(self): |
| 2578 | """Test correct broadcasting when the array atom is not scalar.""" |
| 2579 | |
| 2580 | array_shape = (2, 3) |
| 2581 | element_shape = (3,) |
| 2582 | |
| 2583 | dtype = np.dtype((np.int64, element_shape)) |
| 2584 | atom = tb.Atom.from_dtype(dtype) |
| 2585 | h5arr = self.h5file.create_array( |
| 2586 | self.h5file.root, "array", atom=atom, shape=array_shape |
| 2587 | ) |
| 2588 | |
| 2589 | size = np.prod(element_shape) |
| 2590 | nparr = np.arange(size).reshape(element_shape) |
| 2591 | |
| 2592 | h5arr[0] = nparr |
| 2593 | self.assertTrue(np.all(h5arr[0] == nparr)) |
| 2594 | |
| 2595 | |
| 2596 | class TestCreateArrayArgs(common.TempFileMixin, common.PyTablesTestCase): |
nothing calls this directly
no test coverage detected