MCPcopy Create free account
hub / github.com/tirth8205/code-review-graph / _encode_vector

Function _encode_vector

code_review_graph/embeddings.py:755–757  ·  view source on GitHub ↗

Encode a float vector as a compact binary blob.

(vec: list[float])

Source from the content-addressed store, hash-verified

753
754
755def _encode_vector(vec: list[float]) -> bytes:
756 """Encode a float vector as a compact binary blob."""
757 return struct.pack(f"{len(vec)}f", *vec)
758
759
760def _decode_vector(blob: bytes) -> list[float]:

Callers 4

test_roundtripMethod · 0.90
test_empty_vectorMethod · 0.90
test_blob_sizeMethod · 0.90
embed_nodesMethod · 0.85

Calls

no outgoing calls

Tested by 3

test_roundtripMethod · 0.72
test_empty_vectorMethod · 0.72
test_blob_sizeMethod · 0.72