MCPcopy Create free account
hub / github.com/alibaba/zvec / assert_native_fetch

Function assert_native_fetch

python/tests/test_refine_flat_storage.py:264–269  ·  view source on GitHub ↗
(collection, doc_index)

Source from the content-addressed store, hash-verified

262 return vector
263
264 def assert_native_fetch(collection, doc_index):
265 fetched = collection.fetch(ids=[str(doc_index)])[str(doc_index)]
266 np.testing.assert_array_equal(
267 np.asarray(fetched.vector("dense"), dtype=np.float32),
268 native_vector(docs[doc_index].vector("dense")),
269 )
270
271 def assert_native_refine_scores(collection, doc_index):
272 query = np.asarray(docs[doc_index].vector("dense"), dtype=np.float32)

Calls 3

native_vectorFunction · 0.85
fetchMethod · 0.45
vectorMethod · 0.45

Tested by

no test coverage detected