hnswlib 0.2.0 → 0.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84f3ca262eddd8b331cbedc163e55e28d77eba76d2184332fef6afd0e2ddcce5
4
- data.tar.gz: 248f8ca655ae83e2f56b26910dde6e96a23771040d61bac7ee7204e294063c2a
3
+ metadata.gz: 7823039ef0a73f79011cbbb4dd8bb90f56549d82c93cee311725a2e728ab8809
4
+ data.tar.gz: be1846136d1d87c63d3aa49c404f9148c8d04d8c0ba4af65d6297096b5683150
5
5
  SHA512:
6
- metadata.gz: 56d528a7ce9af7f96b291e74fc6a4c8ff1d3da3d66e1dbeed0dc8e884f5f5822b04e35d0fb12f83155a97ac1505a9a1db7b245cdcb2b08ba96ae6657743ccfeb
7
- data.tar.gz: 47ca9c4db92798e07576505bc0c6b2a4f3ffb8afdcfdd020226232d8fca31d4259571509ce08ccde8eeecd06bcfa7cc2a5512c29d2568fa9b5d0ec0736aaa2ea
6
+ metadata.gz: 5ddd709e8bd403b959c7ab8bc21b17b6e264da0976a2d85a4acd7edeb057b7771d53fac337d3a6dfdd2718dcd499efd2b0f8633170241dd01269cd34753be10a
7
+ data.tar.gz: 11fd6ee5ca94949665fa30a106e926283c9e190030b47b6b001b0fd755ff5512f8b913b02bb79f1b51cb851c50867d0dca1a861fb2f09b6805e4d0b74bb033b5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [0.3.0] - 2021-08-08
2
+
3
+ - Rename `Hnswlib::Index` to `Hnswlib::HnswIndex` (for compatibility, `Hnswlib::Index` has been an alis for `Hnswlib::HnswIndex`).
4
+ - Update API documentation.
5
+
1
6
  ## [0.2.0] - 2021-08-02
2
7
 
3
8
  - Add binding class for the BruteforceSearch.
data/README.md CHANGED
@@ -35,7 +35,7 @@ Or install it yourself as:
35
35
  require 'hnswlib'
36
36
 
37
37
  f = 40 # length of item vector that will be indexed.
38
- t = Hnswlib::Index.new(n_features: f, max_item: 1000)
38
+ t = Hnswlib::HnswIndex.new(n_features: f, max_item: 1000)
39
39
 
40
40
  1000.times do |i|
41
41
  v = Array.new(f) { rand }
@@ -44,7 +44,7 @@ end
44
44
 
45
45
  t.save('test.ann')
46
46
 
47
- u = Hnswlib::Index.new(n_features: f, max_item: 1000)
47
+ u = Hnswlib::HnswIndex.new(n_features: f, max_item: 1000)
48
48
  u.load('test.ann')
49
49
  p u.get_nns_by_item(0, 100) # will find the 100 nearest neighbors.
50
50
  ```
data/lib/hnswlib.rb CHANGED
@@ -4,12 +4,12 @@ require_relative 'hnswlib/version'
4
4
  require_relative 'hnswlib/hnswlibext'
5
5
 
6
6
  module Hnswlib
7
- # Index is a class that provides functions for k-nearest eighbors search.
7
+ # HnswIndex is a class that provides functions for k-nearest eighbors search.
8
8
  #
9
9
  # @example
10
10
  # require 'hnswlib'
11
11
  #
12
- # index = Hnswlib::Index.new(n_features: 100, max_item: 10000)
12
+ # index = Hnswlib::HnswIndex.new(n_features: 100, max_item: 10000)
13
13
  #
14
14
  # 5000.times do |item_id|
15
15
  # item_vec = Array.new(100) { rand - 0.5 }
@@ -18,7 +18,7 @@ module Hnswlib
18
18
  #
19
19
  # index.get_nns_by_item(0, 100)
20
20
  #
21
- class Index
21
+ class HnswIndex
22
22
  # Returns the metric of index.
23
23
  # @return [String]
24
24
  attr_reader :metric
@@ -150,4 +150,7 @@ module Hnswlib
150
150
  @index.max_elements
151
151
  end
152
152
  end
153
+
154
+ # Index is alias of HnswIndex
155
+ Index = ::Hnswlib::HnswIndex
153
156
  end
@@ -3,7 +3,7 @@
3
3
  # Hnswlib.rb provides Ruby bindings for the Hnswlib.
4
4
  module Hnswlib
5
5
  # The version of Hnswlib.rb you install.
6
- VERSION = '0.2.0'
6
+ VERSION = '0.3.0'
7
7
 
8
8
  # The version of Hnswlib included with gem.
9
9
  HSWLIB_VERSION = '0.5.2'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hnswlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-08-02 00:00:00.000000000 Z
11
+ date: 2021-08-08 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Hnswlib.rb provides Ruby bindings for the Hnswlib.
14
14
  email: