cdo 1.3.3 → 1.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/gemspec +1 -1
- data/lib/cdo.rb +9 -4
- data/test/test_cdo.rb +18 -7
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 839669f481246fb63e5ad6b7871127ef6b1c710d
|
4
|
+
data.tar.gz: fae0e2fa60efa590697c9cf73f0e1fc3db103cd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12c44ad5bb29e96457a623d07060a87557f79b2ee9246faf1b0e477865ff5603219118260fa2db0623a149dda45f133db132980ddd18c41c44949dfb86c06fa0
|
7
|
+
data.tar.gz: '02851b39cb5c9fd19941e0e85c594d01fdcd51349bf0df6255477fb92ae1ede816a42d438fe19ba077ed7dc1958bcfc38d789031186faf09361b76c43c97ddd3'
|
data/gemspec
CHANGED
@@ -3,7 +3,7 @@ $:.unshift File.join(File.dirname(__FILE__),"..","lib")
|
|
3
3
|
|
4
4
|
spec = Gem::Specification.new do |s|
|
5
5
|
s.name = "cdo"
|
6
|
-
s.version = '1.3.
|
6
|
+
s.version = '1.3.4'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.files = ["lib/cdo.rb","lib/cdo_lib.rb"] + ["gemspec","LICENSE"]
|
9
9
|
s.test_file = "test/test_cdo.rb"
|
data/lib/cdo.rb
CHANGED
@@ -40,7 +40,7 @@ class Cdo
|
|
40
40
|
@forceOutput = forceOutput
|
41
41
|
@env = env
|
42
42
|
@debug = ENV.has_key?('DEBUG') ? true : debug
|
43
|
-
@noOutputOperators = getNoOuputOperators(@cdo)
|
43
|
+
@noOutputOperators = getNoOuputOperators(@cdo) # operators without output files (write to stdout)
|
44
44
|
@returnNilOnError = returnNilOnError
|
45
45
|
|
46
46
|
@filetypes = getFiletypes
|
@@ -87,7 +87,7 @@ class Cdo
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def getNoOuputOperators(path2cdo)
|
90
|
-
if version > '1.8.0' then
|
90
|
+
if version > '1.8.0' and version < '1.9.0' then
|
91
91
|
puts 'CMD:'+path2cdo+' --operators_no_output' if @debug
|
92
92
|
IO.popen(path2cdo+' --operators_no_output').readlines.map{|line| line.split(' ')[0]}.flatten
|
93
93
|
else
|
@@ -295,8 +295,13 @@ class Cdo
|
|
295
295
|
return true
|
296
296
|
end
|
297
297
|
|
298
|
-
def version
|
299
|
-
IO.popen("#{@cdo} -V 2>&1").readlines
|
298
|
+
def version(verbose=false)
|
299
|
+
info = IO.popen("#{@cdo} -V 2>&1").readlines
|
300
|
+
if verbose then
|
301
|
+
return info.join
|
302
|
+
else
|
303
|
+
return info.first.split(/version/i).last.strip.split(' ').first
|
304
|
+
end
|
300
305
|
end
|
301
306
|
|
302
307
|
# return cdf handle to given file readonly
|
data/test/test_cdo.rb
CHANGED
@@ -38,6 +38,9 @@ class TestCdo < Minitest::Test
|
|
38
38
|
pp @@maintainermode
|
39
39
|
pp @@show
|
40
40
|
end
|
41
|
+
def test_V
|
42
|
+
puts @cdo.version(verbose=true)
|
43
|
+
end
|
41
44
|
def test_getOperators
|
42
45
|
%w[for random stdatm info showlevel sinfo remap geopotheight mask topo thicknessOfLevels].each {|op|
|
43
46
|
if ["thicknessOfLevels"].include?(op)
|
@@ -69,7 +72,8 @@ class TestCdo < Minitest::Test
|
|
69
72
|
end
|
70
73
|
def test_CDO_version
|
71
74
|
assert("1.4.3.1" < @cdo.version,"Version too low: #{@cdo.version}")
|
72
|
-
assert("1.8.1"
|
75
|
+
assert("1.8.1" < @cdo.version,"Version too low: #{@cdo.version}")
|
76
|
+
assert("3.0" > @cdo.version,"Version too high: #{@cdo.version}")
|
73
77
|
end
|
74
78
|
def test_args
|
75
79
|
ofile0 = @cdo.stdatm(0,20,40,80,200,230,400,600,1100)
|
@@ -259,12 +263,13 @@ class TestCdo < Minitest::Test
|
|
259
263
|
end
|
260
264
|
|
261
265
|
def test_noOutputOps
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
266
|
+
%w[griddes griddes2 gridverify info infoc infon infop infos infov map ncode
|
267
|
+
ncode ndate ngridpoints ngrids nlevel nmon npar ntime nvar nyear output
|
268
|
+
outputarr outputbounds outputboundscpt outputcenter outputcenter2
|
269
|
+
outputcentercpt outputext outputf outputfld outputint outputkey outputsrv
|
270
|
+
outputtab outputtri outputts outputvector outputvrml outputxyz pardes partab].each {|op|
|
271
|
+
assert(@cdo.noOutputOps.include?(op))
|
272
|
+
}
|
268
273
|
end
|
269
274
|
|
270
275
|
def test_output_set_to_nil
|
@@ -495,6 +500,12 @@ class TestCdo < Minitest::Test
|
|
495
500
|
@cdo.sinfov(input: cmd)
|
496
501
|
puts @cdo.showLog
|
497
502
|
end
|
503
|
+
def test_noOutputOps
|
504
|
+
c = Cdo.new
|
505
|
+
opsCounf = c.noOutputOps.size
|
506
|
+
assert(opsCounf > 50)
|
507
|
+
assert(opsCounf < 200)
|
508
|
+
end
|
498
509
|
end
|
499
510
|
|
500
511
|
# # Calling simple operators
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cdo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ralf Mueller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: unifiedPlot
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.6.
|
86
|
+
rubygems_version: 2.6.11
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: Easy access to the Climate Data operators
|