Пример #1
0
 def setUp(self):
     """Prepare tests."""
     self.cube = Cube([1.0], var_name='co2', units='J')
     self.cube.add_aux_coord(
         AuxCoord(0, 'time', 'time', 'time',
                  Unit('days since 1850-01-01', 'julian')))
     self.fix = AllVars()
Пример #2
0
 def setUp(self):
     """Prepare tests."""
     self.cube = Cube([1.0, 2.0], var_name='co2', units='J')
     reference_dates = [
         datetime(300, 1, 16, 12),  # e.g. piControl
         datetime(1850, 1, 16, 12)  # e.g. historical
     ]
     esgf_time_units = {
         'unit': 'days since 0001-01-01',
         'calendar': 'proleptic_gregorian'
     }
     time_points = date2num(reference_dates, **esgf_time_units)
     self.cube.add_dim_coord(DimCoord(time_points, 'time', 'time', 'time',
                                      Unit(**esgf_time_units)),
                             data_dim=0)
     self.fix = AllVars(None)
Пример #3
0
def test_get_cl_fix():
    """Test getting of fix."""
    fix = Fix.get_fixes('CMIP5', 'ACCESS1-3', 'Amon', 'cl')
    assert fix == [Cl(None), AllVars(None)]
Пример #4
0
 def test_get(self):
     """Test getting of fix."""
     self.assertListEqual(
         Fix.get_fixes('CMIP5', 'ACCESS1-3', 'Amon', 'tas'),
         [AllVars(None)])
Пример #5
0
 def test_get(self):
     self.assertListEqual(Fix.get_fixes('CMIP5', 'ACCESS1-3', 'tas'),
                          [AllVars()])