coderunner 0.12.11 → 0.12.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.12.11
1
+ 0.12.12
data/coderunner.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "coderunner"
8
- s.version = "0.12.11"
8
+ s.version = "0.12.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Edmund Highcock"]
12
- s.date = "2013-06-27"
12
+ s.date = "2013-07-03"
13
13
  s.description = "CodeRunner is a framework for the automated running and analysis of simulations. It automatically generates any necessary input files, organises the output data and analyses it. Because it is a modular system, it can easily be customised to work with any system and any simulation code. One of its greatest strengths is that it is independent of any one simulation code; thus it can easily plot and compare the data from different codes."
14
14
  s.email = "edmundhighcock@sourceforge.net"
15
15
  s.executables = ["coderunner"]
@@ -671,7 +671,7 @@ end
671
671
  # private :write_info
672
672
 
673
673
  def info_file
674
- @modlet = rcp.modlet
674
+ @modlet = rcp.modlet if rcp.modlet?
675
675
  return <<EOF
676
676
  # <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
677
677
  # #{rcp.code_long} Input Parameters
@@ -683,7 +683,7 @@ def info_file
683
683
  # Directory: #{Dir.pwd}
684
684
  # Runname: #{@run_name}
685
685
  # ID: #{@id}
686
- # #{rcp.modlet_required ? "Modlet:\t#{rcp.modlet}" : ""}
686
+ # #{@modlet ? "Modlet:\t#@modlet" : ""}
687
687
  # Classname: #{self.class.to_s}
688
688
 
689
689
  # #{@job_no ? "Job_No: #{@job_no}" : ""}
@@ -239,88 +239,96 @@ class TestCodeRunner < Test::Unit::TestCase
239
239
  #Process.kill 'TERM', pid1
240
240
  end
241
241
  end
242
+
243
+ if ENV['LATEX']
242
244
 
243
- def test_graphkit_multiplot
244
- unless ENV['SHORT_TEST']
245
- Dir.chdir('test/results') do
246
-
247
- ######################
248
- # Make 3 random graphs
249
- ######################
250
-
251
-
252
- # As usual, data can be an array or a GSL::Vector
253
- 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}\)'})
254
- kit1.title = 'First Graph'
255
- 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
256
- kit1.data[0].title = 'A new title'
257
-
258
- 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}\)'})
259
- kit2.title = 'Second Graph'
260
- kit2.data[0].gp.with = 'lp linewidth 6' # See gnuplot help plot for data options
261
- kit2.gp.key = 'off'
262
- kit2.xlabel = 'A NEW XLABEL'
263
-
264
- 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}\)'})
265
- kit3.title = 'Mouse info'
266
- kit3.data[0].gp.with = 'lp'
267
- kit3.gp.key = 'off'
268
-
269
- #####################
270
- # Plot a single one
271
- #####################
272
-
273
- pp kit1
274
- kit1.gnuplot_write('first_graph.eps', latex: true) #Just plot it by itself
275
- #system "okular #{Dir.pwd}/first_graph.eps"
276
- pp kit1
277
-
278
- ###########################
279
- # Plot multiple graphs
280
- ##########################
245
+ def test_graphkit_multiplot
246
+ unless ENV['SHORT_TEST']
247
+ Dir.chdir('test/results') do
248
+
249
+ ######################
250
+ # Make 3 random graphs
251
+ ######################
252
+
253
+
254
+ # As usual, data can be an array or a GSL::Vector
255
+ 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}\)'})
256
+ kit1.title = 'First Graph'
257
+ 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
258
+ kit1.data[0].title = 'A new title'
259
+
260
+ 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}\)'})
261
+ kit2.title = 'Second Graph'
262
+ kit2.data[0].gp.with = 'lp linewidth 6' # See gnuplot help plot for data options
263
+ kit2.gp.key = 'off'
264
+ kit2.xlabel = 'A NEW XLABEL'
265
+
266
+ 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}\)'})
267
+ kit3.title = 'Mouse info'
268
+ kit3.data[0].gp.with = 'lp'
269
+ kit3.gp.key = 'off'
270
+
271
+ #####################
272
+ # Plot a single one
273
+ #####################
274
+
275
+ pp kit1
276
+ kit1.gnuplot_write('first_graph.eps', latex: true) #Just plot it by itself
277
+ #system "okular #{Dir.pwd}/first_graph.eps"
278
+ pp kit1
279
+
280
+ ###########################
281
+ # Plot multiple graphs
282
+ ##########################
281
283
 
