def test_get_diagnostics_with_real_component(): dummy = RRTMGLongwave() state = get_default_state([dummy]) diag = dummy.create_state_dict_for('_climt_diagnostics', state) for quantity in dummy._climt_diagnostics: assert quantity in diag
def test_get_inputs_with_real_component(): dummy = RRTMGLongwave() state = get_default_state([dummy]) diag = dummy.create_state_dict_for('_climt_inputs', state) for quantity in dummy._climt_inputs: assert quantity in diag assert diag[quantity].dims == state[quantity].dims
def test_get_diagnostics_with_real_component_with_2d_coordinates(): dummy = RRTMGLongwave() state = get_default_state([dummy], x=dict(label='shore', values=np.random.randn(2, 2), units='km'), y=dict(label='latitude', values=np.random.randn(2, 2), units='degrees east')) diag = dummy.create_state_dict_for('_climt_diagnostics', state) for quantity in dummy.diagnostics: assert quantity in diag assert 'shore' in diag[quantity].coords assert 'latitude' in diag[quantity].coords assert diag[quantity].coords['shore'].ndim == 2 assert diag[quantity].coords['latitude'].ndim == 2