vectordb-bench 0.0.19__py3-none-any.whl → 0.0.21__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. vectordb_bench/__init__.py +49 -24
  2. vectordb_bench/__main__.py +4 -3
  3. vectordb_bench/backend/assembler.py +12 -13
  4. vectordb_bench/backend/cases.py +55 -45
  5. vectordb_bench/backend/clients/__init__.py +85 -14
  6. vectordb_bench/backend/clients/aliyun_elasticsearch/aliyun_elasticsearch.py +1 -2
  7. vectordb_bench/backend/clients/aliyun_elasticsearch/config.py +3 -4
  8. vectordb_bench/backend/clients/aliyun_opensearch/aliyun_opensearch.py +112 -77
  9. vectordb_bench/backend/clients/aliyun_opensearch/config.py +6 -7
  10. vectordb_bench/backend/clients/alloydb/alloydb.py +59 -84
  11. vectordb_bench/backend/clients/alloydb/cli.py +51 -34
  12. vectordb_bench/backend/clients/alloydb/config.py +30 -30
  13. vectordb_bench/backend/clients/api.py +13 -24
  14. vectordb_bench/backend/clients/aws_opensearch/aws_opensearch.py +50 -54
  15. vectordb_bench/backend/clients/aws_opensearch/cli.py +4 -7
  16. vectordb_bench/backend/clients/aws_opensearch/config.py +13 -9
  17. vectordb_bench/backend/clients/aws_opensearch/run.py +69 -59
  18. vectordb_bench/backend/clients/chroma/chroma.py +39 -40
  19. vectordb_bench/backend/clients/chroma/config.py +4 -2
  20. vectordb_bench/backend/clients/elastic_cloud/config.py +5 -5
  21. vectordb_bench/backend/clients/elastic_cloud/elastic_cloud.py +24 -26
  22. vectordb_bench/backend/clients/memorydb/cli.py +8 -8
  23. vectordb_bench/backend/clients/memorydb/config.py +2 -2
  24. vectordb_bench/backend/clients/memorydb/memorydb.py +67 -58
  25. vectordb_bench/backend/clients/milvus/cli.py +41 -83
  26. vectordb_bench/backend/clients/milvus/config.py +18 -8
  27. vectordb_bench/backend/clients/milvus/milvus.py +19 -39
  28. vectordb_bench/backend/clients/pgdiskann/cli.py +29 -22
  29. vectordb_bench/backend/clients/pgdiskann/config.py +29 -26
  30. vectordb_bench/backend/clients/pgdiskann/pgdiskann.py +56 -77
  31. vectordb_bench/backend/clients/pgvecto_rs/cli.py +9 -11
  32. vectordb_bench/backend/clients/pgvecto_rs/config.py +8 -14
  33. vectordb_bench/backend/clients/pgvecto_rs/pgvecto_rs.py +34 -43
  34. vectordb_bench/backend/clients/pgvector/cli.py +40 -31
  35. vectordb_bench/backend/clients/pgvector/config.py +63 -73
  36. vectordb_bench/backend/clients/pgvector/pgvector.py +98 -104
  37. vectordb_bench/backend/clients/pgvectorscale/cli.py +38 -24
  38. vectordb_bench/backend/clients/pgvectorscale/config.py +14 -15
  39. vectordb_bench/backend/clients/pgvectorscale/pgvectorscale.py +39 -49
  40. vectordb_bench/backend/clients/pinecone/config.py +1 -0
  41. vectordb_bench/backend/clients/pinecone/pinecone.py +15 -25
  42. vectordb_bench/backend/clients/qdrant_cloud/config.py +11 -10
  43. vectordb_bench/backend/clients/qdrant_cloud/qdrant_cloud.py +41 -35
  44. vectordb_bench/backend/clients/redis/cli.py +6 -12
  45. vectordb_bench/backend/clients/redis/config.py +7 -5
  46. vectordb_bench/backend/clients/redis/redis.py +95 -62
  47. vectordb_bench/backend/clients/test/cli.py +2 -3
  48. vectordb_bench/backend/clients/test/config.py +2 -2
  49. vectordb_bench/backend/clients/test/test.py +5 -9
  50. vectordb_bench/backend/clients/weaviate_cloud/cli.py +3 -4
  51. vectordb_bench/backend/clients/weaviate_cloud/config.py +2 -2
  52. vectordb_bench/backend/clients/weaviate_cloud/weaviate_cloud.py +37 -26
  53. vectordb_bench/backend/clients/zilliz_cloud/cli.py +14 -11
  54. vectordb_bench/backend/clients/zilliz_cloud/config.py +2 -4
  55. vectordb_bench/backend/clients/zilliz_cloud/zilliz_cloud.py +1 -1
  56. vectordb_bench/backend/data_source.py +18 -14
  57. vectordb_bench/backend/dataset.py +47 -27
  58. vectordb_bench/backend/result_collector.py +2 -3
  59. vectordb_bench/backend/runner/__init__.py +4 -6
  60. vectordb_bench/backend/runner/mp_runner.py +56 -23
  61. vectordb_bench/backend/runner/rate_runner.py +30 -19
  62. vectordb_bench/backend/runner/read_write_runner.py +46 -22
  63. vectordb_bench/backend/runner/serial_runner.py +81 -46
  64. vectordb_bench/backend/runner/util.py +4 -3
  65. vectordb_bench/backend/task_runner.py +92 -92
  66. vectordb_bench/backend/utils.py +17 -10
  67. vectordb_bench/base.py +0 -1
  68. vectordb_bench/cli/cli.py +65 -60
  69. vectordb_bench/cli/vectordbbench.py +6 -7
  70. vectordb_bench/frontend/components/check_results/charts.py +8 -19
  71. vectordb_bench/frontend/components/check_results/data.py +4 -16
  72. vectordb_bench/frontend/components/check_results/filters.py +8 -16
  73. vectordb_bench/frontend/components/check_results/nav.py +4 -4
  74. vectordb_bench/frontend/components/check_results/priceTable.py +1 -3
  75. vectordb_bench/frontend/components/check_results/stPageConfig.py +2 -1
  76. vectordb_bench/frontend/components/concurrent/charts.py +12 -12
  77. vectordb_bench/frontend/components/custom/displayCustomCase.py +17 -11
  78. vectordb_bench/frontend/components/custom/displaypPrams.py +4 -2
  79. vectordb_bench/frontend/components/custom/getCustomConfig.py +1 -2
  80. vectordb_bench/frontend/components/custom/initStyle.py +1 -1
  81. vectordb_bench/frontend/components/get_results/saveAsImage.py +2 -0
  82. vectordb_bench/frontend/components/run_test/caseSelector.py +3 -9
  83. vectordb_bench/frontend/components/run_test/dbConfigSetting.py +1 -4
  84. vectordb_bench/frontend/components/run_test/dbSelector.py +1 -1
  85. vectordb_bench/frontend/components/run_test/generateTasks.py +8 -8
  86. vectordb_bench/frontend/components/run_test/submitTask.py +14 -18
  87. vectordb_bench/frontend/components/tables/data.py +3 -6
  88. vectordb_bench/frontend/config/dbCaseConfigs.py +51 -84
  89. vectordb_bench/frontend/pages/concurrent.py +3 -5
  90. vectordb_bench/frontend/pages/custom.py +30 -9
  91. vectordb_bench/frontend/pages/quries_per_dollar.py +3 -3
  92. vectordb_bench/frontend/pages/run_test.py +3 -7
  93. vectordb_bench/frontend/utils.py +1 -1
  94. vectordb_bench/frontend/vdb_benchmark.py +4 -6
  95. vectordb_bench/interface.py +45 -24
  96. vectordb_bench/log_util.py +59 -64
  97. vectordb_bench/metric.py +10 -11
  98. vectordb_bench/models.py +26 -43
  99. {vectordb_bench-0.0.19.dist-info → vectordb_bench-0.0.21.dist-info}/METADATA +22 -15
  100. vectordb_bench-0.0.21.dist-info/RECORD +135 -0
  101. {vectordb_bench-0.0.19.dist-info → vectordb_bench-0.0.21.dist-info}/WHEEL +1 -1
  102. vectordb_bench-0.0.19.dist-info/RECORD +0 -135
  103. {vectordb_bench-0.0.19.dist-info → vectordb_bench-0.0.21.dist-info}/LICENSE +0 -0
  104. {vectordb_bench-0.0.19.dist-info → vectordb_bench-0.0.21.dist-info}/entry_points.txt +0 -0
  105. {vectordb_bench-0.0.19.dist-info → vectordb_bench-0.0.21.dist-info}/top_level.txt +0 -0
