hnswlib 0.1.0 → 0.1.1
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 +4 -4
- data/CHANGELOG.md +4 -1
- data/ext/hnswlib/hnswlibext.hpp +5 -4
- data/hnswlib.gemspec +1 -1
- data/lib/hnswlib.rb +0 -1
- data/lib/hnswlib/version.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cd9cbb9fec801aa832f424f382c7efe7818c4909d9f0909e39afbe6d095311a
|
4
|
+
data.tar.gz: 557b1bed74b3c53814d6b68c85d588583546a83bcc1998f4dbfd6c265c188797
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b764cd9bc82036ba04865a287caf78691e87b44eac24d74719d3956a26a5cc586f2c37f7dd44ad90bdc43d2bffbbe4902dd52f5599fe647e997b9a35e7bd5659
|
7
|
+
data.tar.gz: b20823f47c3a40ce39bd1edebe6e72b04084be07d16d55eef761d4c97fdda764bd3792691a57b94edf8c479a7ee5b786d02d66cbf7a861de63741d4a6cbc1b29
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
## [
|
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
|
|
data/ext/hnswlib/hnswlibext.hpp
CHANGED
@@ -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 (
|
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 (
|
349
|
-
space = RbHnswlibL2Space::get_hnsw_l2space(
|
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(
|
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
data/lib/hnswlib/version.rb
CHANGED
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.
|
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-
|
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:
|