(dtype)
| 12 | |
| 13 | @pytest.mark.parametrize("dtype", [np.int32, np.int64]) |
| 14 | def test_create_adj2d(dtype): |
| 15 | data = np.zeros([2, 4], dtype=dtype) |
| 16 | adj = adjacencylist(data) |
| 17 | num_nodes, num_links = data.shape[0], data.shape[1] |
| 18 | assert np.array_equal( |
| 19 | adj.offsets, np.arange(0, num_nodes * num_links + num_links, num_links, dtype=np.int32) |
| 20 | ) |
| 21 | |
| 22 | data = np.arange(20, dtype=dtype) |
| 23 | offsets = np.array([0, 5, 15, 20], dtype=np.int32) |
| 24 | adj = adjacencylist(data, offsets) |
| 25 | assert adj.num_nodes == 3 |
| 26 | assert len(adj.links(0)) == 5 |
| 27 | assert len(adj.links(1)) == 10 |
| 28 | assert len(adj.links(2)) == 5 |
nothing calls this directly
no test coverage detected