MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / _make_index

Function _make_index

tests/test_index_growth.py:6–14  ·  view source on GitHub ↗
(tmp_path, n=5, dim=384)

Source from the content-addressed store, hash-verified

4
5
6def _make_index(tmp_path, n=5, dim=384):
7 rng = np.random.RandomState(42)
8 embs = rng.randn(n, dim).astype(np.float32)
9 embs = embs / np.linalg.norm(embs, axis=1, keepdims=True)
10 labels = [0] * n
11 np.save(tmp_path / "seed_embeddings.npy", embs)
12 with open(tmp_path / "seed_labels.json", "w") as f:
13 json.dump(labels, f)
14 return embs
15
16
17def test_add_entry(tmp_path):

Callers 4

test_add_entryFunction · 0.85
test_cap_enforcedFunction · 0.85
test_save_loadFunction · 0.85

Calls 2

openFunction · 0.85
saveMethod · 0.45

Tested by

no test coverage detected