def test_detect_outlier_multivariate_local():
    """Test that"""

    # test input with no outliers at all
    V = np.random.multivariate_normal([0, 0], [[1, 0.5], [0.5, 1]], size=200)
    X = np.random.randint(100, size=(200, 3))
    idx = np.abs(V[:, 1] - V[:, 0]) < 1
    idx = idx & np.all(np.abs(V) < 1.5, axis=1)
    X = X[idx, :]
    V = V[idx, :]
    outliers = cleansing.detect_outliers(V, 4, coord=X, k=50)
    assert outliers.sum() == 0

    # test postive outliers
    V[-2, :] = (10, 0)
    V[-1, :] = (3, -3)
    outliers = cleansing.detect_outliers(V, 4, coord=X, k=50)
    assert outliers.sum() == 2

    # test negative outliers
    V[-2] = (-10, 0)
    V[-1] = (-3, 3)
    outliers = cleansing.detect_outliers(V, 4, coord=X, k=50)
    assert outliers.sum() == 2
Test that
pysteps/tests/test_utils_cleansing.py