Skip to content

Commit c8aad63

Browse files
jjlevitmarqh
authored andcommitted
Test of changes to MDL CDL file (#20)
* Adding a test CDL file from MDL. Added tests for MDL process chain CDL file.
1 parent 1f15c01 commit c8aad63

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
netcdf tmpcdltest {
2+
variables:
3+
int gfsmos_process_chain;
4+
gfsmos_process_chain:OM_Process = "(step1 step2)";
5+
6+
int step1;
7+
step1:LE_ProcessStep = "NWP__/Models/GFS13" ;
8+
step1:LE_Source = "DA__/Methods/GDAS13" ;
9+
10+
int step2 ;
11+
step2:LE_ProcessStep = "StatPP__/Methods/GFSMOS05" ;
12+
step2:LE_Source = "NWP__/Models/GFS13" ;
13+
14+
//global attribute
15+
:process_chain = "gfsmos_process_chain";
16+
:bald__isPrefixedBy = "prefix_list" ;
17+
18+
group: prefix_list {
19+
20+
// group attributes:
21+
:DA__ = "https://codes.nws.noaa.gov/DataAssimilation" ;
22+
:NWP__ = "https://codes.nws.noaa.gov/NumericalWeatherPrediction" ;
23+
:StatPP__ = "https://codes.nws.noaa.gov/StatisticalPostProcessing" ;
24+
:bald__ = "http://binary-array-ld.net/latest/" ;
25+
26+
} // group bald__prefix_list
27+
}

lib/bald/tests/integration/test_cdl.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,11 @@ def test_alias(self):
2828
validation = bald.validate_netcdf(tfile)
2929
exns = validation.exceptions()
3030
self.assertTrue(validation.is_valid(), msg='{} != []'.format(exns))
31+
32+
def test_process_chain(self):
33+
with self.temp_filename('.nc') as tfile:
34+
cdl_file = os.path.join(self.cdl_path, 'ProcessChain0300.cdl')
35+
subprocess.check_call(['ncgen', '-o', tfile, cdl_file])
36+
validation = bald.validate_netcdf(tfile)
37+
exns = validation.exceptions()
38+
self.assertTrue(validation.is_valid(), msg='{} != []'.format(exns))

0 commit comments

Comments
 (0)