coderunner 0.12.8 → 0.12.10
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/VERSION +1 -1
- data/coderunner.gemspec +1 -1
- data/lib/coderunner/remote_code_runner.rb +1 -1
- data/test/test_coderunner.rb +79 -79
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.10
|
data/coderunner.gemspec
CHANGED
@@ -84,7 +84,7 @@ class RemoteCodeRunner < CodeRunner
|
|
84
84
|
|
85
85
|
DISPLAY_REMOTE_INVOCATION = false
|
86
86
|
|
87
|
-
RUNNER_CACHE = ENV['HOME'] + '/.
|
87
|
+
RUNNER_CACHE = ENV['HOME'] + '/.coderunner/remote_cache/'
|
88
88
|
|
89
89
|
def initialize(host, folder, copts = {})
|
90
90
|
@folder = folder
|
data/test/test_coderunner.rb
CHANGED
@@ -213,106 +213,106 @@ class TestCodeRunner < Test::Unit::TestCase
|
|
213
213
|
#assert(!FileTest.exist?('results/submitting'))
|
214
214
|
#end
|
215
215
|
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
216
|
+
def test_latex_graphkit
|
217
|
+
Dir.chdir('test/results') do
|
218
|
+
#@runner.print_out(0)
|
219
|
+
sds = @runner.run_graphkit('sides;;[1,2].include? id')
|
220
|
+
#p sds
|
221
|
+
sds.ylabel = 'Hello'
|
222
|
+
sds.data.each_with_index{|dk,i| dk.title = i.to_s}
|
223
|
+
sds.xlabel = '\(\Gamma_{\epsilon}\)'
|
224
|
+
sds.title = 'Area of the Sides'
|
225
|
+
#sds.gnuplot
|
226
|
+
#pp sds
|
227
|
+
#pid1 = sds.gnuplot
|
228
228
|
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
229
|
+
sds.gnuplot_write('latgraph.eps', latex: true)
|
230
|
+
#pid = system "okular #{Dir.pwd}/latgraph.eps"
|
231
|
+
#sleep 3
|
232
|
+
#Process.kill 'TERM', pid
|
233
|
+
#Process.kill 'TERM', pid1
|
234
|
+
end
|
235
|
+
end
|
236
236
|
|
237
|
-
|
238
|
-
|
237
|
+
def test_graphkit_multiplot
|
238
|
+
Dir.chdir('test/results') do
|
239
239
|
|
240
|
-
|
241
|
-
|
242
|
-
|
240
|
+
######################
|
241
|
+
# Make 3 random graphs
|
242
|
+
######################
|
243
243
|
|
244
244
|
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
245
|
+
# As usual, data can be an array or a GSL::Vector
|
246
|
+
kit1 = GraphKit.autocreate(x: {data: [0,2,4], title: 'A label with latex \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [3.3, 5.5, 10], title: 'Label with latex \(\beta\)', units: '\(v_{thi}\)'})
|
247
|
+
kit1.title = 'First Graph'
|
248
|
+
kit1.gp.label = '\'A label\' at 2,7' # This 'gp' syntax is new. You can set pretty much any gnuplot option like this - see gnuplot help set
|
249
|
+
kit1.data[0].title = 'A new title'
|
250
250
|
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
251
|
+
kit2 = GraphKit.autocreate(x: {data: [0,2,4], title: 'Stuff \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [2, -1, 2], title: 'Some \(\beta\)', units: '\(v_{thi}\)'})
|
252
|
+
kit2.title = 'Second Graph'
|
253
|
+
kit2.data[0].gp.with = 'lp linewidth 6' # See gnuplot help plot for data options
|
254
|
+
kit2.gp.key = 'off'
|
255
|
+
kit2.xlabel = 'A NEW XLABEL'
|
256
256
|
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
257
|
+
kit3 = GraphKit.autocreate(x: {data: [0,5,10], title: 'Mouse Height \(\Gamma_\epsilon \chi\)', units: '\(\nu e\)'}, y: {data: [4, 3, 4], title: 'Mouse weight \(\kappa\)', units: '\(v_{thi}\)'})
|
258
|
+
kit3.title = 'Mouse info'
|
259
|
+
kit3.data[0].gp.with = 'lp'
|
260
|
+
kit3.gp.key = 'off'
|
261
261
|
|
262
|
-
|
263
|
-
|
264
|
-
|
262
|
+
#####################
|
263
|
+
# Plot a single one
|
264
|
+
#####################
|
265
265
|
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
266
|
+
pp kit1
|
267
|
+
kit1.gnuplot_write('first_graph.eps', latex: true) #Just plot it by itself
|
268
|
+
#system "okular #{Dir.pwd}/first_graph.eps"
|
269
|
+
pp kit1
|
270
270
|
|
271
|
-
############################
|
272
|
-
## Plot multiple graphs
|
273
271
|
###########################
|
272
|
+
# Plot multiple graphs
|
273
|
+
##########################
|
274
274
|
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
275
|
+
#$debug_gnuplot=true
|
276
|
+
kit1.gnuplot_write('aname.eps', latex: true)
|
277
|
+
#exit
|
278
|
+
kit2.gnuplot_write('anothername.eps', latex: true)
|
279
|
+
kit3.gnuplot_write('athirdname.eps', latex: true, size: "2.0in,2.0in")
|
280
280
|
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
281
|
+
my_preamble = <<EOF
|
282
|
+
\\documentclass{article}
|
283
|
+
%\documentclass[aip,reprint]{}
|
284
|
+
\\usepackage{graphics,bm,overpic,subfigure,color}
|
285
285
|
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
286
|
+
\\pagestyle{empty}
|
287
|
+
\\begin{document}
|
288
|
+
\\begin{figure}
|
289
|
+
EOF
|
290
290
|
|
291
291
|
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
292
|
+
# Can use default preamble - just don't include preamble option in function call GraphKit.latex_multiplot('all_graphs.eps')
|
293
|
+
GraphKit.latex_multiplot('all_graphs.eps', preamble: my_preamble) do
|
294
|
+
<<EOF
|
295
|
+
\\subfigure{
|
296
|
+
\\includegraphics{aname}
|
297
|
+
}
|
298
|
+
\\subfigure{
|
299
|
+
\\begin{overpic}{anothername}
|
300
|
+
% The location is in percent of image width
|
301
|
+
\\put(44,22){\\includegraphics[scale=.45]
|
302
|
+
{athirdname}}
|
303
|
+
\\end{overpic}
|
304
|
+
}
|
305
|
+
EOF
|
306
306
|
|
307
|
-
|
308
|
-
|
309
|
-
|
307
|
+
end
|
308
|
+
#system "okular #{Dir.pwd}/all_graphs.eps"
|
309
|
+
assert_equal("all_graphs.eps: PostScript document text conforming DSC level 2.0, type EPS\n", `file all_graphs.eps`)
|
310
310
|
|
311
|
-
|
311
|
+
end # Dir.chdir
|
312
312
|
|
313
313
|
|
314
314
|
|
315
|
-
|
315
|
+
end # def
|
316
316
|
|
317
317
|
end # class TestCodeRunner
|
318
318
|
|