hnswlib 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9a4129957f2d395c00654d74062bec452fec715e148e8db2b5ad3e4f3bc815e
4
- data.tar.gz: 54691ff4e40f812327ffa019527654e936ef570a115b9082359828a2e9d14704
3
+ metadata.gz: 1cd9cbb9fec801aa832f424f382c7efe7818c4909d9f0909e39afbe6d095311a
4
+ data.tar.gz: 557b1bed74b3c53814d6b68c85d588583546a83bcc1998f4dbfd6c265c188797
5
5
  SHA512:
6
- metadata.gz: 1c766bbe540dc5d8135b56959c8e088f5ab1ffc4e104fd6f8ea39de350ed4e7313fa495d7d76cea294d63e68679ac024a7d842b1c454d0252dcd330516511264
7
- data.tar.gz: af8ce64f52e0361497f17ef0e316890e870ca637757790f64973bd7f15d7d195c00a1faa5dc9c651276d7d8fb8622efad0efee55a2666ff948576421e05f1392
6
+ metadata.gz: b764cd9bc82036ba04865a287caf78691e87b44eac24d74719d3956a26a5cc586f2c37f7dd44ad90bdc43d2bffbbe4902dd52f5599fe647e997b9a35e7bd5659
7
+ data.tar.gz: b20823f47c3a40ce39bd1edebe6e72b04084be07d16d55eef761d4c97fdda764bd3792691a57b94edf8c479a7ee5b786d02d66cbf7a861de63741d4a6cbc1b29
data/CHANGELOG.md CHANGED
@@ -1,4 +1,7 @@
1
- ## [Unreleased]
1
+ ## [0.1.1] - 2021-07-25
2
+
3
+ - Fix to use `rb_obj_is_isntance_of` for klass comparison due to type error when loading search index on irb 1.3.x: [issue #1](https://github.com/yoshoku/hnswlib.rb/issues/1)
4
+ - Update API documentation.
2
5
 
3
6
  ## [0.1.0] - 2021-07-24
4
7
 
@@ -241,7 +241,7 @@ class RbHnswlibHierarchicalNSW {
241
241
 
242
242
  rb_iv_set(self, "@space", kw_values[0]);
243
243
  hnswlib::SpaceInterface<float>* space;
244
- if (CLASS_OF(kw_values[0]) == rb_cHnswlibL2Space) {
244
+ if (rb_obj_is_instance_of(kw_values[0], rb_cHnswlibL2Space)) {
245
245
  space = RbHnswlibL2Space::get_hnsw_l2space(kw_values[0]);
246
246
  } else {
247
247
  space = RbHnswlibInnerProductSpace::get_hnsw_ipspace(kw_values[0]);
@@ -344,11 +344,12 @@ class RbHnswlibHierarchicalNSW {
344
344
 
345
345
  static VALUE _hnsw_hierarchicalnsw_load_index(VALUE self, VALUE _filename) {
346
346
  std::string filename(StringValuePtr(_filename));
347
+ VALUE ivspace = rb_iv_get(self, "@space");
347
348
  hnswlib::SpaceInterface<float>* space;
348
- if (CLASS_OF(rb_iv_get(self, "@space")) == rb_cHnswlibL2Space) {
349
- space = RbHnswlibL2Space::get_hnsw_l2space(rb_iv_get(self, "@space"));
349
+ if (rb_obj_is_instance_of(ivspace, rb_cHnswlibL2Space)) {
350
+ space = RbHnswlibL2Space::get_hnsw_l2space(ivspace);
350
351
  } else {
351
- space = RbHnswlibInnerProductSpace::get_hnsw_ipspace(rb_iv_get(self, "@space"));
352
+ space = RbHnswlibInnerProductSpace::get_hnsw_ipspace(ivspace);
352
353
  }
353
354
  get_hnsw_hierarchicalnsw(self)->loadIndex(filename, space);
354
355
  RB_GC_GUARD(_filename);
data/hnswlib.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  # Specify which files should be added to the gem when it is released.
21
21
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
22
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }.reject { |f| f.include?('dummy.rb') }
24
24
  end
25
25
  spec.bindir = 'exe'
26
26
  spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
data/lib/hnswlib.rb CHANGED
@@ -63,7 +63,6 @@ module Hnswlib
63
63
  # Remove the item vector.
64
64
  #
65
65
  # @param i [Integer] The ID of item.
66
- # @return [Array]
67
66
  def remove_item(i)
68
67
  @index.mark_deleted(i)
69
68
  end
@@ -3,7 +3,8 @@
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.1.0'
6
+ VERSION = '0.1.1'
7
+
7
8
  # The version of Hnswlib included with gem.
8
9
  HSWLIB_VERSION = '0.5.2'
9
10
  end
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.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - yoshoku
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-07-24 00:00:00.000000000 Z
11
+ date: 2021-07-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Hnswlib.rb provides Ruby bindings for the Hnswlib.
14
14
  email: