feldtruby 0.3.4 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,10 +5,10 @@ require 'feldtruby/statistics'
5
5
  module MiniTest::Assertions
6
6
  # Ensure that that are (statistically) the same number of each type
7
7
  # of value in an array.
8
- def assert_similar_proportions(values, msg = nil)
8
+ def assert_similar_proportions(values, expectedPValue = 0.01, msg = nil)
9
9
  #pvalue = FeldtRuby.probability_of_same_proportions(values)
10
10
  pvalue = FeldtRuby.chi_squared_test(values)
11
- assert(pvalue > 0.05, msg || "Proportions differ! p-value is #{pvalue} (<0.05), counts: #{values.counts.inspect}")
11
+ assert(pvalue > expectedPValue, msg || "Proportions differ! p-value is #{pvalue} (<0.05), counts: #{values.counts.inspect}")
12
12
  end
13
13
  end
14
14
 
@@ -13,7 +13,12 @@ class FeldtRuby::Optimize::StdOutLogger
13
13
  @verbose = verbose
14
14
  @start_time = Time.now # To ensure we have a value even if optimizer forgot calling note_optimization_starts
15
15
  @events = Hash.new(0)
16
- @last_report_time = Hash.new(Time.new("1970-01-01")) # Maps event strings to the last time they were reported on, used by anote.
16
+ # Old version of Time does not take a data as argument so use utc for those cases
17
+ if RUBY_VERSION < "1.9"
18
+ @last_report_time = Hash.new(Time.utc(1970, "jan", 1))
19
+ else
20
+ @last_report_time = Hash.new(Time.new("1970-01-01")) # Maps event strings to the last time they were reported on, used by anote.
21
+ end
17
22
  if verbose
18
23
  @outstream = STDOUT
19
24
  else
@@ -1,3 +1,3 @@
1
1
  module FeldtRuby
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: feldtruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-14 00:00:00.000000000 Z
12
+ date: 2013-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rinruby