Skip to content

Commit 0593fbb

Browse files
committed
better documentation
1 parent 0988876 commit 0593fbb

File tree

4 files changed

+28
-6
lines changed

4 files changed

+28
-6
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,9 @@ You can create a timescale-vector index on the table with.
178178
await vec.create_embedding_index(client.TimescaleVectorIndex())
179179
```
180180

181-
You can drop the index with:
181+
Please see
182+
[`TimescaleVectorIndex`](https://timescale.github.io/python-vector/vector.html#timescalevectorindex)
183+
documentation for advanced options. the You can drop the index with:
182184

183185
``` python
184186
await vec.drop_embedding_index()
@@ -187,8 +189,10 @@ await vec.drop_embedding_index()
187189
While we recommend the timescale-vector index type, we also have 2 more
188190
index types availabe:
189191

190-
- The pgvector ivfflat index
191-
- The pgvector hnsw index
192+
- The pgvector ivfflat index with
193+
[`IvfflatIndex`](https://timescale.github.io/python-vector/vector.html#ivfflatindex)
194+
- The pgvector hnsw index with
195+
[`HNSWIndex`](https://timescale.github.io/python-vector/vector.html#hnswindex)
192196

193197
Usage examples below:
194198

nbs/00_vector.ipynb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
"\n",
166166
"class IvfflatIndex(BaseIndex):\n",
167167
" def __init__(self, num_records: Optional[int] = None, num_lists: Optional[int] = None) -> None:\n",
168+
" \"\"\"\n",
169+
" Pgvector's ivfflat index.\n",
170+
" \"\"\"\n",
168171
" self.num_records = num_records\n",
169172
" self.num_lists = num_lists\n",
170173
" \n",
@@ -196,6 +199,9 @@
196199
"\n",
197200
"class HNSWIndex(BaseIndex):\n",
198201
" def __init__(self, m: Optional[int] = None, ef_construction: Optional[int] = None) -> None:\n",
202+
" \"\"\"\n",
203+
" Pgvector's hnsw index.\n",
204+
" \"\"\"\n",
199205
" self.m = m\n",
200206
" self.ef_construction = ef_construction\n",
201207
"\n",
@@ -223,6 +229,9 @@
223229
" max_alpha: Optional[float] = None,\n",
224230
" pq_vector_length: Optional[int] = None,\n",
225231
" ) -> None:\n",
232+
" \"\"\"\n",
233+
" Timescale's vector index.\n",
234+
" \"\"\"\n",
226235
" self.use_pq = use_pq\n",
227236
" self.num_neighbors = num_neighbors\n",
228237
" self.search_list_size = search_list_size\n",

nbs/index.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514
"cell_type": "markdown",
515515
"metadata": {},
516516
"source": [
517-
"You can drop the index with:"
517+
"Please see `TimescaleVectorIndex` documentation for advanced options. the You can drop the index with:"
518518
]
519519
},
520520
{
@@ -533,8 +533,8 @@
533533
"source": [
534534
"While we recommend the timescale-vector index type, we also have 2 more index types availabe:\n",
535535
"\n",
536-
"* The pgvector ivfflat index\n",
537-
"* The pgvector hnsw index\n",
536+
"* The pgvector ivfflat index with `IvfflatIndex`\n",
537+
"* The pgvector hnsw index with `HNSWIndex`\n",
538538
"\n",
539539
"Usage examples below:"
540540
]

timescale_vector/client.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ def create_index_query(self, table_name_quoted:str, column_name_quoted: str, ind
9191

9292
class IvfflatIndex(BaseIndex):
9393
def __init__(self, num_records: Optional[int] = None, num_lists: Optional[int] = None) -> None:
94+
"""
95+
Pgvector's ivfflat index.
96+
"""
9497
self.num_records = num_records
9598
self.num_lists = num_lists
9699

@@ -122,6 +125,9 @@ def create_index_query(self, table_name_quoted:str, column_name_quoted: str, ind
122125

123126
class HNSWIndex(BaseIndex):
124127
def __init__(self, m: Optional[int] = None, ef_construction: Optional[int] = None) -> None:
128+
"""
129+
Pgvector's hnsw index.
130+
"""
125131
self.m = m
126132
self.ef_construction = ef_construction
127133

@@ -149,6 +155,9 @@ def __init__(self,
149155
max_alpha: Optional[float] = None,
150156
pq_vector_length: Optional[int] = None,
151157
) -> None:
158+
"""
159+
Timescale's vector index.
160+
"""
152161
self.use_pq = use_pq
153162
self.num_neighbors = num_neighbors
154163
self.search_list_size = search_list_size

0 commit comments

Comments
 (0)