def test_es_slope_image(tmin=d_args['tmin'], tmax=d_args['tmax'], es_slope=d_args['es_slope_asce']): output = calcs._es_slope(tmean=ee.Image.constant(0.5 * (tmin + tmax)))\ .reduceRegion(ee.Reducer.first(), geometry=constant_geom, scale=1) \ .getInfo() assert float(output['constant']) == pytest.approx(es_slope)
def test_es_slope_refet(tmin=d_args['tmin'], tmax=d_args['tmax'], es_slope=d_args['es_slope']): assert float( calcs._es_slope(tmean=ee.Number(0.5 * (tmin + tmax)), method='refet').getInfo() == pytest.approx(es_slope))
def test_es_slope_position(tmin=d_args['tmin'], tmax=d_args['tmax'], es_slope=d_args['es_slope']): assert float( calcs._es_slope(ee.Number(0.5 * (tmin + tmax)), 'refet').getInfo()) == pytest.approx(es_slope)
def test_es_slope_default(tmin=d_args['tmin'], tmax=d_args['tmax'], es_slope=d_args['es_slope_asce']): assert float( calcs._es_slope(tmean=ee.Number( 0.5 * (tmin + tmax))).getInfo()) == pytest.approx(es_slope)