示例#1
0
    def setUpClass(cls):
        """
        Set up tests.

        We read CORDEX once to keep testing times manageable
        """
        cls.variables_info = CMIP5Info('cordex', default=CustomInfo())
示例#2
0
    def setUpClass(cls):
        """
        Set up tests.

        We read CMIP5Info once to keep testing times manageable
        """
        cls.variables_info = CustomInfo()
示例#3
0
 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)
示例#4
0
    def setUpClass(cls):
        """
        Set up tests.

        We read CMIP5Info once to keep testing times manageable
        """
        cls.variables_info = CMIP3Info('cmip3', CustomInfo(), strict=True)
示例#5
0
    def setUpClass(cls):
        """
        Set up tests.

        We read CMIP6Info once to keep tests times manageable
        """
        cls.variables_info = CMIP6Info('cmip6', default=CustomInfo())
示例#6
0
    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())
示例#7
0
 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')
示例#8
0
 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')
示例#9
0
    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'],
                                       ])
示例#10
0
 def test_get_variable_tas(self):
     """Get tas variable."""
     CustomInfo()
     var = self.variables_info.get_variable('Amon', 'netcre')
     self.assertEqual(var.short_name, 'netcre')