source: nappy/trunk/tests/test_2010_to_2110.py @ 5072

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/trunk/tests/test_2010_to_2110.py@7710
Revision 5072, 495 bytes checked in by spascoe, 11 years ago (diff)

Moved tests back out of the package hierarchy. They are now not
included in the egg but can be run from a checkout or a
distribution directory created with "easy_install -eb . nappy"

To run the tests do "python setup.py test" or "nosetests" from the
checkout.

Line 
1import nappy.nc_interface.na_to_nc
2import nappy.nc_interface.nc_to_na
3import os
4
5in_dir = out_dir = os.path.join(os.path.dirname(__file__), "../test_outputs")
6
7ffi_in, ffi_out = (2010, 2110)
8
9infile = os.path.join(in_dir, "%s.nc" % (ffi_in))
10outfile = os.path.join(out_dir, "%s_from_nc_%s.na" % (ffi_out, ffi_in))
11
12print "Reading:", infile
13x = nappy.nc_interface.nc_to_na.NCToNA(infile, requested_ffi=ffi_out)
14
15print "Writing:", outfile
16x.writeNAFiles(outfile, delimiter=",", float_format="%g")
Note: See TracBrowser for help on using the repository browser.