def test_decluster_single():
    """decluster a single vector"""

    X = np.array([[0.0, 0.0]])
    V = np.array([[1.0, 1.0]])
    X_dec, V_dec = cleansing.decluster(X, V, 20, 1)

    assert X_dec.ndim == 2
    assert V_dec.ndim == 2
    assert np.all(X_dec == X)
    assert np.all(X_dec == X)

    X_dec, V_dec = cleansing.decluster(X, V, 20, 2)
    assert X_dec.ndim == 2
    assert V_dec.ndim == 2
    assert X_dec.shape[0] == 0
    assert V_dec.shape[0] == 0
decluster a single vector
pysteps/tests/test_utils_cleansing.py