Skip to content

Commit

Permalink
Fix the ncra monthly averaging test
Browse files Browse the repository at this point in the history
  • Loading branch information
kwilcox committed May 23, 2017
1 parent a793b0a commit 5fc450b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ def testfiles8589(random_field, tempsrcdir):
shape = random_field.shape
f.createDimension('dim0', shape[0])
f.createDimension('dim1', shape[1])
time = f.createDimension('time', 1)
f.createDimension('time')
var = f.createVariable('random', 'f8', ('time', 'dim0', 'dim1',))
time = f.createVariable('time', 'f8', ('time'))
time.units = stdtimeunits
time.calendar = noleapcalendar
var[:, :, :] = random_field
var[0, :, :] = random_field
time[:] = netCDF4.date2num(date, stdtimeunits,
calendar=noleapcalendar)
f.close()
Expand Down
15 changes: 9 additions & 6 deletions tests/test_nco_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,16 @@ def test_specifying_input_files(testfiles8589):
ncra -p input-path 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
"""
inputs = ['85.nc', '86.nc', '87.nc', '88.nc', '89.nc']
nco = Nco(debug=True)
nco.ncra(input=inputs, output='8589.nc')
nco.ncra(input='8[56789].nc', output='8589.nc')
srcdir = os.path.split(inputs[0])
nco.ncra(input=inputs, output='8589.nc', path=srcdir)
nco.ncra(input=inputs, output='8589.nc', nintap='5,2,1')
nco.ncra(input=testfiles8589, output='8589.nc')
nco.ncra(input=testfiles8589, output='8589.nc', nintap='5,2,1')

srcdir = os.path.dirname(testfiles8589[0])
basenames = [ os.path.basename(x) for x in testfiles8589 ]
nco.ncra(input=basenames, output='8589.nc', path=srcdir)

regpath = os.path.join(srcdir, '8[56789].nc')
nco.ncra(input=regpath, output='8589.nc')


def test_determining_file_format(foo3c, foo364, foo4c, hdf_file):
Expand Down

0 comments on commit 5fc450b

Please sign in to comment.