@@ -1,12 +1,12 @@
1
1
  from enum import Enum
2
- from typing import Type
2
+
3
3
  from .api import (
4
- VectorDB,
5
- DBConfig,
6
4
  DBCaseConfig,
5
+ DBConfig,
7
6
  EmptyDBCaseConfig,
8
7
  IndexType,
9
8
  MetricType,
9
+ VectorDB,
10
10
  )
11
11
 
12
12
 
@@ -41,200 +41,265 @@ class DB(Enum):
41
41
  Test = "test"
42
42
  AliyunOpenSearch = "AliyunOpenSearch"
43
43
 
44
-
45
44
  @property
46
- def init_cls(self) -> Type[VectorDB]:
45
+ def init_cls(self) -> type[VectorDB]: # noqa: PLR0911, PLR0912, C901
47
46
  """Import while in use"""
48
47
  if self == DB.Milvus:
49
48
  from .milvus.milvus import Milvus
49
+
50
50
  return Milvus
51
51
 
52
52
  if self == DB.ZillizCloud:
53
53
  from .zilliz_cloud.zilliz_cloud import ZillizCloud
54
+
54
55
  return ZillizCloud
55
56
 
56
57
  if self == DB.Pinecone:
57
58
  from .pinecone.pinecone import Pinecone
