def test_rainfarm_alpha(
    data,
    alpha,
    ds_factor,
    threshold,
    return_alpha,
    spectral_fusion,
    kernel_type,
):
    """Test that rainfarm computes and returns alpha."""
    precip, metadata = data
    window = metadata["xpixelsize"] * ds_factor
    precip_lr, __ = aggregate_fields_space(precip, metadata, window)

    rainfarm = downscaling.get_method("rainfarm")
    precip_hr = rainfarm(
        precip_lr,
        alpha=alpha,
        ds_factor=ds_factor,
        threshold=threshold,
        return_alpha=return_alpha,
        spectral_fusion=spectral_fusion,
        kernel_type=kernel_type,
    )

    assert len(precip_hr) == 2
    if alpha is None:
        assert not precip_hr[1] == alpha
    else:
        assert precip_hr[1] == alpha
Test that rainfarm computes and returns alpha.
pysteps/tests/test_downscaling_rainfarm.py