usearch 0.16.3 → 0.17.0

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.
@@ -17,7 +17,7 @@ permissions:
17
17
 
18
18
  jobs:
19
19
 
20
- test_python:
20
+ test_python_311:
21
21
  name: Test Python
22
22
  runs-on: ${{ matrix.os }}
23
23
  strategy:
@@ -41,6 +41,36 @@ jobs:
41
41
  - name: Test with PyTest
42
42
  run: pytest python/scripts/test.py
43
43
 
44
+
45
+ test_python_36:
46
+ name: Test Python 3.6
47
+ runs-on: ${{ matrix.os }}
48
+ strategy:
49
+ matrix:
50
+ os: [ubuntu-20.04]
51
+ python-version: ["3.6"]
52
+
53
+ steps:
54
+ - uses: actions/checkout@v3
55
+ - run: git submodule update --init --recursive
56
+
57
+ - name: Set up Python ${{ matrix.python-version }}
58
+ uses: actions/setup-python@v4
59
+ with:
60
+ python-version: ${{ matrix.python-version }}
61
+
62
+ - name: Install dependencies
63
+ run: |
64
+ python -m pip install --upgrade pip
65
+ pip install pytest numpy dataclasses
66
+
67
+ - name: Build locally
68
+ run: python -m pip install .
69
+
70
+ - name: Test with PyTest
71
+ run: pytest python/scripts/test.py
72
+
73
+
44
74
  test_javascript:
45
75
  name: Test JavaScript
46
76
  runs-on: ubuntu-latest
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "0.16.3"
3
+ version = "0.17.0"
4
4
  authors = ["Ashot Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/conanfile.py CHANGED
@@ -4,7 +4,7 @@ from conans import ConanFile
4
4
  class USearchConan(ConanFile):
5
5
 
6
6
  name = 'USearch'
7
- version = '0.16.3'
7
+ version = '0.17.0'
8
8
  license = 'Apache 2.0'
9
9
  url = 'https://github.com/unum-cloud/usearch'
10
10
  description = 'Smaller & Faster Single-File Vector Search Engine from Unum'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usearch",
3
- "version": "0.16.3",
3
+ "version": "0.17.0",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ashot Vardanian",
6
6
  "license": "Apache 2.0",
@@ -1,5 +1,4 @@
1
- from typing import Tuple, Any, Callable, Union, Optional, List
2
- from dataclasses import dataclass, asdict
1
+ from typing import Tuple, Any, Callable, Union, Optional, List, NamedTuple
3
2
  from collections import defaultdict
4
3
 
5
4
  import numpy as np
@@ -90,8 +89,7 @@ def measure_seconds(f: Callable) -> Tuple[float, Any]:
90
89
  return secs, result
91
90
 
92
91
 
93
- @dataclass
94
- class Dataset:
92
+ class Dataset(NamedTuple):
95
93
 
96
94
  labels: np.ndarray
97
95
  vectors: np.ndarray
@@ -165,8 +163,7 @@ class Dataset:
165
163
  return d
166
164
 
167
165
 
168
- @dataclass
169
- class TaskResult:
166
+ class TaskResult(NamedTuple):
170
167
 
171
168
  add_operations: Optional[int] = None
172
169
  add_per_second: Optional[float] = None
@@ -193,7 +190,7 @@ class TaskResult:
193
190
  def search_seconds(self) -> float:
194
191
  return self.search_operations / self.search_per_second
195
192
 
196
- def __add__(self, other: TaskResult):
193
+ def __add__(self, other):
197
194
  result = TaskResult()
198
195
  if self.add_operations and other.add_operations:
199
196
  result.add_operations = self.add_operations + other.add_operations
@@ -220,8 +217,7 @@ class TaskResult:
220
217
  return result
221
218
 
222
219
 
223
- @dataclass
224
- class AddTask:
220
+ class AddTask(NamedTuple):
225
221
 
226
222
  labels: np.ndarray
227
223
  vectors: np.ndarray
@@ -284,8 +280,7 @@ class AddTask:
284
280
  ) for rows in partitioning.values()]
285
281
 
286
282
 
287
- @dataclass
288
- class SearchTask:
283
+ class SearchTask(NamedTuple):
289
284
 
290
285
  queries: np.ndarray
291
286
  neighbors: np.ndarray
@@ -310,8 +305,7 @@ class SearchTask:
310
305
  ) for start_row in range(0, self.queries.shape[0], batch_size)]
311
306
 
312
307
 
313
- @dataclass
314
- class Evaluation:
308
+ class Evaluation(NamedTuple):
315
309
 
316
310
  tasks: List[Union[AddTask, SearchTask]]
317
311
  count: int
@@ -362,5 +356,5 @@ class Evaluation:
362
356
  index.clear()
363
357
  return {
364
358
  **index.specs,
365
- **asdict(task_result),
359
+ **task_result._asdict(),
366
360
  }