def test_noise_interface():
    """Test the noise module interface."""

    from pysteps.noise.fftgenerators import (
        initialize_param_2d_fft_filter,
        generate_noise_2d_fft_filter,
        initialize_nonparam_2d_fft_filter,
        initialize_nonparam_2d_ssft_filter,
        generate_noise_2d_ssft_filter,
        initialize_nonparam_2d_nested_filter,
    )

    from pysteps.noise.motion import initialize_bps, generate_bps

    method_getter = pysteps.noise.interface.get_method

    valid_names_func_pair = [
        ("parametric", (initialize_param_2d_fft_filter, generate_noise_2d_fft_filter)),
        (
            "nonparametric",
            (initialize_nonparam_2d_fft_filter, generate_noise_2d_fft_filter),
        ),
        ("ssft", (initialize_nonparam_2d_ssft_filter, generate_noise_2d_ssft_filter)),
        (
            "nested",
            (initialize_nonparam_2d_nested_filter, generate_noise_2d_ssft_filter),
        ),
        ("bps", (initialize_bps, generate_bps)),
    ]

    invalid_names = ["nest", "sft", "ssfft"]

    _generic_interface_test(method_getter, valid_names_func_pair, invalid_names)
Test the noise module interface.
pysteps/tests/test_interfaces.py