usearch 0.9.5 → 0.9.7

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.
@@ -40,6 +40,9 @@ jobs:
40
40
  - name: Test with PyTest on NIX
41
41
  if: matrix.os != 'windows-2022'
42
42
  run: pytest python/scripts/test.py
43
+ - name: Test with PyTest on Windows
44
+ if: matrix.os == 'windows-2022'
45
+ run: pytest python\scripts\test.py
43
46
 
44
47
  test_javascript:
45
48
  name: Test JavaScript
@@ -33,7 +33,7 @@ jobs:
33
33
  runs-on: ${{ matrix.os }}
34
34
  strategy:
35
35
  matrix:
36
- os: [ubuntu-20.04, macOS-11, windows-2022]
36
+ os: [ubuntu-20.04, macOS-11]
37
37
 
38
38
  steps:
39
39
  - uses: actions/checkout@v3
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "0.9.5"
3
+ version = "0.9.7"
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/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.5
1
+ 0.9.7
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.9.5'
7
+ version = '0.9.7'
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.9.5",
3
+ "version": "0.9.7",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ashot Vardanian",
6
6
  "license": "Apache 2.0",
package/rust/lib.rs CHANGED
@@ -14,27 +14,27 @@ pub mod ffi {
14
14
 
15
15
  type Index;
16
16
 
17
- fn new_ip(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
18
- fn new_l2sq(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
19
- fn new_cos(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
20
- fn new_haversine(quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
17
+ pub fn new_ip(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
18
+ pub fn new_l2sq(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
19
+ pub fn new_cos(dimensions: usize, quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
20
+ pub fn new_haversine(quantization: &str, connectivity: usize, expansion_add: usize, expansion_search: usize) -> Result<UniquePtr<Index>>;
21
21
 
22
- fn reserve(self: &Index, capacity: usize) -> Result<()>;
22
+ pub fn reserve(self: &Index, capacity: usize) -> Result<()>;
23
23
 
24
- fn dimensions(self: &Index) -> usize;
25
- fn connectivity(self: &Index) -> usize;
26
- fn size(self: &Index) -> usize;
27
- fn capacity(self: &Index) -> usize;
24
+ pub fn dimensions(self: &Index) -> usize;
25
+ pub fn connectivity(self: &Index) -> usize;
26
+ pub fn size(self: &Index) -> usize;
27
+ pub fn capacity(self: &Index) -> usize;
28
28
 
29
- fn add(self: &Index, label: u32, vector: &[f32]) -> Result<()>;
30
- fn search(self: &Index, query: &[f32], count: usize) -> Result<Matches>;
29
+ pub fn add(self: &Index, label: u32, vector: &[f32]) -> Result<()>;
30
+ pub fn search(self: &Index, query: &[f32], count: usize) -> Result<Matches>;
31
31
 
32
- fn add_in_thread(self: &Index, label: u32, vector: &[f32], thread: usize) -> Result<()>;
33
- fn search_in_thread(self: &Index, query: &[f32], count: usize, thread: usize) -> Result<Matches>;
32
+ pub fn add_in_thread(self: &Index, label: u32, vector: &[f32], thread: usize) -> Result<()>;
33
+ pub fn search_in_thread(self: &Index, query: &[f32], count: usize, thread: usize) -> Result<Matches>;
34
34
 
35
- fn save(self: &Index, path: &str) -> Result<()>;
36
- fn load(self: &Index, path: &str) -> Result<()>;
37
- fn view(self: &Index, path: &str) -> Result<()>;
35
+ pub fn save(self: &Index, path: &str) -> Result<()>;
36
+ pub fn load(self: &Index, path: &str) -> Result<()>;
37
+ pub fn view(self: &Index, path: &str) -> Result<()>;
38
38
  }
39
39
  }
40
40
 
package/src/punned.hpp CHANGED
@@ -538,13 +538,19 @@ class punned_gt {
538
538
  private:
539
539
  static index_t* aligned_index_alloc_() {
540
540
  #if defined(USEARCH_IS_WINDOWS)
541
- return (index_t*)_aligned_malloc(64, 64 * divide_round_up<64>(sizeof(index_t)));
541
+ return (index_t*)_aligned_malloc(64 * divide_round_up<64>(sizeof(index_t)), 64);
542
542
  #else
543
543
  return (index_t*)aligned_alloc(64, 64 * divide_round_up<64>(sizeof(index_t)));
544
544
  #endif
545
545
  }
546
546
 
547
- static void aligned_index_free_(index_t* raw) { free(raw); }
547
+ static void aligned_index_free_(index_t* raw) {
548
+ #if defined(USEARCH_IS_WINDOWS)
549
+ _aligned_free(raw);
550
+ #else
551
+ free(raw);
552
+ #endif
553
+ }
548
554
 
549
555
  struct thread_lock_t {
550
556
  punned_gt const& parent;