Skip to content

Commit eeb1b7e

Browse files
committed
Updated naming [skip ci]
1 parent 8f2ec85 commit eeb1b7e

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

pgvector/halfvec.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def to_binary(self) -> bytes:
6161

6262
@classmethod
6363
def from_text(cls, value: str) -> HalfVector:
64-
return cls(cls._list_from_text(value))
64+
return cls(cls._from_text(value))
6565

6666
@classmethod
6767
def from_binary(cls, value: bytes) -> HalfVector:
@@ -101,8 +101,8 @@ def _from_db(cls, value: str | HalfVector | None) -> list[float] | None:
101101
if isinstance(value, HalfVector):
102102
return value.to_list()
103103

104-
return cls._list_from_text(value)
104+
return cls._from_text(value)
105105

106106
@classmethod
107-
def _list_from_text(cls, value: str) -> list[float]:
107+
def _from_text(cls, value: str) -> list[float]:
108108
return [float(v) for v in value[1:-1].split(',')]

pgvector/vector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def to_binary(self) -> bytes:
5959

6060
@classmethod
6161
def from_text(cls, value: str) -> Vector:
62-
return cls(cls._list_from_text(value))
62+
return cls(cls._from_text(value))
6363

6464
@classmethod
6565
def from_binary(cls, value: bytes) -> Vector:
@@ -99,8 +99,8 @@ def _from_db(cls, value: str | Vector | None) -> list[float] | None:
9999
if isinstance(value, Vector):
100100
return value.to_list()
101101

102-
return cls._list_from_text(value)
102+
return cls._from_text(value)
103103

104104
@classmethod
105-
def _list_from_text(cls, value: str) -> list[float]:
105+
def _from_text(cls, value: str) -> list[float]:
106106
return [float(v) for v in value[1:-1].split(',')]

0 commit comments

Comments
 (0)