optimus-ep 0.6.91 → 0.8.0
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.
- data/CHANGELOG +13 -0
- data/{License.txt → LICENSE} +1 -1
- data/{Manifest.txt → Manifest} +23 -11
- data/{README.txt → README} +1 -1
- data/Rakefile +9 -10
- data/autotest/discover.rb +1 -0
- data/bin/eprime2tabfile +10 -10
- data/bin/extract_timings +4 -4
- data/lib/eprimetab_parser.rb +3 -3
- data/lib/excel_parser.rb +2 -2
- data/lib/expression_parser/evaluators.rb +188 -0
- data/lib/expression_parser/expressions.rb +173 -0
- data/lib/log_file_parser.rb +9 -9
- data/lib/optimus.rb +30 -0
- data/lib/{eprime_data.rb → optimus_data.rb} +12 -29
- data/lib/{eprime_reader.rb → optimus_reader.rb} +27 -13
- data/lib/parsed_calculator.rb +92 -0
- data/lib/raw_tab_parser.rb +3 -3
- data/lib/runners/generic_runner.rb +7 -7
- data/lib/runners/yaml_template/option_parser.rb +33 -0
- data/lib/runners/yaml_template/runner.rb +19 -0
- data/lib/tabfile_parser.rb +6 -6
- data/lib/tabfile_writer.rb +7 -7
- data/lib/transformers/basic_transformer.rb +35 -24
- data/lib/transformers/column_calculator.rb +131 -326
- data/lib/transformers/multipasser.rb +10 -6
- data/lib/transformers/row_filter.rb +7 -12
- data/lib/transformers/timing_extractor.rb +3 -3
- data/lib/version.rb +3 -3
- data/lib/writers/stimtimes_writer.rb +6 -6
- data/optimus-ep.gemspec +37 -0
- data/spec/eprimetab_parser_spec.rb +7 -7
- data/spec/excel_parser_spec.rb +6 -6
- data/spec/expression_parser/evaluators_spec.rb +241 -0
- data/spec/expression_parser/expressions_spec.rb +119 -0
- data/spec/log_file_parser_spec.rb +30 -30
- data/spec/{eprime_data_spec.rb → optimus_data_spec.rb} +20 -20
- data/spec/{eprime_reader_spec.rb → optimus_reader_spec.rb} +36 -24
- data/spec/parsed_calculator_spec.rb +112 -0
- data/spec/raw_tab_parser_spec.rb +26 -0
- data/spec/runners/generic_runner_spec.rb +5 -12
- data/spec/runners/yaml_template/option_parser_spec.rb +25 -0
- data/spec/runners/yaml_template/runner_spec.rb +20 -0
- data/spec/samples/optimus_log.txt +103 -103
- data/spec/samples/optimus_log_utf16le.txt +0 -0
- data/spec/samples/raw_tsv.txt +4 -0
- data/spec/spec_helper.rb +75 -12
- data/spec/tabfile_parser_spec.rb +18 -18
- data/spec/tabfile_writer_spec.rb +12 -12
- data/spec/transformers/basic_transformer_spec.rb +18 -8
- data/spec/transformers/column_calculator_spec.rb +109 -364
- data/spec/transformers/multipasser_spec.rb +14 -7
- data/spec/transformers/row_filter_spec.rb +11 -6
- data/spec/transformers/timing_extractor_spec.rb +8 -8
- data/spec/writers/stimtimes_writer_spec.rb +3 -3
- metadata +103 -50
- data/History.txt +0 -45
- data/lib/calculator.rb +0 -51
- data/lib/eprime.rb +0 -24
- data/spec/calculator_spec.rb +0 -70
@@ -1,19 +1,19 @@
|
|
1
1
|
# Part of the Optimus package for managing E-Prime data
|
2
2
|
#
|
3
|
-
# Copyright (C) 2008 Board of Regents of the University of Wisconsin System
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
4
|
#
|
5
5
|
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
6
|
# Imaging and Behavior, University of Wisconsin - Madison
|
7
7
|
|
8
8
|
require File.join(File.dirname(__FILE__),'spec_helper')
|
9
|
-
require File.join(File.dirname(__FILE__), '../lib/
|
10
|
-
include
|
9
|
+
require File.join(File.dirname(__FILE__), '../lib/optimus')
|
10
|
+
include OptimusTestHelper
|
11
11
|
|
12
12
|
INITIAL_COLUMNS = %w(col1 col2 col3 col4)
|
13
13
|
NEW_COL_1 = "new_column_1"
|
14
14
|
NEW_COL_2 = "new_column_2"
|
15
15
|
|
16
|
-
shared_examples_for "empty
|
16
|
+
shared_examples_for "empty Optimus::Data" do
|
17
17
|
it "should have no rows" do
|
18
18
|
@data.length.should == 0
|
19
19
|
end
|
@@ -23,7 +23,7 @@ shared_examples_for "empty Eprime::Data" do
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
shared_examples_for "
|
26
|
+
shared_examples_for "Optimus::Data with one row" do
|
27
27
|
it "should be row-indexable" do
|
28
28
|
@data[0].should === @row # Test for identicality
|
29
29
|
end
|
@@ -80,20 +80,20 @@ shared_examples_for "Eprime::Data with one row" do
|
|
80
80
|
end
|
81
81
|
end
|
82
82
|
|
83
|
-
describe
|
83
|
+
describe Optimus::Data do
|
84
84
|
describe "without initial columns" do
|
85
85
|
before :each do
|
86
|
-
@data =
|
87
|
-
@d2 =
|
88
|
-
@d3 =
|
86
|
+
@data = Optimus::Data.new
|
87
|
+
@d2 = mock_optimus(2,3)
|
88
|
+
@d3 = mock_optimus(2,4)
|
89
89
|
end
|
90
90
|
|
91
|
-
it "should have return an
|
92
|
-
@data.merge(@d2).should be_an_instance_of(
|
91
|
+
it "should have return an Optimus::Data object on merge" do
|
92
|
+
@data.merge(@d2).should be_an_instance_of(Optimus::Data)
|
93
93
|
end
|
94
94
|
|
95
95
|
describe "(empty)" do
|
96
|
-
it_should_behave_like "empty
|
96
|
+
it_should_behave_like "empty Optimus::Data"
|
97
97
|
|
98
98
|
it "should have no columns at creation" do
|
99
99
|
@data.columns.length.should == 0
|
@@ -127,7 +127,7 @@ describe Eprime::Data do
|
|
127
127
|
d.size.should == (@data.size + @d2.size + @d3.size)
|
128
128
|
end
|
129
129
|
|
130
|
-
it_should_behave_like "
|
130
|
+
it_should_behave_like "Optimus::Data with one row"
|
131
131
|
|
132
132
|
it "should add a column when setting a value in row" do
|
133
133
|
@row[NEW_COL_1] = "test_value"
|
@@ -154,14 +154,14 @@ describe Eprime::Data do
|
|
154
154
|
end
|
155
155
|
end
|
156
156
|
|
157
|
-
describe "
|
157
|
+
describe "Optimus::Data with initial columns" do
|
158
158
|
describe "without setting ignore" do
|
159
159
|
before :each do
|
160
|
-
@data =
|
160
|
+
@data = Optimus::Data.new(INITIAL_COLUMNS)
|
161
161
|
end
|
162
162
|
|
163
163
|
describe "(empty)" do
|
164
|
-
it_should_behave_like "empty
|
164
|
+
it_should_behave_like "empty Optimus::Data"
|
165
165
|
|
166
166
|
it "should have the same number of columns as INITIAL_COLUMNS" do
|
167
167
|
@data.columns.length.should == INITIAL_COLUMNS.length
|
@@ -170,16 +170,16 @@ describe "Eprime::Data with initial columns" do
|
|
170
170
|
end
|
171
171
|
|
172
172
|
describe "(with one row)" do
|
173
|
-
it_should_behave_like "
|
173
|
+
it_should_behave_like "Optimus::Data with one row"
|
174
174
|
|
175
175
|
before :each do
|
176
176
|
@row = @data.add_row
|
177
177
|
end
|
178
178
|
|
179
|
-
it "should raise a warning when adding a new column" do
|
179
|
+
it "should not raise a warning when adding a new column" do
|
180
180
|
lambda {
|
181
181
|
@row[NEW_COL_1] = "kitteh"
|
182
|
-
}.
|
182
|
+
}.should_not raise_error
|
183
183
|
end
|
184
184
|
|
185
185
|
end
|
@@ -187,7 +187,7 @@ describe "Eprime::Data with initial columns" do
|
|
187
187
|
|
188
188
|
describe "with ignore set" do
|
189
189
|
before :each do
|
190
|
-
@data =
|
190
|
+
@data = Optimus::Data.new(INITIAL_COLUMNS, :ignore_warnings => true)
|
191
191
|
end
|
192
192
|
|
193
193
|
it "should not raise a warning when adding a new column" do
|
@@ -1,17 +1,17 @@
|
|
1
1
|
# Part of the Optimus package for managing E-Prime data
|
2
2
|
#
|
3
|
-
# Copyright (C) 2008 Board of Regents of the University of Wisconsin System
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
4
|
#
|
5
5
|
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
6
|
# Imaging and Behavior, University of Wisconsin - Madison
|
7
7
|
|
8
8
|
require File.join(File.dirname(__FILE__),'spec_helper')
|
9
|
-
require File.join(File.dirname(__FILE__), '../lib/
|
10
|
-
include
|
9
|
+
require File.join(File.dirname(__FILE__), '../lib/optimus')
|
10
|
+
include OptimusTestHelper
|
11
11
|
|
12
|
-
describe
|
12
|
+
describe Optimus::Reader do
|
13
13
|
before(:each) do
|
14
|
-
@reader =
|
14
|
+
@reader = Optimus::Reader.new
|
15
15
|
end
|
16
16
|
|
17
17
|
|
@@ -23,7 +23,7 @@ describe Eprime::Reader do
|
|
23
23
|
|
24
24
|
it "should raise when filetype is unknown" do
|
25
25
|
File.open(UNKNOWN_FILE) do |file|
|
26
|
-
lambda { @reader.input = (file) }.should raise_error(
|
26
|
+
lambda { @reader.input = (file) }.should raise_error(Optimus::UnknownTypeError)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -40,17 +40,17 @@ describe Eprime::Reader do
|
|
40
40
|
|
41
41
|
it "should detect log files" do
|
42
42
|
@reader.input = (@file)
|
43
|
-
@reader.type.should ==
|
43
|
+
@reader.type.should == Optimus::Reader::LogfileParser
|
44
44
|
end
|
45
45
|
|
46
|
-
it "should return the
|
46
|
+
it "should return the Optimus::Reader::LogfileParser" do
|
47
47
|
@reader.input = @file
|
48
|
-
@reader.parser.should be_an_instance_of(
|
48
|
+
@reader.parser.should be_an_instance_of(Optimus::Reader::LogfileParser)
|
49
49
|
end
|
50
50
|
|
51
|
-
it "should make a non-empty
|
51
|
+
it "should make a non-empty Optimus::Data object" do
|
52
52
|
@reader.input = @file
|
53
|
-
data = @reader.
|
53
|
+
data = @reader.optimus_data
|
54
54
|
data.length.should > 0
|
55
55
|
data.columns.sort.should == SORTED_COLUMNS
|
56
56
|
end
|
@@ -72,41 +72,41 @@ describe Eprime::Reader do
|
|
72
72
|
|
73
73
|
it "should detect excel csv files" do
|
74
74
|
@reader.input = @file
|
75
|
-
@reader.type.should ==
|
75
|
+
@reader.type.should == Optimus::Reader::ExcelParser
|
76
76
|
end
|
77
77
|
|
78
|
-
it "should resutn the
|
78
|
+
it "should resutn the Optimus::Reader::ExcelParser" do
|
79
79
|
@reader.input = @file
|
80
|
-
@reader.parser.should be_an_instance_of(
|
80
|
+
@reader.parser.should be_an_instance_of(Optimus::Reader::ExcelParser)
|
81
81
|
end
|
82
82
|
|
83
|
-
it "should make a non-empty
|
83
|
+
it "should make a non-empty Optimus::Data object" do
|
84
84
|
@reader.input = @file
|
85
|
-
data = @reader.
|
85
|
+
data = @reader.optimus_data
|
86
86
|
data.length.should > 0
|
87
87
|
data.columns.sort.should == SORTED_COLUMNS
|
88
88
|
end
|
89
89
|
|
90
90
|
end
|
91
91
|
|
92
|
-
describe "with
|
92
|
+
describe "with optimus tsv files" do
|
93
93
|
before :each do
|
94
94
|
@file = File.open(EPRIME_FILE)
|
95
95
|
end
|
96
96
|
|
97
|
-
it "should detect
|
97
|
+
it "should detect optimus csv files" do
|
98
98
|
@reader.input = @file
|
99
|
-
@reader.type.should ==
|
99
|
+
@reader.type.should == Optimus::Reader::OptimustabParser
|
100
100
|
end
|
101
101
|
|
102
|
-
it "should return the
|
102
|
+
it "should return the Optimus::Reader::OptimustabParser" do
|
103
103
|
@reader.input = @file
|
104
|
-
@reader.parser.should be_an_instance_of(
|
104
|
+
@reader.parser.should be_an_instance_of(Optimus::Reader::OptimustabParser)
|
105
105
|
end
|
106
106
|
|
107
|
-
it "should make a non-empty
|
107
|
+
it "should make a non-empty Optimus::Data object" do
|
108
108
|
@reader.input = @file
|
109
|
-
data = @reader.
|
109
|
+
data = @reader.optimus_data
|
110
110
|
data.length.should > 0
|
111
111
|
data.columns.sort.should == SORTED_COLUMNS
|
112
112
|
end
|
@@ -120,7 +120,19 @@ describe Eprime::Reader do
|
|
120
120
|
|
121
121
|
it "should detect tsv files" do
|
122
122
|
@reader.input = @file
|
123
|
-
@reader.type.should ==
|
123
|
+
@reader.type.should == Optimus::Reader::RawTabParser
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
describe "with utf16le files" do
|
128
|
+
before :each do
|
129
|
+
@file = File.open(UTF16LE_FILE)
|
130
|
+
end
|
131
|
+
|
132
|
+
it "should read columns" do
|
133
|
+
@reader.input = @file
|
134
|
+
data = @reader.optimus_data
|
135
|
+
data.columns.sort.should == SORTED_COLUMNS
|
124
136
|
end
|
125
137
|
end
|
126
138
|
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# Part of the Optimus package for managing E-Prime data
|
2
|
+
#
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
|
+
#
|
5
|
+
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
|
+
# Imaging and Behavior, University of Wisconsin - Madison
|
7
|
+
|
8
|
+
require File.join(File.dirname(__FILE__),'spec_helper')
|
9
|
+
require File.join(File.dirname(__FILE__), '../lib/optimus')
|
10
|
+
require 'parsed_calculator'
|
11
|
+
|
12
|
+
include OptimusTestHelper
|
13
|
+
|
14
|
+
describe Optimus::ParsedCalculator::ExpressionParser do
|
15
|
+
before :all do
|
16
|
+
@exp = Optimus::ParsedCalculator::ExpressionParser.new
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should parse positive integers" do
|
20
|
+
@exp.should round_trip("1")
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should parse floats" do
|
24
|
+
@exp.should round_trip("1.1")
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should not parse barewords" do
|
28
|
+
@exp.should_not parse_successfully("foo")
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should parse single-quoted strings" do
|
32
|
+
@exp.should round_trip("'fixation'")
|
33
|
+
end
|
34
|
+
|
35
|
+
it "should parse strings with two single-quotes as one single-quote" do
|
36
|
+
@exp.should round_trip("'foo''bar'")
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should parse column names" do
|
40
|
+
@exp.should round_trip("{foo}")
|
41
|
+
end
|
42
|
+
|
43
|
+
it "should parse column names with { included" do
|
44
|
+
@exp.should round_trip("{foo{bar}")
|
45
|
+
end
|
46
|
+
|
47
|
+
it "should parse column names with \\} included" do
|
48
|
+
@exp.should round_trip('{foo\}bar}')
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should parse + as binary operator with numbers" do
|
52
|
+
@exp.should parse_as('1 + 1', '(1 + 1)')
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should parse + as a binary operator without spaces" do
|
56
|
+
@exp.should parse_as("1+1", "(1 + 1)")
|
57
|
+
end
|
58
|
+
|
59
|
+
it "should parse + as binary operator with strings" do
|
60
|
+
@exp.should parse_as("'a' + 1", "('a' + 1)")
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should parse + as binary operator with columns" do
|
64
|
+
@exp.should parse_as("{foo} + 1", "({foo} + 1)")
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should left-associatively group with +" do
|
68
|
+
@exp.should parse_as("1 + 1 + 1", "((1 + 1) + 1)")
|
69
|
+
end
|
70
|
+
|
71
|
+
it "should parse with specified grouping" do
|
72
|
+
@exp.should parse_as("1 + (1 + 1)", "(1 + (1 + 1))")
|
73
|
+
end
|
74
|
+
|
75
|
+
# We've done all the complex tests with + -- another associative binary
|
76
|
+
# operator. I'm assuming the others work as well. This will just shorthand
|
77
|
+
# that testing.
|
78
|
+
describe "with binary operators" do
|
79
|
+
ops = %w(+ - * / % & > >= < <= = != and or)
|
80
|
+
ops.each do |op|
|
81
|
+
it "should parse #{op} as binary operator" do
|
82
|
+
@exp.should round_trip("(1 #{op} 1)")
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
it "should give * higher precedence than +" do
|
88
|
+
@exp.should parse_as("1 + 1 * 1", "(1 + (1 * 1))")
|
89
|
+
end
|
90
|
+
|
91
|
+
it "should give * higher precedence than binary -" do
|
92
|
+
@exp.should parse_as("1 - 1 * 1", "(1 - (1 * 1))")
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should give / the same precedence as *" do
|
96
|
+
# This means we'll just use left-associtivity rules...
|
97
|
+
@exp.should parse_as("1 / 1 * 1", "((1 / 1) * 1)")
|
98
|
+
@exp.should parse_as("1 * 1 / 1", "((1 * 1) / 1)")
|
99
|
+
end
|
100
|
+
|
101
|
+
it "should parse - as a unary prefix operator" do
|
102
|
+
@exp.should parse_as("-1", "-(1)")
|
103
|
+
end
|
104
|
+
|
105
|
+
it "should give negation higher precedence than *" do
|
106
|
+
@exp.should parse_as("-1*1", "(-(1) * 1)")
|
107
|
+
end
|
108
|
+
|
109
|
+
it "should parse 'not' as a unary prefix operator" do
|
110
|
+
@exp.should parse_as("not 1", "not (1)")
|
111
|
+
end
|
112
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Part of the Optimus package for managing E-Prime data
|
2
|
+
#
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
|
+
#
|
5
|
+
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
|
+
# Imaging and Behavior, University of Wisconsin - Madison
|
7
|
+
|
8
|
+
require File.join(File.dirname(__FILE__),'spec_helper')
|
9
|
+
require File.join(File.dirname(__FILE__), '../lib/optimus')
|
10
|
+
include OptimusTestHelper
|
11
|
+
|
12
|
+
describe Optimus::Reader::RawTabParser do
|
13
|
+
|
14
|
+
# We don't need to do much here; the superclass handles almost everything
|
15
|
+
|
16
|
+
before :each do
|
17
|
+
@file = File.open(RAW_TSV_FILE, 'r')
|
18
|
+
@reader = Optimus::Reader::ExcelParser.new(@file)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should read the sample tsv file" do
|
22
|
+
lambda {
|
23
|
+
@reader.to_optimus
|
24
|
+
}.should_not raise_error
|
25
|
+
end
|
26
|
+
end
|
@@ -1,25 +1,18 @@
|
|
1
1
|
# Part of the Optimus package for managing E-Prime data
|
2
2
|
#
|
3
|
-
# Copyright (C) 2008 Board of Regents of the University of Wisconsin System
|
4
|
-
#
|
5
|
-
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
|
-
# Imaging and Behavior, University of Wisconsin - Madison
|
7
|
-
|
8
|
-
# Part of the Optimus package for managing E-Prime data
|
9
|
-
#
|
10
|
-
# Copyright (C) 2008 Board of Regents of the University of Wisconsin System
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
11
4
|
#
|
12
5
|
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
13
6
|
# Imaging and Behavior, University of Wisconsin - Madison
|
14
7
|
|
15
8
|
require File.join(File.dirname(__FILE__),'../spec_helper')
|
16
|
-
require File.join(File.dirname(__FILE__), '../../lib/
|
9
|
+
require File.join(File.dirname(__FILE__), '../../lib/optimus')
|
17
10
|
require 'runners/generic_runner'
|
18
|
-
include
|
11
|
+
include OptimusTestHelper
|
19
12
|
|
20
|
-
describe
|
13
|
+
describe Optimus::Runners::GenericRunner do
|
21
14
|
before :each do
|
22
|
-
@txr =
|
15
|
+
@txr = Optimus::Runners::GenericRunner.new(Optimus::Transformers::BasicTransformer)
|
23
16
|
end
|
24
17
|
|
25
18
|
it "should start with stdout in @out" do
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Part of the Optimus package for managing E-Prime data
|
2
|
+
#
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
|
+
#
|
5
|
+
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
|
+
# Imaging and Behavior, University of Wisconsin - Madison
|
7
|
+
#
|
8
|
+
# This execrises the main command-line runner system.
|
9
|
+
|
10
|
+
require File.join(File.dirname(__FILE__),'../../spec_helper')
|
11
|
+
require File.join(File.dirname(__FILE__), '../../../lib/optimus')
|
12
|
+
include OptimusTestHelper
|
13
|
+
|
14
|
+
require 'runners/yaml_template/option_parser'
|
15
|
+
include Optimus::Runners::YamlTemplate
|
16
|
+
|
17
|
+
describe OptimusOptionParser do
|
18
|
+
before :each do
|
19
|
+
@op = OptimusOptionParser.new
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should have errors" do
|
23
|
+
@op.errors.should_not be_nil
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Part of the Optimus package for managing E-Prime data
|
2
|
+
#
|
3
|
+
# Copyright (C) 2008-09 Board of Regents of the University of Wisconsin System
|
4
|
+
#
|
5
|
+
# Written by Nathan Vack <njvack@wisc.edu>, at the Waisman Laborotory for Brain
|
6
|
+
# Imaging and Behavior, University of Wisconsin - Madison
|
7
|
+
#
|
8
|
+
# This execrises the main command-line runner system.
|
9
|
+
|
10
|
+
require File.join(File.dirname(__FILE__),'../../spec_helper')
|
11
|
+
require File.join(File.dirname(__FILE__), '../../../lib/optimus')
|
12
|
+
include OptimusTestHelper
|
13
|
+
|
14
|
+
require 'runners/yaml_template/runner'
|
15
|
+
|
16
|
+
include Optimus::Runners::YamlTemplate
|
17
|
+
|
18
|
+
describe Runner do
|
19
|
+
it "is pending"
|
20
|
+
end
|
@@ -1,103 +1,103 @@
|
|
1
|
-
*** Header Start ***
|
2
|
-
VersionPersist: 1
|
3
|
-
LevelName: Session
|
4
|
-
LevelName: Block
|
5
|
-
LevelName: Trial
|
6
|
-
LevelName: SubTrial
|
7
|
-
LevelName: LogLevel5
|
8
|
-
LevelName: LogLevel6
|
9
|
-
LevelName: LogLevel7
|
10
|
-
LevelName: LogLevel8
|
11
|
-
LevelName: LogLevel9
|
12
|
-
LevelName: LogLevel10
|
13
|
-
Experiment: optimus_test
|
14
|
-
SessionDate: 03-15-2008
|
15
|
-
SessionTime: 11:11:11
|
16
|
-
RandomSeed: 1123581321
|
17
|
-
Group: 1
|
18
|
-
Subject: 1
|
19
|
-
Session: 1
|
20
|
-
Display.RefreshRate: 60.000
|
21
|
-
*** Header End ***
|
22
|
-
Level: 2
|
23
|
-
*** LogFrame Start ***
|
24
|
-
Procedure: Prep
|
25
|
-
Running: prepProc
|
26
|
-
CarriedVal: BlockLevel
|
27
|
-
BlockTitle: Prep
|
28
|
-
*** LogFrame End ***
|
29
|
-
Level: 2
|
30
|
-
*** LogFrame Start ***
|
31
|
-
BlockTitle: My Task
|
32
|
-
NameOfPeriodList: TestList
|
33
|
-
Periods: 2
|
34
|
-
StartDelay: 0
|
35
|
-
Procedure: testBlocProc
|
36
|
-
Running: TestBlockList
|
37
|
-
ScanStartTime: 11:11:11
|
38
|
-
BlockTime: 15000
|
39
|
-
RFP.StartTime: 15000
|
40
|
-
RFP.LastPulseTime: 15000
|
41
|
-
BlockElapsed: 300000
|
42
|
-
CarriedVal: BlockLevel
|
43
|
-
*** LogFrame End ***
|
44
|
-
Level: 3
|
45
|
-
*** LogFrame Start ***
|
46
|
-
BlockList: 1
|
47
|
-
TypeA: Fear
|
48
|
-
TypeB: 1
|
49
|
-
Procedure: RunTrial
|
50
|
-
BlockList.Cycle: 1
|
51
|
-
BlockList.Sample: 1
|
52
|
-
Running: TestList
|
53
|
-
StartTime: 5000
|
54
|
-
Stim1.OnsetTime: 99999
|
55
|
-
Stim1.OffsetTime: 111111
|
56
|
-
CarriedVal: TrialLevel
|
57
|
-
*** LogFrame End ***
|
58
|
-
Level: 3
|
59
|
-
*** LogFrame Start ***
|
60
|
-
BlockList: 1
|
61
|
-
TypeA: Loathing
|
62
|
-
TypeB: 1
|
63
|
-
Procedure: RunTrial
|
64
|
-
BlockList.Cycle: 2
|
65
|
-
BlockList.Sample: 1
|
66
|
-
Running: TestList
|
67
|
-
StartTime: 5000
|
68
|
-
Stim1.OnsetTime: 122222
|
69
|
-
Stim1.OffsetTime: 133333
|
70
|
-
CarriedVal: TrialLevel
|
71
|
-
*** LogFrame End ***
|
72
|
-
Level: 2
|
73
|
-
*** LogFrame Start ***
|
74
|
-
BlockTitle: My Task
|
75
|
-
NameOfPeriodList: TestList
|
76
|
-
Periods: 2
|
77
|
-
StartDelay: 0
|
78
|
-
Procedure: testBlocProc
|
79
|
-
Running: TestBlockList
|
80
|
-
ScanStartTime: 11:11:11
|
81
|
-
BlockTime: 15000
|
82
|
-
RFP.StartTime: 305000
|
83
|
-
RFP.LastPulseTime: 305000
|
84
|
-
BlockElapsed: 300000
|
85
|
-
CarriedVal: BlockLevel
|
86
|
-
Block: 0
|
87
|
-
*** LogFrame End ***
|
88
|
-
Level: 1
|
89
|
-
*** LogFrame Start ***
|
90
|
-
Experiment: optimus_test
|
91
|
-
SessionDate: 03-15-2008
|
92
|
-
SessionTime: 11:11:11
|
93
|
-
RandomSeed: 1123581321
|
94
|
-
Group: 1
|
95
|
-
Subject: 1
|
96
|
-
Session: 1
|
97
|
-
Display.RefreshRate: 60.000
|
98
|
-
Clock.Scale: 1
|
99
|
-
NumPeriods: 3
|
100
|
-
CarriedVal: SessionLevel
|
101
|
-
PeriodA: 10000
|
102
|
-
PeriodB: 10000
|
103
|
-
*** LogFrame End ***
|
1
|
+
*** Header Start ***
|
2
|
+
VersionPersist: 1
|
3
|
+
LevelName: Session
|
4
|
+
LevelName: Block
|
5
|
+
LevelName: Trial
|
6
|
+
LevelName: SubTrial
|
7
|
+
LevelName: LogLevel5
|
8
|
+
LevelName: LogLevel6
|
9
|
+
LevelName: LogLevel7
|
10
|
+
LevelName: LogLevel8
|
11
|
+
LevelName: LogLevel9
|
12
|
+
LevelName: LogLevel10
|
13
|
+
Experiment: optimus_test
|
14
|
+
SessionDate: 03-15-2008
|
15
|
+
SessionTime: 11:11:11
|
16
|
+
RandomSeed: 1123581321
|
17
|
+
Group: 1
|
18
|
+
Subject: 1
|
19
|
+
Session: 1
|
20
|
+
Display.RefreshRate: 60.000
|
21
|
+
*** Header End ***
|
22
|
+
Level: 2
|
23
|
+
*** LogFrame Start ***
|
24
|
+
Procedure: Prep
|
25
|
+
Running: prepProc
|
26
|
+
CarriedVal: BlockLevel
|
27
|
+
BlockTitle: Prep
|
28
|
+
*** LogFrame End ***
|
29
|
+
Level: 2
|
30
|
+
*** LogFrame Start ***
|
31
|
+
BlockTitle: My Task
|
32
|
+
NameOfPeriodList: TestList
|
33
|
+
Periods: 2
|
34
|
+
StartDelay: 0
|
35
|
+
Procedure: testBlocProc
|
36
|
+
Running: TestBlockList
|
37
|
+
ScanStartTime: 11:11:11
|
38
|
+
BlockTime: 15000
|
39
|
+
RFP.StartTime: 15000
|
40
|
+
RFP.LastPulseTime: 15000
|
41
|
+
BlockElapsed: 300000
|
42
|
+
CarriedVal: BlockLevel
|
43
|
+
*** LogFrame End ***
|
44
|
+
Level: 3
|
45
|
+
*** LogFrame Start ***
|
46
|
+
BlockList: 1
|
47
|
+
TypeA: Fear
|
48
|
+
TypeB: 1
|
49
|
+
Procedure: RunTrial
|
50
|
+
BlockList.Cycle: 1
|
51
|
+
BlockList.Sample: 1
|
52
|
+
Running: TestList
|
53
|
+
StartTime: 5000
|
54
|
+
Stim1.OnsetTime: 99999
|
55
|
+
Stim1.OffsetTime: 111111
|
56
|
+
CarriedVal: TrialLevel
|
57
|
+
*** LogFrame End ***
|
58
|
+
Level: 3
|
59
|
+
*** LogFrame Start ***
|
60
|
+
BlockList: 1
|
61
|
+
TypeA: Loathing
|
62
|
+
TypeB: 1
|
63
|
+
Procedure: RunTrial
|
64
|
+
BlockList.Cycle: 2
|
65
|
+
BlockList.Sample: 1
|
66
|
+
Running: TestList
|
67
|
+
StartTime: 5000
|
68
|
+
Stim1.OnsetTime: 122222
|
69
|
+
Stim1.OffsetTime: 133333
|
70
|
+
CarriedVal: TrialLevel
|
71
|
+
*** LogFrame End ***
|
72
|
+
Level: 2
|
73
|
+
*** LogFrame Start ***
|
74
|
+
BlockTitle: My Task
|
75
|
+
NameOfPeriodList: TestList
|
76
|
+
Periods: 2
|
77
|
+
StartDelay: 0
|
78
|
+
Procedure: testBlocProc
|
79
|
+
Running: TestBlockList
|
80
|
+
ScanStartTime: 11:11:11
|
81
|
+
BlockTime: 15000
|
82
|
+
RFP.StartTime: 305000
|
83
|
+
RFP.LastPulseTime: 305000
|
84
|
+
BlockElapsed: 300000
|
85
|
+
CarriedVal: BlockLevel
|
86
|
+
Block: 0
|
87
|
+
*** LogFrame End ***
|
88
|
+
Level: 1
|
89
|
+
*** LogFrame Start ***
|
90
|
+
Experiment: optimus_test
|
91
|
+
SessionDate: 03-15-2008
|
92
|
+
SessionTime: 11:11:11
|
93
|
+
RandomSeed: 1123581321
|
94
|
+
Group: 1
|
95
|
+
Subject: 1
|
96
|
+
Session: 1
|
97
|
+
Display.RefreshRate: 60.000
|
98
|
+
Clock.Scale: 1
|
99
|
+
NumPeriods: 3
|
100
|
+
CarriedVal: SessionLevel
|
101
|
+
PeriodA: 10000
|
102
|
+
PeriodB: 10000
|
103
|
+
*** LogFrame End ***
|
Binary file
|
@@ -0,0 +1,4 @@
|
|
1
|
+
ExperimentName Subject Session RFP.StartTime BlockTitle PeriodA CarriedVal[Session] BlockList Trial NameOfPeriodList NumPeriods PeriodB Procedure[Block] Block Group CarriedVal[Block] BlockList.Sample SessionTime Clock.Scale BlockList.Cycle Stim1.OnsetTime CarriedVal[Trial] Display.RefreshRate Running[Block] StartDelay Stim1.OffsetTime Running[Trial] ScanStartTime Periods TypeA BlockElapsed RFP.LastPulseTime BlockTime Procedure[Trial] SessionDate TypeB StartTime RandomSeed
|
2
|
+
optimus_test 1 1 15000 My Task 10000 SessionLevel 1 1 TestList 3 10000 testBlocProc 1 1 BlockLevel 1 11 1 1 88684 TrialLevel 60 TestBlockList 0 93583 TestList 11 2 Danger 300000 15000 15000 RunTrial 3/15/08 2 5000 1123581321
|
3
|
+
optimus_test 1 1 305000 My Task 10000 SessionLevel 1 1 TestList 3 10000 testBlocProc 2 1 BlockLevel 1 11 1 1 99999 TrialLevel 60 TestBlockList 0 111111 TestList 11 2 Fear 300000 305000 15000 RunTrial 3/15/08 1 5000 1123581321
|
4
|
+
optimus_test 1 1 305000 My Task 10000 SessionLevel 1 2 TestList 3 10000 testBlocProc 2 1 BlockLevel 1 11 1 2 122222 TrialLevel 60 TestBlockList 0 133333 TestList 11 2 Loathing 300000 305000 15000 RunTrial 3/15/08 1 5000 1123581321
|