coderunner 0.15.2 → 0.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/coderunner.gemspec +3 -3
- data/lib/coderunner.rb +1 -0
- data/lib/coderunner/class_methods.rb +20 -2
- data/lib/coderunner/graphs_and_films.rb +21 -1
- data/lib/coderunner/merged_code_runner.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b5b4e29d6198d90530476608c2ba60e25856824
|
4
|
+
data.tar.gz: 163dc42af84b5f77a711139eda5a05f3be4bbb79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bc02faa9a6e4cdfeef891c0dc065ede2a38810b61644a23f64b081906dae81600fe8c765a57f93285f952cd475e997f6d769fe05c44fa0f58c8ccb565dffd5c
|
7
|
+
data.tar.gz: 39e3b82a66e5c00416ffa3771d8cf89ba0fd6baf670fafe9819a8b4c44bfa2f35d3cd59dcc4ccf48f60956b58a71af5cbf9431fde097159284e2e76ff8ae29c4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.15.
|
1
|
+
0.15.4
|
data/coderunner.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: coderunner 0.15.
|
5
|
+
# stub: coderunner 0.15.4 ruby lib
|
6
6
|
# stub: ext/extconf.rb
|
7
7
|
|
8
8
|
Gem::Specification.new do |s|
|
9
9
|
s.name = "coderunner"
|
10
|
-
s.version = "0.15.
|
10
|
+
s.version = "0.15.4"
|
11
11
|
|
12
12
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
13
13
|
s.require_paths = ["lib"]
|
14
14
|
s.authors = ["Edmund Highcock"]
|
15
|
-
s.date = "2014-10-
|
15
|
+
s.date = "2014-10-16"
|
16
16
|
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."
|
17
17
|
s.email = "edmundhighcock@sourceforge.net"
|
18
18
|
s.executables = ["coderunner"]
|
data/lib/coderunner.rb
CHANGED
@@ -181,6 +181,7 @@ class CodeRunner
|
|
181
181
|
LONG_COMMAND_LINE_OPTIONS = [
|
182
182
|
["--replace-existing", "", GetoptLong::NO_ARGUMENT, %[Use with resubmit: causes each resubmitted run to replace the run being resubmitted.]],
|
183
183
|
["--smart-resubmit-name", "", GetoptLong::NO_ARGUMENT, %[Use with resubmit: causes each resubmitted run to only contain its original id and changed parameters in its run name.]],
|
184
|
+
["--submit-runner-index", "", GetoptLong::NO_ARGUMENT, %[Use with submit or resubmit when specifying multiple root folders... selects which runner will be used for submitting (i.e. which root folder the runs will be submitted in.]],
|
184
185
|
] + CODE_COMMAND_OPTIONS
|
185
186
|
LONG_COMMAND_LINE_FLAGS = LONG_COMMAND_LINE_OPTIONS.map{|arr| [arr[0], arr[2]]}
|
186
187
|
|
@@ -610,10 +610,11 @@ EOF
|
|
610
610
|
end
|
611
611
|
def self.submit(copts = {})
|
612
612
|
# process_copts(copts)
|
613
|
-
runner =
|
613
|
+
runner = get_submit_runner(copts)
|
614
614
|
# raise "something is already submitting" if FileTest.exist? "submitting"
|
615
615
|
runs = []
|
616
616
|
raise "Parameters must be an array of inspected hashes" unless copts[:p].kind_of? Array
|
617
|
+
#raise "Can't submit using a merged runner" if runner.kind_of? CodeRunner::Merged
|
617
618
|
Dir.chdir(runner.root_folder) do
|
618
619
|
|
619
620
|
copts[:p].push nil if copts[:p] == []
|
@@ -630,9 +631,26 @@ EOF
|
|
630
631
|
#puts "Got here"
|
631
632
|
#exit(0)
|
632
633
|
end
|
634
|
+
# Fetch a runner appropriate for submitting simulations. In
|
635
|
+
# all usual cases this is just the default runner for the command
|
636
|
+
# but where several folders have been specified and we are dealing
|
637
|
+
# with a merged runner, a single runner is chosen from the merged
|
638
|
+
# runners using submit_runner_index
|
639
|
+
def self.get_submit_runner(copts)
|
640
|
+
runner = fetch_runner(copts)
|
641
|
+
unless runner.kind_of? CodeRunner::Merged
|
642
|
+
return runner
|
643
|
+
else
|
644
|
+
unless copts[:submit_runner_index]
|
645
|
+
raise "You can't submit runs using a merged runner. Please specify the option --submit-runner-index (or submit_runner_index in interactive mode)"
|
646
|
+
else
|
647
|
+
return runner.runners[copts[:submit_runner_index]]
|
648
|
+
end
|
649
|
+
end
|
650
|
+
end
|
633
651
|
def self.resubmit(copts = {})
|
652
|
+
runner = get_submit_runner(copts)
|
634
653
|
# process_copts(copts)
|
635
|
-
runner = fetch_runner(copts)
|
636
654
|
# raise "something is already submitting" if FileTest.exist? "submitting"
|
637
655
|
runs = []
|
638
656
|
raise "Parameters must be an array of inspected hashes" unless copts[:p].kind_of? Array
|
@@ -529,6 +529,7 @@ class CodeRunner
|
|
529
529
|
eputs "Waiting on subprocesses..."
|
530
530
|
Process.waitall
|
531
531
|
end
|
532
|
+
|
532
533
|
unless options[:skip_encoding]
|
533
534
|
eputs "making film"
|
534
535
|
frame_rate = (options[:frame_rate] or options[:fr] || 15)
|
@@ -733,11 +734,30 @@ class CodeRunner
|
|
733
734
|
eputs "Waiting on subprocesses..."
|
734
735
|
Process.waitall
|
735
736
|
end
|
737
|
+
if options[:negative]
|
738
|
+
options[:image_magick] = (options[:image_magick] ? options[:image_magick] + ";" : "") + " mogrify -negate -format png8 file; mv file8 file"
|
739
|
+
end
|
740
|
+
if options[:image_magick]
|
741
|
+
Dir.chdir('film_frames') do
|
742
|
+
Dir.entries.pieces(no_forks).each do |piece|
|
743
|
+
fork do
|
744
|
+
piece.each do |file|
|
745
|
+
system str=options[:image_magick].gsub(/file/, file)
|
746
|
+
p "image_magick", str
|
747
|
+
end
|
748
|
+
end
|
749
|
+
end
|
750
|
+
end
|
751
|
+
end
|
752
|
+
Process.waitall
|
736
753
|
unless options[:skip_encoding]
|
737
754
|
eputs "making film"
|
738
755
|
frame_rate = (options[:frame_rate] or options[:fr] || 15)
|
739
756
|
film_name = (options[:film_name] or options [:fn] or graphkit_frame_array[0][1].file_name + '_film').gsub(/\s/, '_')
|
740
|
-
puts `ffmpeg -y #{options[:bitrate] ? "-b #{options[:bitrate]}" : ""} -r #{frame_rate} -threads #{(@multiple_processes or 1)} -i film_frames/frame_%0#{fd}d#{extension} #{film_name}.mp4`
|
757
|
+
#puts `ffmpeg -y #{options[:bitrate] ? "-b #{options[:bitrate]}" : ""} -r #{frame_rate} -threads #{(@multiple_processes or 1)} -i film_frames/frame_%0#{fd}d#{extension} #{film_name}.mp4`
|
758
|
+
str = "avconv -y -r #{frame_rate} -threads #{(@multiple_processes or 1)} -i film_frames/frame_%0#{fd}d#{extension} #{film_name}.mp4"
|
759
|
+
puts str
|
760
|
+
system str
|
741
761
|
end
|
742
762
|
end
|
743
763
|
|
@@ -23,9 +23,14 @@ class CodeRunner
|
|
23
23
|
# Iterates over the runners contained within the merged runner.
|
24
24
|
# E.g.
|
25
25
|
# merged_runner.each{|runner| p runner.root_folder}
|
26
|
+
attr_reader :runners
|
26
27
|
def each
|
27
28
|
@runners.each{|r| yield(r)}
|
28
29
|
end
|
30
|
+
# Iterate over each of the merged runners, updating them.
|
31
|
+
def update(*args)
|
32
|
+
each{|r| r.update(*args)}
|
33
|
+
end
|
29
34
|
include Enumerable
|
30
35
|
# Create a new merged runner. <tt>runners</tt> is an array of standard runners
|
31
36
|
# (i.e. instances of CodeRunner).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coderunner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Edmund Highcock
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphkit
|