MCPcopy
hub / github.com/huggingface/datasets / test_xnumpy_load

Function test_xnumpy_load

tests/test_file_utils.py:929–942  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

927
928
929def test_xnumpy_load(tmp_path):
930 import numpy as np
931
932 expected_x = np.arange(10)
933 npy_path = tmp_path / "data-x.npy"
934 np.save(npy_path, expected_x)
935 x = xnumpy_load(npy_path)
936 assert np.array_equal(x, expected_x)
937
938 npz_path = tmp_path / "data.npz"
939 np.savez(npz_path, x=expected_x)
940 with xnumpy_load(npz_path) as f:
941 x = f["x"]
942 assert np.array_equal(x, expected_x)

Callers

nothing calls this directly

Calls 2

xnumpy_loadFunction · 0.90
saveMethod · 0.45

Tested by

no test coverage detected