source: nappy/branches/nappy-eggable/tests/test_2010_to_2310.py @ 5072

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/nappy/branches/nappy-eggable/tests/test_2010_to_2310.py@5072
Revision 5072, 496 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.

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