282
- #$debug_gnuplot=true
283
- kit1.gnuplot_write('aname.eps', latex: true)
284
- #exit
285
- kit2.gnuplot_write('anothername.eps', latex: true)
286
- kit3.gnuplot_write('athirdname.eps', latex: true, size: "2.0in,2.0in")
287
-
288
- my_preamble = <<EOF
289
- \\documentclass{article}
290
- %\documentclass[aip,reprint]{}
291
- \\usepackage{graphics,bm,overpic,subfigure,color}
284
+ #$debug_gnuplot=true
285
+ kit1.gnuplot_write('aname.eps', latex: true)
286
+ #exit
287
+ kit2.gnuplot_write('anothername.eps', latex: true)
288
+ kit3.gnuplot_write('athirdname.eps', latex: true, size: "2.0in,2.0in")
289
+
290
+ my_preamble = <<EOF
291
+ \\documentclass{article}
292
+ %\documentclass[aip,reprint]{}
293
+ \\usepackage{graphics,bm,overpic,subfigure,color}
292
294
 
293
- \\pagestyle{empty}
294
- \\begin{document}
295
- \\begin{figure}
295
+ \\pagestyle{empty}
296
+ \\begin{document}
297
+ \\begin{figure}
296
298
  EOF
297
-
298
-
299
- # Can use default preamble - just don't include preamble option in function call GraphKit.latex_multiplot('all_graphs.eps')
300
- GraphKit.latex_multiplot('all_graphs.eps', preamble: my_preamble) do
301
- <<EOF
302
- \\subfigure{
303
- \\includegraphics{aname}
304
- }
305
- \\subfigure{
306
- \\begin{overpic}{anothername}
307
- % The location is in percent of image width
308
- \\put(44,22){\\includegraphics[scale=.45]
309
- {athirdname}}
310
- \\end{overpic}
311
- }
299
+
300
+
301
+ # Can use default preamble - just don't include preamble option in function call GraphKit.latex_multiplot('all_graphs.eps')
302
+ GraphKit.latex_multiplot('all_graphs.eps', preamble: my_preamble) do
303
+ <<EOF
304
+ \\subfigure{
305
+ \\includegraphics{aname}
306
+ }
307
+ \\subfigure{
308
+ \\begin{overpic}{anothername}
309
+ % The location is in percent of image width
310
+ \\put(44,22){\\includegraphics[scale=.45]
311
+ {athirdname}}
312
+ \\end{overpic}
313
+ }
312
314
  EOF
313
315
 
314
- end
315
- #system "okular #{Dir.pwd}/all_graphs.eps"
316
- assert_equal("all_graphs.eps: PostScript document text conforming DSC level 2.0, type EPS\n", `file all_graphs.eps`)
316
+ end
317
+ #system "okular #{Dir.pwd}/all_graphs.eps"
318
+ assert_equal("all_graphs.eps: PostScript document text conforming DSC level 2.0, type EPS\n", `file all_graphs.eps`)
317
319
 
318
- end # Dir.chdir
320
+ end # Dir.chdir
319
321
 
320
- end # unless
321
-
322
-
323
- end # def
322
+ end # unless
323
+
324
+
325
+ end # def
326
+ else
327
+ puts "*******************************************************"
328
+ puts "Warning: latex tests not being run: please specify the environment variable LATEX=true to run latex tests"
329
+ puts "*******************************************************"
330
+ sleep 0.1
331
+ end # if ENV['LATEX']
324
332
 
325
333
  end # class TestCodeRunner
326
334
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coderunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.11
4
+ version: 0.12.12
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-06-27 00:00:00.000000000 Z
12
+ date: 2013-07-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: graphkit