gs2crmod 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/gs2crmod.gemspec +2 -2
- data/lib/gs2crmod/ingen.rb +16 -5
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.10.
|
1
|
+
0.10.3
|
data/gs2crmod.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "gs2crmod"
|
8
|
-
s.version = "0.10.
|
8
|
+
s.version = "0.10.3"
|
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", "Ferdinand van Wyk"]
|
12
|
-
s.date = "2013-08-
|
12
|
+
s.date = "2013-08-27"
|
13
13
|
s.description = "GS2 is a gyrokinetic flux tube initial value turbulence code which can be used for fusion or astrophysical plasmas. CodeRunner is a framework for the automated running and analysis of large simulations. This module allows GS2 (and its sister code AstroGK) to harness the power of the CodeRunner framework."
|
14
14
|
s.email = "edmundhighcock@sourceforge.net"
|
15
15
|
s.extensions = ["ext/extconf.rb"]
|
data/lib/gs2crmod/ingen.rb
CHANGED
@@ -64,20 +64,31 @@ def run_namelist_tests(namelist, hash, enum = nil)
|
|
64
64
|
hash[:variables].each do |var, var_hash|
|
65
65
|
gs2_var = (var_hash[:gs2_name] or var)
|
66
66
|
cr_var = var+ext.to_sym
|
67
|
-
|
67
|
+
value = send(cr_var)
|
68
|
+
if value.kind_of? Array
|
69
|
+
value.each{|v| test_variable(namelist, var, var_hash, ext, v)}
|
70
|
+
else
|
71
|
+
test_variable(namelist, var, var_hash, ext, value)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def test_variable(namelist, var, var_hash, ext, value)
|
77
|
+
gs2_var = (var_hash[:gs2_name] or var)
|
78
|
+
cr_var = var+ext.to_sym
|
79
|
+
if value and (not var_hash[:should_include] or eval(var_hash[:should_include]))
|
68
80
|
var_hash[:must_pass].each do |tst|
|
69
|
-
error(test_failed(namelist, cr_var, gs2_var, tst)) unless
|
81
|
+
error(test_failed(namelist, cr_var, gs2_var, tst)) unless value.instance_eval(tst[:test])
|
70
82
|
end if var_hash[:must_pass]
|
71
83
|
var_hash[:should_pass].each do |tst|
|
72
|
-
warning(test_failed(namelist, cr_var, gs2_var, tst)) unless
|
84
|
+
warning(test_failed(namelist, cr_var, gs2_var, tst)) unless value.instance_eval(tst[:test])
|
73
85
|
end if var_hash[:should_pass]
|
74
86
|
if (var_hash[:allowed_values] or var_hash[:text_options])
|
75
87
|
tst = {test: "#{(var_hash[:allowed_values] or var_hash[:text_options]).inspect}.include? self", explanation: "The variable must have one of these values"}
|
76
|
-
error(test_failed(namelist, cr_var, gs2_var, tst)) unless
|
88
|
+
error(test_failed(namelist, cr_var, gs2_var, tst)) unless value.instance_eval(tst[:test])
|
77
89
|
end
|
78
90
|
|
79
91
|
end
|
80
|
-
end
|
81
92
|
end
|
82
93
|
|
83
94
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gs2crmod
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-08-
|
13
|
+
date: 2013-08-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: coderunner
|