MCPcopy
hub / github.com/dmlc/dgl / test_array_readwriter

Function test_array_readwriter

tests/tools/test_array_readwriter.py:13–25  ·  view source on GitHub ↗
(format, shape)

Source from the content-addressed store, hash-verified

11)
12@pytest.mark.parametrize("format", ["numpy", "parquet"])
13def test_array_readwriter(format, shape):
14 original_array = np.random.rand(*shape)
15 fmt_meta = {"name": format}
16
17 with tempfile.TemporaryDirectory() as test_dir:
18 path = os.path.join(test_dir, f"nodes.{format}")
19 array_readwriter.get_array_parser(**fmt_meta).write(
20 path, original_array
21 )
22 array = array_readwriter.get_array_parser(**fmt_meta).read(path)
23
24 assert original_array.shape == array.shape
25 assert np.array_equal(original_array, array)

Callers

nothing calls this directly

Calls 3

joinMethod · 0.45
writeMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected