usearch 2.0.0 → 2.0.2

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.
@@ -273,6 +273,7 @@ jobs:
273
273
 
274
274
  build_csharp:
275
275
  name: Build NuGet
276
+ needs: versioning
276
277
  strategy:
277
278
  matrix:
278
279
  os: [ubuntu-latest, macos-latest, windows-latest]
@@ -282,6 +283,8 @@ jobs:
282
283
  shell: bash
283
284
  steps:
284
285
  - uses: actions/checkout@v3
286
+ with:
287
+ ref: 'main'
285
288
  - run: git submodule update --init --recursive
286
289
 
287
290
  - name: Ubuntu/macOS build usearch shared obj
@@ -344,7 +347,7 @@ jobs:
344
347
 
345
348
  - name: Publish NuGet packages
346
349
  run: |
347
- dotnet nuget push "${{ env.NUGET_DIR }}/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source "${{ env.NUGET_SOURCE }}"
350
+ dotnet nuget push "${{ env.NUGET_DIR }}/*.nupkg" --api-key "${{ secrets.NUGET_API }}" --source "${{ env.NUGET_SOURCE }}"
348
351
 
349
352
  build_docs:
350
353
  name: Build Docs
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "2.0.0"
3
+ version = "2.0.2"
4
4
  authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/README.md CHANGED
@@ -28,6 +28,7 @@ Euclidean • Angular • Bitwise • Haversine • User-Defined Metrics
28
28
  <a href="https://unum-cloud.github.io/usearch/c">C 99</a> •
29
29
  <a href="https://unum-cloud.github.io/usearch/objective-c">Objective-C</a> •
30
30
  <a href="https://unum-cloud.github.io/usearch/swift">Swift</a> •
31
+ <a href="https://unum-cloud.github.io/usearch/csharp">C#</a> •
31
32
  <a href="https://unum-cloud.github.io/usearch/golang">GoLang</a> •
32
33
  <a href="https://unum-cloud.github.io/usearch/wolfram">Wolfram</a>
33
34
  <br/>
@@ -38,6 +39,8 @@ Linux • MacOS • Windows • iOS • Docker • WebAssembly
38
39
  <a href="https://pypi.org/project/usearch/"> <img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/usearch?label=pypi%20downloads"> </a>
39
40
  <a href="https://www.npmjs.com/package/usearch"> <img alt="npm" src="https://img.shields.io/npm/dy/usearch?label=npm%20dowloads"> </a>
40
41
  <a href="https://crates.io/crates/usearch"> <img alt="Crates.io" src="https://img.shields.io/crates/d/usearch?label=crate%20downloads"> </a>
42
+ <a href="https://www.nuget.org/packages/Cloud.Unum.USearch"> <img alt="Nuget" src="https://img.shields.io/nuget/dt/Cloud.Unum.USearch?style=social&label=NuGet"> </a>
43
+ <a href="https://hub.docker.com/r/unum/usearch"> <img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/unum/usearch?style=social&label=Docker"> </a>
41
44
  <img alt="GitHub code size in bytes" src="https://img.shields.io/github/languages/code-size/unum-cloud/usearch">
42
45
  </div>
43
46
 
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 = '2.0.0'
7
+ version = '2.0.2'
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/csharp/README.md CHANGED
@@ -3,17 +3,17 @@
3
3
  ## Installation
4
4
 
5
5
  ```sh
6
- dotnet add package Cloud.Unum.USearch -s https://apiint.nugettest.org/v3/index.json
6
+ dotnet add package Cloud.Unum.USearch
7
7
  ```
8
8
 
9
9
  ## Quickstart
10
10
 
11
- ```C#
11
+ ```csharp
12
12
  using System.Diagnostics;
13
13
  using Cloud.Unum.USearch;
14
14
 
15
15
  using var index = new USearchIndex(
16
- metricKind: MetricKind.Cos, //Choose cosine metric
16
+ metricKind: MetricKind.Cos, // Choose cosine metric
17
17
  quantization: ScalarKind.Float32, // Only quantization to Float32, Float64 is currently supported
18
18
  dimensions: 3, // Define the number of dimensions in input vectors
19
19
  connectivity: 16, // How frequent should the connections in the graph be, optional
@@ -29,14 +29,11 @@ Trace.Assert(index.Size() == 1);
29
29
  Trace.Assert(matches == 1);
30
30
  Trace.Assert(keys[0] == 42);
31
31
  Trace.Assert(distances[0] <= 0.001f);
32
- // USearchIndex obj created with "using statement" and implements IDisposable,
33
- // otherwise call it explicitly:
34
- // index.Dispose();
35
32
  ```
36
33
 
37
34
  ## Serialization
38
35
 
39
- ```C#
36
+ ```csharp
40
37
  index.Save("index.usearch")
41
38
 
42
39
  // Copy the whole index into memory
@@ -55,7 +52,7 @@ Trace.Assert(indexLoaded.Contains(42));
55
52
 
56
53
  Adding a batch of entries is identical to adding a single vector.
57
54
 
58
- ```C#
55
+ ```csharp
59
56
  using var index = new USearchIndex(MetricKind.Cos, ScalarKind.Float32, dimensions: 3);
60
57
 
61
58
  // Generate keys and random vectors
@@ -0,0 +1,6 @@
1
+ ==============
2
+ C# SDK
3
+ ==============
4
+
5
+
6
+ .. mdinclude:: ../../csharp/README.md
package/docs/index.rst CHANGED
@@ -14,6 +14,7 @@ Overview
14
14
  java/index
15
15
  c/index
16
16
  swift/index
17
+ csharp/index
17
18
  golang/index
18
19
  wolfram/index
19
20
 
@@ -409,7 +409,10 @@ template <typename allocator_at = std::allocator<byte_t>> class bitset_gt {
409
409
  ~bitset_gt() noexcept { reset(); }
410
410
 
411
411
  explicit operator bool() const noexcept { return slots_; }
412
- void clear() noexcept { std::memset(slots_, 0, count_ * sizeof(compressed_slot_t)); }
412
+ void clear() noexcept {
413
+ if (slots_)
414
+ std::memset(slots_, 0, count_ * sizeof(compressed_slot_t));
415
+ }
413
416
 
414
417
  void reset() noexcept {
415
418
  if (slots_)
@@ -857,7 +860,8 @@ class growing_hash_set_gt {
857
860
  std::size_t size() const noexcept { return count_; }
858
861
 
859
862
  void clear() noexcept {
860
- std::memset((void*)slots_, 0xFF, capacity_ * sizeof(element_t));
863
+ if (slots_)
864
+ std::memset((void*)slots_, 0xFF, capacity_ * sizeof(element_t));
861
865
  count_ = 0;
862
866
  }
863
867
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usearch",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ash Vardanian",
6
6
  "license": "Apache 2.0",
package/wasmer.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name="unum/usearch"
3
- version="2.0.0"
3
+ version="2.0.2"
4
4
  description="Smaller & Faster Single-File Vector Search Engine from Unum"
5
5
  license="Apache-2.0"
6
6
  readme="README.md"