def test_rainfarm_shape(
    data,
    alpha,
    ds_factor,
    threshold,
    return_alpha,
    spectral_fusion,
    kernel_type,
):
    """Test that the output of rainfarm is consistent with the downscaling factor."""
    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 precip_hr.ndim == precip.ndim
    assert precip_hr.shape[0] == precip.shape[0]
    assert precip_hr.shape[1] == precip.shape[1]
Test that the output of rainfarm is consistent with the downscaling factor.
pysteps/tests/test_downscaling_rainfarm.py