59
+
58
60
  return Pinecone
59
61
 
60
62
  if self == DB.ElasticCloud:
61
63
  from .elastic_cloud.elastic_cloud import ElasticCloud
64
+
62
65
  return ElasticCloud
63
66
 
64
67
  if self == DB.QdrantCloud:
65
68
  from .qdrant_cloud.qdrant_cloud import QdrantCloud
69
+
66
70
  return QdrantCloud
67
71
 
68
72
  if self == DB.WeaviateCloud:
69
73
  from .weaviate_cloud.weaviate_cloud import WeaviateCloud
74
+
70
75
  return WeaviateCloud
71
76
 
72
77
  if self == DB.PgVector:
73
78
  from .pgvector.pgvector import PgVector
79
+
74
80
  return PgVector
75
81
 
76
82
  if self == DB.PgVectoRS:
77
83
  from .pgvecto_rs.pgvecto_rs import PgVectoRS
84
+
78
85
  return PgVectoRS
79
-
86
+
80
87
  if self == DB.PgVectorScale:
81
88
  from .pgvectorscale.pgvectorscale import PgVectorScale
89
+
82
90
  return PgVectorScale
83
91
 
84
92
  if self == DB.PgDiskANN:
85
93
  from .pgdiskann.pgdiskann import PgDiskANN
94
+
86
95
  return PgDiskANN
87
96
 
88
97
  if self == DB.Redis:
89
98
  from .redis.redis import Redis
99
+
90
100
  return Redis
91
-
101
+
92
102
  if self == DB.MemoryDB:
93
103
  from .memorydb.memorydb import MemoryDB
104
+
94
105
  return MemoryDB
95
106
 
96
107
  if self == DB.Chroma:
97
108
  from .chroma.chroma import ChromaClient
109
+
98
110
  return ChromaClient
99
111
 
100
112
  if self == DB.AWSOpenSearch:
101
113
  from .aws_opensearch.aws_opensearch import AWSOpenSearch
114
+
102
115
  return AWSOpenSearch
103
-
116
+
104
117
  if self == DB.AlloyDB:
105
118
  from .alloydb.alloydb import AlloyDB
119
+
106
120
  return AlloyDB
107
121
 
108
122
  if self == DB.AliyunElasticsearch:
109
123
  from .aliyun_elasticsearch.aliyun_elasticsearch import AliyunElasticsearch
124
+
110
125
  return AliyunElasticsearch
111
126
 
112
127
  if self == DB.AliyunOpenSearch:
113
128
  from .aliyun_opensearch.aliyun_opensearch import AliyunOpenSearch
129
+
114
130
  return AliyunOpenSearch
115
131
 
132
+ if self == DB.Test:
133
+ from .test.test import Test
134
+
135
+ return Test
136
+
137
+ msg = f"Unknown DB: {self.name}"
138
+ raise ValueError(msg)
139
+
116
140
  @property
