Exemplo n.º 1
0
def test_hs_without_latitude():

    hs = HeldSuarez()

    random = np.random.RandomState(0)
    input_state = {
        'air_pressure':
        DataArray(
            random.rand(2, 3, 6),
            dims=['longitude', 'latitude', 'mid_levels'],
            attrs={'units': 'hPa'},
        ),
        'surface_air_pressure':
        DataArray(
            random.rand(2, 3),
            dims=['longitude', 'latitude'],
            attrs={'units': 'hPa'},
        ),
        'air_temperature':
        DataArray(270. + random.randn(2, 3, 6),
                  dims=['longitude', 'latitude', 'mid_levels'],
                  attrs={'units': 'degK'}),
        'eastward_wind':
        DataArray(random.randn(2, 3, 6),
                  dims=['longitude', 'latitude', 'mid_levels'],
                  attrs={'units': 'm/s'}),
        'northward_wind':
        DataArray(random.randn(2, 3, 6),
                  dims=['longitude', 'latitude', 'mid_levels'],
                  attrs={'units': 'm/s'})
    }

    with pytest.raises(IndexError) as excinfo:
        hs(input_state)
    assert 'quantity labeled' in str(excinfo.value)
Exemplo n.º 2
0
 def get_component_instance(self):
     return GFSDynamicalCore([HeldSuarez()])
Exemplo n.º 3
0
 def get_component_instance(self, state_modification_func=lambda x: x):
     return HeldSuarez()
Exemplo n.º 4
0
 def get_component_instance(self):
     return HeldSuarez()