def test_data_name_gfdl_annual(): for data_type in ['ts', 'inst']: expected = 'atmos.2010.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, 'annual', 2010, None, 2000, 1) assert result == expected expected = 'atmos.2006-2011.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, 'annual', 2010, None, 2000, 6) assert result == expected for intvl_type in ['annual', 'ann']: expected = 'atmos.2010.ann.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, None, 2000, 1) assert result == expected expected = 'atmos.2006-2011.ann.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, None, 2000, 6) assert result == expected expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'annual', 2010, None, 2000, 6) assert result == expected
def test_data_name_gfdl_hr(): expected = 'atmos.2006010100-2011123123.temp.nc' for data_type in ['ts', 'inst']: result = io.data_name_gfdl('temp', 'atmos', data_type, '3hr', 2010, None, 2000, 6) assert result == expected with pytest.raises(NameError): io.data_name_gfdl('temp', 'atmos', 'av', '3hr', 2010, None, 2000, 6) expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', '3hr', 2010, None, 2000, 6) assert result == expected
def test_data_name_gfdl_hr(self): for data_type in ['ts', 'inst']: expected = 'atmos.2006010100-2011123123.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, '3hr', 2010, None, 2000, 6) self.assertEqual(result, expected) with self.assertRaises(NameError): io.data_name_gfdl('temp', 'atmos', 'av', '3hr', 2010, None, 2000, 6) expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', '3hr', 2010, None, 2000, 6) self.assertEqual(result, expected)
def test_data_name_gfdl_hr(): for data_type in ['ts', 'inst']: expected = 'atmos.2006010100-2011123123.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, '3hr', 2010, None, 2000, 6) assert result == expected with pytest.raises(NameError): io.data_name_gfdl('temp', 'atmos', 'av', '3hr', 2010, None, 2000, 6) expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', '3hr', 2010, None, 2000, 6) assert result == expected
def test_data_name_gfdl_seasonal(): for data_type in ['ts', 'inst']: with pytest.raises(NameError): io.data_name_gfdl('temp', 'atmos', data_type, 'seasonal', 2010, None, 2000, 6) for intvl_type in ['seasonal', 'seas']: expected = 'atmos.2010.JJA.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 1) assert result == expected expected = 'atmos.2006-2011.JJA.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 6) assert result == expected expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'seasonal', 2010, None, 2000, 6) assert result == expected
def test_data_name_gfdl_seasonal(self): for data_type in ['ts', 'inst']: with self.assertRaises(NameError): io.data_name_gfdl('temp', 'atmos', data_type, 'seasonal', 2010, None, 2000, 6) for intvl_type in ['seasonal', 'seas']: expected = 'atmos.2010.JJA.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 1) self.assertEqual(result, expected) expected = 'atmos.2006-2011.JJA.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 6) self.assertEqual(result, expected) expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'seasonal', 2010, None, 2000, 6) self.assertEqual(result, expected)
def test_data_name_gfdl_monthly(): expected = 'atmos.200601-201112.temp.nc' for data_type in ['ts', 'inst']: result = io.data_name_gfdl('temp', 'atmos', data_type, 'monthly', 2010, 'jja', 2000, 6) assert result == expected for intvl_type in ['monthly', 'mon']: expected = 'atmos.2010.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 1) assert result == expected expected = 'atmos.2006-2011.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 6) assert result == expected expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'monthly', 2010, 'jja', 2000, 6) assert result == expected
def test_data_name_gfdl_monthly(self): for data_type in ['ts', 'inst']: expected = 'atmos.200601-201112.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, 'monthly', 2010, 'jja', 2000, 6) self.assertEqual(result, expected) for intvl_type in ['monthly', 'mon']: expected = 'atmos.2010.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 1) self.assertEqual(result, expected) expected = 'atmos.2006-2011.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 6) self.assertEqual(result, expected) expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'monthly', 2010, 'jja', 2000, 6) self.assertEqual(result, expected)
def test_data_name_gfdl_monthly(): for data_type in ['ts', 'inst']: expected = 'atmos.200601-201112.temp.nc' result = io.data_name_gfdl('temp', 'atmos', data_type, 'monthly', 2010, 'jja', 2000, 6) assert result == expected for intvl_type in ['monthly', 'mon']: expected = 'atmos.2010.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 1) assert result == expected expected = 'atmos.2006-2011.jja.nc' result = io.data_name_gfdl('temp', 'atmos', 'av', intvl_type, 2010, 'jja', 2000, 6) assert result == expected expected = 'atmos.2006-2011.01-12.nc' result = io.data_name_gfdl('temp', 'atmos', 'av_ts', 'monthly', 2010, 'jja', 2000, 6) assert result == expected