117
- def config_cls(self) -> Type[DBConfig]:
141
+ def config_cls(self) -> type[DBConfig]: # noqa: PLR0911, PLR0912, C901
118
142
  """Import while in use"""
119
143
  if self == DB.Milvus:
120
144
  from .milvus.config import MilvusConfig
145
+
121
146
  return MilvusConfig
122
147
 
123
148
  if self == DB.ZillizCloud:
124
149
  from .zilliz_cloud.config import ZillizCloudConfig
150
+
125
151
  return ZillizCloudConfig
126
152
 
127
153
  if self == DB.Pinecone:
128
154
  from .pinecone.config import PineconeConfig
155
+
129
156
  return PineconeConfig
130
157
 
131
158
  if self == DB.ElasticCloud:
132
159
  from .elastic_cloud.config import ElasticCloudConfig
160
+
133
161
  return ElasticCloudConfig
134
162
 
135
163
  if self == DB.QdrantCloud:
136
164
  from .qdrant_cloud.config import QdrantConfig
165
+
137
166
  return QdrantConfig
138
167
 
139
168
  if self == DB.WeaviateCloud:
140
169
  from .weaviate_cloud.config import WeaviateConfig
170
+
141
171
  return WeaviateConfig
142
172
 
143
173
  if self == DB.PgVector:
144
174
  from .pgvector.config import PgVectorConfig
175
+
145
176
  return PgVectorConfig
146
177
 
147
178
  if self == DB.PgVectoRS:
148
179
  from .pgvecto_rs.config import PgVectoRSConfig
180
+
149
181
  return PgVectoRSConfig
150
182
 
151
183
  if self == DB.PgVectorScale:
152
184
  from .pgvectorscale.config import PgVectorScaleConfig
185
+
153
186
  return PgVectorScaleConfig
154
187
 
155
188
  if self == DB.PgDiskANN:
156
189
  from .pgdiskann.config import PgDiskANNConfig
190
+
157
191
  return PgDiskANNConfig
158
192
 
159
193
  if self == DB.Redis:
160
194
  from .redis.config import RedisConfig
195
+
161
196
  return RedisConfig
162
-
197
+
163
198
  if self == DB.MemoryDB:
164
199
  from .memorydb.config import MemoryDBConfig
200
+
165
201
  return MemoryDBConfig
166
202
 
167
203
  if self == DB.Chroma:
168
204
  from .chroma.config import ChromaConfig
205
+
169
206
  return ChromaConfig
170
207
 
171
208
  if self == DB.AWSOpenSearch:
172
209
  from .aws_opensearch.config import AWSOpenSearchConfig
210
+
173
211
  return AWSOpenSearchConfig
174
-
212
+
175
213
  if self == DB.AlloyDB:
176
214
  from .alloydb.config import AlloyDBConfig
215
+
177
216
  return AlloyDBConfig
178
217
 
179
218
  if self == DB.AliyunElasticsearch:
180
219
  from .aliyun_elasticsearch.config import AliyunElasticsearchConfig
220
+
181
221
  return AliyunElasticsearchConfig
182
222
 
183
223
  if self == DB.AliyunOpenSearch:
184
224
  from .aliyun_opensearch.config import AliyunOpenSearchConfig
225
+
185
226
  return AliyunOpenSearchConfig
186
227
 
187
- def case_config_cls(self, index_type: IndexType | None = None) -> Type[DBCaseConfig]:
228
+ if self == DB.Test:
229
+ from .test.config import TestConfig
230
+
231
+ return TestConfig
232
+
233
+ msg = f"Unknown DB: {self.name}"
234
+ raise ValueError(msg)
235
+
236
+ def case_config_cls( # noqa: PLR0911
237
+ self,
238
+ index_type: IndexType | None = None,
239
+ ) -> type[DBCaseConfig]:
188
240
  if self == DB.Milvus:
189
241
  from .milvus.config import _milvus_case_config
242
+
190
243
  return _milvus_case_config.get(index_type)
191
244
 
192
245
  if self == DB.ZillizCloud:
193
246
  from .zilliz_cloud.config import AutoIndexConfig
247
+
194
248
  return AutoIndexConfig
195
249
 
196
250
  if self == DB.ElasticCloud:
