evoc 3.6.1 → 3.6.2

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
  SHA1:
3
- metadata.gz: de896e4c41f41f2c7c235e34c365b77ed95bd060
4
- data.tar.gz: 62bcb4d03197066b274f4ee25405fbb4793b5871
3
+ metadata.gz: 8945b15a68ce28d5c3c9e8b10b2478f3fcbb139f
4
+ data.tar.gz: 597aaf2639f69c61788312c030c76706e419b0bf
5
5
  SHA512:
6
- metadata.gz: ceed8a9223dda76ddfed1137eae2fbc30b3ae89c655e0314cc11fdac8e8d1633fb7619aa37a55db66bd1a16a5fc5af54c357f2f89f7f7e11139e1209b379b124
7
- data.tar.gz: 6def5400d086425dd656ad74fc09c5e1fad81256f7c92ffd5f46c8e4f4cbd42f00a9745fe0cf3bba6dab9a900a641c91b839376fd691ac8ef5904b64ce1862fa
6
+ metadata.gz: 804e7b6ec7b27c35b09697a44f5f20895efe94a31631c8068ba83861d69856e948820056b22571b10bd47ce09a2104dd73f21cd18df0bf49619df23813425d61
7
+ data.tar.gz: 9ad3251c853afb583f0f257cec83cb09959aab339140cea5a7c032d48ff7e023a80f8239ae6b269d0357aafa0e8757c6912f6814fe8b85e51e285dd85e83e44d
@@ -207,6 +207,7 @@ module Evoc
207
207
 
208
208
  factors = [factor_model_size,factor_max_size,factor_model_age,factor_algorithms,factor_measures,factor_permutation,factor_aggregators].compact
209
209
  num_of_scenarios = factors.inject(1) {|product,f| product * f.size}
210
+ invalid_configuration = 0
210
211
  CSV.foreach(self.opts[:queries], headers: true) do |query|
211
212
  # abort if the failsafe file is present
212
213
  if !self.opts[:fail_safe].nil?
@@ -221,14 +222,22 @@ module Evoc
221
222
  # - the block form of #product makes it lazy (i.e., the whole cartesian product isn't generated at once)
222
223
  factors.first.product(*factors[1..-1]).each do |scenario|
223
224
  # Print progress to stderr
224
- STDERR.print "(#{self.opts[:case_id]}) Executing scenario #{current_scenario} of #{num_of_scenarios} on query #{current_line} of #{num_lines} \r"
225
+ STDERR.print "(#{self.opts[:case_id]}) Executing scenario #{current_scenario} of #{num_of_scenarios} on query #{current_line} of #{num_lines} (scenarios skipped: #{invalid_configuration}) \r"
225
226
 
226
- params = query.to_h.merge(scenario.to_h)
227
+ query_hash = query.to_h
228
+ # convert query to array
229
+ query_hash['query'] = query_hash['query'].split(',')
230
+ params = query_hash.merge(scenario.to_h)
227
231
  params[:case_id] = self.opts[:case_id]
228
232
  params[:granularity] = self.opts[:granularity]
229
233
  # initialize scenario
230
234
  q = Evoc::Scenario.new(params)
231
- $stdout.puts q.call(evaluators: self.opts[:evaluators]).to_json
235
+ begin
236
+ result = q.call(evaluators: self.opts[:evaluators]).to_json
237
+ $stdout.puts result
238
+ rescue ArgumentError => e
239
+ invalid_configuration += 1
240
+ end
232
241
  current_scenario += 1
233
242
  end
234
243
  current_line += 1
data/lib/evoc/scenario.rb CHANGED
@@ -157,7 +157,7 @@ module Evoc
157
157
  def model_start
158
158
  value = self.tx_index - self.model_size.to_i - self.model_age.to_i
159
159
  if value < 0
160
- raise ArgumentError, "The model start index was negative (model_size:#{self.model_size}, tx_index:#{self.tx_index})"
160
+ raise ArgumentError, "The model start index was negative (model_size:#{self.model_size}, model_age:#{self.model_age}, tx_index:#{self.tx_index})"
161
161
  end
162
162
  return value
163
163
  end
@@ -206,6 +206,7 @@ module Evoc
206
206
  # custom setter for query
207
207
  def query=(query)
208
208
  if !query.nil?
209
+ raise ArgumentError, "Query must be an array" unless query.is_a?(Array)
209
210
  @query = query
210
211
  # convert to list of integers
211
212
  @query.map!(&:to_i)
data/lib/evoc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Evoc
2
- VERSION = "3.6.1"
2
+ VERSION = "3.6.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.1
4
+ version: 3.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Rolfsnes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-15 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler