File: File.py.test.in

package info (click to toggle)
cdo 2.5.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,964 kB
  • sloc: cpp: 180,221; ansic: 95,352; sh: 7,292; f90: 6,089; makefile: 1,975; ruby: 1,078; csh: 1,020; python: 995; fortran: 319; pascal: 219; perl: 9
file content (34 lines) | stat: -rw-r--r-- 1,064 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#! @PYTHON@

from cdoTest import *

OPERATORS=["cdiwrite","copy"]
FORMATS=["srv","ext","ieg","grb","grb2","nc","nc2","nc4"]
DATATYPES=["F32","F64"]

test_module = TestModule()

for FMS in FORMATS:
    enabled, fileformat_name = fileformat(FMS)
    print(enabled,fileformat_name)
    if (enabled == True):
        for DATATYPE in DATATYPES:

            FILE=f'file{DATATYPE}_{FMS}'
            RFILE=f'{DATAPATH}/file_F32_srv_ref'

            t_cdiwrite = TAPTest(f'cdiwrite {FMS} {DATATYPE}')
            t_cdiwrite.add(f'{CDO} -f {FMS} -b {DATATYPE} cdiwrite,nruns=1,grid=global_10,nvars=3,nlevs=3,nsteps=3 {FILE}')
            t_cdiwrite.add(f'{CDO} diff,abslim=0.0001 {FILE} {RFILE}')
            test_module.add(t_cdiwrite)

            OFILE=f'_file{DATATYPE}_{FMS}_res'
            t_copy = TAPTest(f'copy {FMS} {DATATYPE}')
            t_copy.add(f'{CDO} copy {FILE} {OFILE}')
            t_copy.clean(FILE,OFILE)

            test_module.add(t_copy)
    else:
        test_module.add_skip(f'File format {fileformat_name} not enabled')

test_module.run()