197
251
  from .elastic_cloud.config import ElasticCloudIndexConfig
252
+
198
253
  return ElasticCloudIndexConfig
199
254
 
200
255
  if self == DB.QdrantCloud:
201
256
  from .qdrant_cloud.config import QdrantIndexConfig
257
+
202
258
  return QdrantIndexConfig
203
259
 
204
260
  if self == DB.WeaviateCloud:
205
261
  from .weaviate_cloud.config import WeaviateIndexConfig
262
+
206
263
  return WeaviateIndexConfig
207
264
 
208
265
  if self == DB.PgVector:
209
266
  from .pgvector.config import _pgvector_case_config
267
+
210
268
  return _pgvector_case_config.get(index_type)
211
269
 
212
270
  if self == DB.PgVectoRS:
213
271
  from .pgvecto_rs.config import _pgvecto_rs_case_config
272
+
214
273
  return _pgvecto_rs_case_config.get(index_type)
215
274
 
216
275
  if self == DB.AWSOpenSearch:
217
276
  from .aws_opensearch.config import AWSOpenSearchIndexConfig
277
+
218
278
  return AWSOpenSearchIndexConfig
219
279
 
220
280
  if self == DB.PgVectorScale:
221
281
  from .pgvectorscale.config import _pgvectorscale_case_config
282
+
222
283
  return _pgvectorscale_case_config.get(index_type)
223
284
 
224
285
  if self == DB.PgDiskANN:
225
286
  from .pgdiskann.config import _pgdiskann_case_config
287
+
226
288
  return _pgdiskann_case_config.get(index_type)
227
-
289
+
228
290
  if self == DB.AlloyDB:
229
291
  from .alloydb.config import _alloydb_case_config
292
+
230
293
  return _alloydb_case_config.get(index_type)
231
294
 
232
295
  if self == DB.AliyunElasticsearch:
233
296
  from .elastic_cloud.config import ElasticCloudIndexConfig
297
+
234
298
  return ElasticCloudIndexConfig
235
299
 
236
300
  if self == DB.AliyunOpenSearch:
237
301
  from .aliyun_opensearch.config import AliyunOpenSearchIndexConfig
302
+
238
303
  return AliyunOpenSearchIndexConfig
239
304
 
240
305
  # DB.Pinecone, DB.Chroma, DB.Redis
@@ -242,5 +307,11 @@ class DB(Enum):
242
307
 
243
308
 
244
309
  __all__ = [
245
- "DB", "VectorDB", "DBConfig", "DBCaseConfig", "IndexType", "MetricType", "EmptyDBCaseConfig",
310
+ "DB",
311
+ "DBCaseConfig",
312
+ "DBConfig",
313
+ "EmptyDBCaseConfig",
314
+ "IndexType",
315
+ "MetricType",
316
+ "VectorDB",
246
317
  ]
@@ -1,5 +1,5 @@
1
- from ..elastic_cloud.elastic_cloud import ElasticCloud
2
1
  from ..elastic_cloud.config import ElasticCloudIndexConfig
2
+ from ..elastic_cloud.elastic_cloud import ElasticCloud
3
3
 
4
4
 
5
5
  class AliyunElasticsearch(ElasticCloud):
@@ -24,4 +24,3 @@ class AliyunElasticsearch(ElasticCloud):
24
24
  drop_old=drop_old,
25
25
  **kwargs,
26
26
  )
27
-
@@ -1,7 +1,6 @@
1
- from enum import Enum
2
- from pydantic import SecretStr, BaseModel
1
+ from pydantic import BaseModel, SecretStr
3
2
 
4
- from ..api import DBConfig, DBCaseConfig, MetricType, IndexType
3
+ from ..api import DBConfig
5
4
 
6
5
 
7
6
  class AliyunElasticsearchConfig(DBConfig, BaseModel):
@@ -14,6 +13,6 @@ class AliyunElasticsearchConfig(DBConfig, BaseModel):
14
13
 
15
14
  def to_dict(self) -> dict:
16
15
  return {
17
- "hosts": [{'scheme': self.scheme, 'host': self.host, 'port': self.port}],
16
+ "hosts": [{"scheme": self.scheme, "host": self.host, "port": self.port}],
18
17
  "basic_auth": (self.user, self.password.get_secret_value()),
19
18
  }