Skip to content

Commit

Permalink
2nd small issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
eufarn7sp committed Jun 15, 2017
1 parent 0acd7ff commit 5dc2d56
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 55 deletions.
78 changes: 41 additions & 37 deletions egads/egads_log.out
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
2017-06-15 10:36:15,188 : INFO : *****************************************
2017-06-15 10:36:15,188 : INFO : EGADS 0.8.1 is starting ...
2017-06-15 10:36:15,188 : INFO : *****************************************
2017-06-15 10:36:15,335 : INFO : egads.Metadata has been loaded
2017-06-15 10:36:15,335 : INFO : egads.FileMetadata has been loaded
2017-06-15 10:36:15,335 : INFO : egads.VariableMetadata has been loaded
2017-06-15 10:36:15,335 : INFO : egads.AlgorithmMetadata has been loaded
2017-06-15 10:36:15,336 : INFO : egads.EgadsData has been loaded
2017-06-15 10:36:15,336 : INFO : egads.EgadsAlgorithm has been loaded
2017-06-15 10:36:15,336 : INFO : quantities has been imported
2017-06-15 10:36:15,336 : WARNING : EGADS has imported an already installed version of Quantities. If issues occure, please check the version number of Quantities.
2017-06-15 10:36:15,336 : INFO : egads [comparisons] algorithms have been loaded
2017-06-15 10:36:15,336 : INFO : egads [corrections] algorithms have been loaded
2017-06-15 10:36:15,336 : INFO : egads [mathematics] algorithms have been loaded
2017-06-15 10:36:15,338 : INFO : egads [microphysics] algorithms have been loaded
2017-06-15 10:36:15,338 : INFO : egads [thermodynamics] algorithms have been loaded
2017-06-15 10:36:15,343 : INFO : egads [transforms] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [radiation] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [user/comparisons] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [user/corrections] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [user/mathematics] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [user/microphysics] algorithms have been loaded
2017-06-15 10:36:15,344 : INFO : egads [user/thermodynamics] algorithms have been loaded
2017-06-15 10:36:15,345 : INFO : egads [user/transforms] algorithms have been loaded
2017-06-15 10:36:15,345 : INFO : egads [user/radiation] algorithms have been loaded
2017-06-15 10:36:15,345 : INFO : egads [user/comparisons] algorithms have been loaded
2017-06-15 10:36:15,345 : INFO : egads.input.FileCore has been loaded
2017-06-15 10:36:15,349 : INFO : egads.input.NasaAmes has been loaded
2017-06-15 10:36:15,354 : INFO : egads.input.NetCdf has been loaded
2017-06-15 10:36:15,354 : INFO : egads.input.EgadsNetCdf has been loaded
2017-06-15 10:36:15,355 : INFO : egads.input.EgadsFile has been loaded
2017-06-15 10:36:15,355 : INFO : egads.input.EgadsCsv has been loaded
2017-06-15 10:36:15,358 : INFO : quantities has been imported
2017-06-15 10:36:15,358 : WARNING : EGADS has imported an already installed version of Quantities. If issues occure, please check the version number of Quantities.
2017-06-15 10:36:15,359 : INFO : EGADS 0.8.1 is ready ...
2017-06-15 10:36:15,359 : INFO : egads tests are starting ...
2017-06-15 10:36:15,364 : INFO : egads tests are finished.
2017-06-15 10:48:57,878 : INFO : *****************************************
2017-06-15 10:48:57,878 : INFO : EGADS 0.8.1 is starting ...
2017-06-15 10:48:57,879 : INFO : *****************************************
2017-06-15 10:48:58,048 : INFO : egads.Metadata has been loaded
2017-06-15 10:48:58,048 : INFO : egads.FileMetadata has been loaded
2017-06-15 10:48:58,048 : INFO : egads.VariableMetadata has been loaded
2017-06-15 10:48:58,048 : INFO : egads.AlgorithmMetadata has been loaded
2017-06-15 10:48:58,048 : INFO : egads.EgadsData has been loaded
2017-06-15 10:48:58,048 : INFO : egads.EgadsAlgorithm has been loaded
2017-06-15 10:48:58,048 : INFO : quantities has been imported
2017-06-15 10:48:58,048 : WARNING : EGADS has imported an already installed version of Quantities. If issues occure, please check the version number of Quantities.
2017-06-15 10:48:58,049 : INFO : egads [comparisons] algorithms have been loaded
2017-06-15 10:48:58,049 : INFO : egads [corrections] algorithms have been loaded
2017-06-15 10:48:58,049 : INFO : egads [mathematics] algorithms have been loaded
2017-06-15 10:48:58,050 : INFO : egads [microphysics] algorithms have been loaded
2017-06-15 10:48:58,051 : INFO : egads [thermodynamics] algorithms have been loaded
2017-06-15 10:48:58,055 : INFO : egads [transforms] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [radiation] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/comparisons] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/corrections] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/mathematics] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/microphysics] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/thermodynamics] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/transforms] algorithms have been loaded
2017-06-15 10:48:58,056 : INFO : egads [user/radiation] algorithms have been loaded
2017-06-15 10:48:58,057 : INFO : egads [user/comparisons] algorithms have been loaded
2017-06-15 10:48:58,057 : INFO : egads.input.FileCore has been loaded
2017-06-15 10:48:58,059 : INFO : egads.input.NasaAmes has been loaded
2017-06-15 10:48:58,064 : INFO : egads.input.NetCdf has been loaded
2017-06-15 10:48:58,065 : INFO : egads.input.EgadsNetCdf has been loaded
2017-06-15 10:48:58,065 : INFO : egads.input.EgadsFile has been loaded
2017-06-15 10:48:58,065 : INFO : egads.input.EgadsCsv has been loaded
2017-06-15 10:48:58,068 : INFO : quantities has been imported
2017-06-15 10:48:58,068 : WARNING : EGADS has imported an already installed version of Quantities. If issues occure, please check the version number of Quantities.
2017-06-15 10:48:58,069 : INFO : EGADS 0.8.1 is ready ...
2017-06-15 10:48:58,069 : INFO : egads tests are starting ...
2017-06-15 10:48:58,083 : ERROR : egads.input.NetCdf._open_file invoked: RuntimeError, File test12345.nc doesnt exist
2017-06-15 10:48:58,085 : ERROR : egads.input.NetCdf.read_variable invocked: KeyError, variable does not exist in netcdf file
2017-06-15 10:48:58,108 : ERROR : egads.input.EgadsFile._open_file invoked: IOError, File nofile.txt doesnt exist
2017-06-15 10:48:58,109 : ERROR : egads.input.EgadsFile._open_file invoked: IOError, File nofile.txt doesnt exist
2017-06-15 10:48:58,403 : INFO : egads tests are finished.
2 changes: 1 addition & 1 deletion egads/input/netcdf_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def convert_to_nasa_ames(self, na_file=None, requested_ffi=1001, float_format='%
variables = []
for var in var_list:
if var not in var_dims.keys():
dims = self.get_dimension_list(vars)
dims = self.get_dimension_list(var)
if len(dims) > 1:
raise Exception('the actual convert_to_nasa_ames cant process data of multiple '
+ 'dimensions, FFI is set to 1001')
Expand Down
20 changes: 7 additions & 13 deletions egads/tests/input_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class NetCdfFileInputTestCase(unittest.TestCase):

def setUp(self):
self.file = FILE_NAME
f = netCDF4.Dataset(self.file, 'w') # @UndefinedVariable
f = netCDF4.Dataset(self.file, 'w')
f.attribute = GLOBAL_ATTRIBUTE
f.Conventions = CONVENTIONS
f.title = TITLE
Expand Down Expand Up @@ -289,13 +289,8 @@ def test_egadsnetcdf_instance_creation(self):
g.write_variable(data2, 'time', ('time',), 'double')
g.write_variable(data1, 'data', ('time',), 'double')
g.close()
f = netCDF4.Dataset(filename, 'r') # @UndefinedVariable
f = netCDF4.Dataset(filename, 'r')
varin = f.variables['data']

print ''
print type(varin.scale_factor)
print ''

self.assertEqual(varin.shape[0], len(data2), 'Variable dimensions dont match')
self.assertEqual(varin.scale_factor, 1.0, 'Variable scale factor dont match')
self.assertEqual(varin.long_name, 'a common data', 'Variable long name dont match')
Expand Down Expand Up @@ -729,21 +724,20 @@ def test_convert_na_to_nc(self):


def suite():
#netcdf_in_suite = unittest.TestLoader().loadTestsFromTestCase(NetCdfFileInputTestCase)
netcdf_in_suite = unittest.TestLoader().loadTestsFromTestCase(NetCdfFileInputTestCase)
netcdf_out_suite = unittest.TestLoader().loadTestsFromTestCase(NetCdfFileOutputTestCase)
'''text_in_suite = unittest.TestLoader().loadTestsFromTestCase(EgadsFileInputTestCase)
text_in_suite = unittest.TestLoader().loadTestsFromTestCase(EgadsFileInputTestCase)
text_out_suite = unittest.TestLoader().loadTestsFromTestCase(EgadsFileOutputTestCase)
csv_in_suite = unittest.TestLoader().loadTestsFromTestCase(EgadsCsvInputTestCase)
csv_out_suite = unittest.TestLoader().loadTestsFromTestCase(EgadsCsvOutputTestCase)
na_in_suite = unittest.TestLoader().loadTestsFromTestCase(NAInputTestCase)
na_out_suite = unittest.TestLoader().loadTestsFromTestCase(NAOutputTestCase)
netcdf_convert_format_suite = unittest.TestLoader().loadTestsFromTestCase(NetCdfConvertFormatTestCase)
nasa_ames_convert_format_suite = unittest.TestLoader().loadTestsFromTestCase(NAConvertFormatTestCase)'''
nasa_ames_convert_format_suite = unittest.TestLoader().loadTestsFromTestCase(NAConvertFormatTestCase)

'''return unittest.TestSuite([netcdf_in_suite, netcdf_out_suite, text_in_suite, text_out_suite,
return unittest.TestSuite([netcdf_in_suite, netcdf_out_suite, text_in_suite, text_out_suite,
csv_in_suite, csv_out_suite, na_in_suite, na_out_suite,
netcdf_convert_format_suite, nasa_ames_convert_format_suite])'''
return unittest.TestSuite([netcdf_out_suite])
netcdf_convert_format_suite, nasa_ames_convert_format_suite])


if __name__ == '__main__':
Expand Down
8 changes: 4 additions & 4 deletions egads/tests/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
def test():
logging.info('egads tests are starting ...')
suite = unittest.TestSuite()
'''suite.addTest(egads_tests.suite())
suite.addTest(metadata_tests.suite())'''
suite.addTest(egads_tests.suite())
suite.addTest(metadata_tests.suite())
suite.addTest(input_tests.suite())
'''suite.addTest(algorithm_module_tests.suite())
suite.addTest(algorithm_module_tests.suite())
suite.addTest(thermodynamics_tests.suite())
suite.addTest(corrections_mathematics_transforms_tests.suite())
suite.addTest(microphysics_tests.suite())
suite.addTest(radiation_tests.suite())'''
suite.addTest(radiation_tests.suite())
result = unittest.TextTestRunner(verbosity=2).run(suite)
logging.info('egads tests are finished.')
logging.debug('egads.test invoked: tests run ' + str(result.testsRun))
Expand Down

0 comments on commit 5dc2d56

Please sign in to comment.