def test_utils_interface():
    """Test utils module interface."""

    from pysteps.utils import arrays
    from pysteps.utils import cleansing
    from pysteps.utils import conversion
    from pysteps.utils import dimension
    from pysteps.utils import images
    from pysteps.utils import interpolate
    from pysteps.utils import reprojection
    from pysteps.utils import spectral
    from pysteps.utils import tapering
    from pysteps.utils import transformation

    method_getter = pysteps.utils.interface.get_method

    valid_names_func_pair = [
        ("centred_coord", arrays.compute_centred_coord_array),
        ("decluster", cleansing.decluster),
        ("detect_outliers", cleansing.detect_outliers),
        ("mm/h", conversion.to_rainrate),
        ("rainrate", conversion.to_rainrate),
        ("mm", conversion.to_raindepth),
        ("raindepth", conversion.to_raindepth),
        ("dbz", conversion.to_reflectivity),
        ("reflectivity", conversion.to_reflectivity),
        ("accumulate", dimension.aggregate_fields_time),
        ("clip", dimension.clip_domain),
        ("square", dimension.square_domain),
        ("upscale", dimension.aggregate_fields_space),
        ("morph_opening", images.morph_opening),
        ("rbfinterp2d", interpolate.rbfinterp2d),
        ("reproject_grids", reprojection.reproject_grids),
        ("rapsd", spectral.rapsd),
        ("rm_rdisc", spectral.remove_rain_norain_discontinuity),
        ("compute_mask_window_function", tapering.compute_mask_window_function),
        ("compute_window_function", tapering.compute_window_function),
        ("boxcox", transformation.boxcox_transform),
        ("box-cox", transformation.boxcox_transform),
        ("db", transformation.dB_transform),
        ("decibel", transformation.dB_transform),
        ("log", transformation.boxcox_transform),
        ("nqt", transformation.NQ_transform),
        ("sqrt", transformation.sqrt_transform),
    ]

    invalid_names = ["random", "invalid"]
    _generic_interface_test(method_getter, valid_names_func_pair, invalid_names)
Test utils module interface.
pysteps/tests/test_interfaces.py