def setUpClass(cls): """ Set up tests. We read CORDEX once to keep testing times manageable """ cls.variables_info = CMIP5Info('cordex', default=CustomInfo())
def setUpClass(cls): """ Set up tests. We read CMIP5Info once to keep testing times manageable """ cls.variables_info = CustomInfo()
def test_custom_tables_location(self): """Test constructor with custom tables location.""" cwd = os.path.dirname(os.path.realpath(__file__)) cmor_tables_path = os.path.join(cwd, '..', '..', '..', 'esmvalcore', 'cmor', 'tables', 'cmip5') cmor_tables_path = os.path.abspath(cmor_tables_path) CustomInfo(cmor_tables_path)
def setUpClass(cls): """ Set up tests. We read CMIP5Info once to keep testing times manageable """ cls.variables_info = CMIP3Info('cmip3', CustomInfo(), strict=True)
def setUpClass(cls): """ Set up tests. We read CMIP6Info once to keep tests times manageable """ cls.variables_info = CMIP6Info('cmip6', default=CustomInfo())
def setUpClass(cls): """ Set up tests. We read CMIP6Info once to keep tests times manageable """ cls.variables_info = CMIP6Info(cmor_tables_path='obs4mips', default=CustomInfo())
def test_get_variable_tasaga(self): """Get tas variable.""" CustomInfo() var = self.variables_info.get_variable('Amon', 'tasaga') self.assertEqual(var.short_name, 'tasaga') self.assertEqual(var.long_name, 'Global-mean Near-Surface Air Temperature Anomaly') self.assertEqual(var.units, 'K')
def test_get_variable_tasconf95(self): """Get tas variable.""" CustomInfo() var = self.variables_info.get_variable('Amon', 'tasConf95') self.assertEqual(var.short_name, 'tasConf95') self.assertEqual(var.long_name, 'Near-Surface Air Temperature Uncertainty Range') self.assertEqual(var.units, 'K')
def setUpClass(cls): """Set up tests. We read CMIP6Info once to keep tests times manageable """ cls.variables_info = CMIP6Info('cmip6', default=CustomInfo(), strict=True, alt_names=[ ['sic', 'siconc'], ['tro3', 'o3'], ])
def test_get_variable_tas(self): """Get tas variable.""" CustomInfo() var = self.variables_info.get_variable('Amon', 'netcre') self.assertEqual(var.short_name, 'netcre')