rbbt-util 5.14.30 → 5.14.31
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/lib/rbbt/knowledge_base.rb +2 -49
- data/lib/rbbt/util/R/eval.rb +3 -0
- data/lib/rbbt/util/misc/exceptions.rb +6 -5
- data/share/rbbt_commands/workflow/knowledge_base +3 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46eae28f0f87b59568cc6001d10928f1c68a8a31
|
4
|
+
data.tar.gz: a42bff80be14564d5852808dddf130319b713866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a11deee4e5cea8f891b9602e28f0b2466b3eb9933cfc8116b029653977a2e24e562b25103524a61597324437271f5c8099625e7a4f99f60104ebf0030ff04f4
|
7
|
+
data.tar.gz: e030e147a235c09419ff66eca1568ad1fe61ec61847ff075d4f743f87e14014127811c009ea004d38fc2fd97a212eafc50e37c9c15cff1a555eb5673bdea7d0f
|
data/lib/rbbt/knowledge_base.rb
CHANGED
@@ -121,43 +121,6 @@ class KnowledgeBase
|
|
121
121
|
{:namespace => namespace, :format => @format}
|
122
122
|
end
|
123
123
|
|
124
|
-
#def get_database(name, options = {})
|
125
|
-
# @databases[Misc.fingerprint([name, options])] ||= \
|
126
|
-
# begin
|
127
|
-
# Persist.memory("Database:" <<[name, self.dir] * "@") do
|
128
|
-
# options = Misc.add_defaults options, :persist_dir => dir.databases
|
129
|
-
# persist_options = Misc.pull_keys options, :persist
|
130
|
-
|
131
|
-
# file, registered_options = registry[name]
|
132
|
-
# options = open_options.merge(registered_options || {}).merge(options)
|
133
|
-
# raise "Repo #{ name } not found and not registered" if file.nil?
|
134
|
-
|
135
|
-
# Log.low "Opening database #{ name } from #{ Misc.fingerprint file }. #{options}"
|
136
|
-
# Association.open(file, options, persist_options).
|
137
|
-
# tap{|tsv| tsv.namespace = self.namespace}
|
138
|
-
# end
|
139
|
-
# end
|
140
|
-
#end
|
141
|
-
|
142
|
-
|
143
|
-
#def get_index(name, options = {})
|
144
|
-
# @indices[Misc.fingerprint([name, options])] ||= \
|
145
|
-
# begin
|
146
|
-
# Persist.memory("Index:" <<[name, self.dir] * "@") do
|
147
|
-
# options = Misc.add_defaults options, :persist_dir => dir.indices
|
148
|
-
# persist_options = Misc.pull_keys options, :persist
|
149
|
-
|
150
|
-
# file, registered_options = registry[name]
|
151
|
-
# options = open_options.merge(registered_options || {}).merge(options)
|
152
|
-
# raise "Repo #{ name } not found and not registered" if file.nil?
|
153
|
-
|
154
|
-
# Log.low "Opening index #{ name } from #{ Misc.fingerprint file }. #{options}"
|
155
|
-
# Association.index(file, options, persist_options).
|
156
|
-
# tap{|tsv| tsv.namespace = self.namespace}
|
157
|
-
# end
|
158
|
-
# end
|
159
|
-
#end
|
160
|
-
|
161
124
|
def get_database(name, options = {})
|
162
125
|
key = name.to_s + "_" + Misc.digest(Misc.fingerprint([name,options,format,namespace]))
|
163
126
|
@databases[key] ||=
|
@@ -192,6 +155,7 @@ class KnowledgeBase
|
|
192
155
|
end
|
193
156
|
|
194
157
|
def get_index(name, options = {})
|
158
|
+
name = name.to_s
|
195
159
|
key = name.to_s + "_" + Misc.digest(Misc.fingerprint([name,options]))
|
196
160
|
@indices[key] ||=
|
197
161
|
begin
|
@@ -384,18 +348,7 @@ class KnowledgeBase
|
|
384
348
|
|
385
349
|
repo = get_index name
|
386
350
|
|
387
|
-
matches =
|
388
|
-
s = repo.subset_entities(entities, &block)
|
389
|
-
setup(name, s)
|
390
|
-
rescue Exception
|
391
|
-
target = entities[:target]
|
392
|
-
source = entities[:source]
|
393
|
-
if target or source
|
394
|
-
entities[:target] = source
|
395
|
-
entities[:source] = target
|
396
|
-
end
|
397
|
-
setup(name, repo.reverse.subset_entities(entities, &block), true)
|
398
|
-
end
|
351
|
+
matches = setup(name, repo.subset_entities(entities))
|
399
352
|
|
400
353
|
block_given? ? matches.select(&block) : matches
|
401
354
|
end
|
data/lib/rbbt/util/R/eval.rb
CHANGED
@@ -37,6 +37,9 @@ module R
|
|
37
37
|
begin
|
38
38
|
i = Rserve::Connection.new :hostname => @@socket_file
|
39
39
|
i.eval "source('#{UTIL}');"
|
40
|
+
wdir = @@socket_file + '.wd'
|
41
|
+
FileUtils.mkdir wdir unless File.exists? wdir
|
42
|
+
i.eval "setwd('#{wdir}');"
|
40
43
|
i
|
41
44
|
rescue Exception
|
42
45
|
raise TryAgain
|
@@ -1,19 +1,20 @@
|
|
1
1
|
class ParameterException < Exception; end
|
2
2
|
class FieldNotFoundError < Exception;end
|
3
|
-
class Aborted < Exception
|
4
|
-
def initialize(*args)
|
5
|
-
super(*args)
|
6
|
-
end
|
7
|
-
end
|
8
3
|
class TryAgain < Exception; end
|
9
4
|
class ClosedStream < Exception; end
|
5
|
+
|
10
6
|
class ProcessFailed < Exception; end
|
7
|
+
class Aborted < Exception; end
|
8
|
+
|
9
|
+
class RemoteServerError < Exception; end
|
10
|
+
|
11
11
|
class KeepLocked < Exception
|
12
12
|
attr_accessor :payload
|
13
13
|
def initialize(payload)
|
14
14
|
@payload = payload
|
15
15
|
end
|
16
16
|
end
|
17
|
+
|
17
18
|
class KeepBar < Exception
|
18
19
|
attr_accessor :payload
|
19
20
|
def initialize(payload)
|
@@ -51,6 +51,9 @@ when :subset
|
|
51
51
|
source_entities = options[:source_entities] || :all
|
52
52
|
target_entities = options[:target_entities] || :all
|
53
53
|
|
54
|
+
source_entities = :all if source_entities == "all"
|
55
|
+
target_entities = :all if target_entities == "all"
|
56
|
+
|
54
57
|
source_entities = source_entities.split(/[,|]/) if String === source_entities
|
55
58
|
target_entities = target_entities.split(/[,|]/) if String === target_entities
|
56
59
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.14.
|
4
|
+
version: 5.14.31
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|