Exemplo n.º 1
0
def test_discover_ndv_list_less_three(arr_str2):
    cons_arr = np.array(
        [
            [1, 1, 1],
            [1, 1, 1],
            [1, 2, 1],
            [1, 2, 1],
            [1, 2, 1],
            [1, 2, 1],
            [1, 1, 1],
            [1, 2, 1],
        ]
    )

    cons_arr2 = np.array(
        [
            [1, 1, 1],
            [1, 2, 1],
            [1, 1, 1],
            [1, 2, 1],
            [1, 1, 1],
            [1, 2, 1],
            [1, 1, 1],
            [1, 2, 1],
        ]
    )

    arr_str2[0] = cons_arr
    arr_str2[1:] = cons_arr2
    candidates = discover_ndv(arr_str2, debug=False, verbose=True)
    candidate_continuous, arr = _compute_continuous(_convert_rgb(arr_str2)[0], 1)
    assert candidates == "None"
Exemplo n.º 2
0
def test_discover_ndv_list_three(arr_str2):
    candidates = discover_ndv(arr_str2, debug=False, verbose=True)
    mode_vals = mode(_convert_rgb(arr_str2)[1])
    candidate_original = [int((mode_vals[0])[0, i]) for i in range(3)]
    candidate_continuous, arr = _compute_continuous(
        _convert_rgb(arr_str2)[0], 1)
    candidate_list = \
        [i for i, j in zip(candidate_original,
                           candidate_continuous)
         if i == j]
    assert candidates == [1, 1, 1]
Exemplo n.º 3
0
def test_discover_ndv_list_less_three2(arr_str2):
    cons_arr = np.array([[1, 1, 1], [1, 1, 1], [1, 2, 1], [1, 2, 1], [1, 2, 1],
                         [1, 2, 1], [1, 1, 1], [1, 2, 1]])

    cons_arr2 = np.array([[1, 1, 1], [1, 2, 1], [1, 1, 1], [1, 2, 1],
                          [1, 1, 1], [1, 2, 1], [1, 1, 1], [1, 2, 1]])

    arr_str2[0] = cons_arr
    arr_str2[1:] = cons_arr2
    candidates = discover_ndv(arr_str2, debug=False, verbose=False)
    mode_vals = mode(_convert_rgb(arr_str2)[1])
    candidate_original = [int((mode_vals[0])[0, i]) for i in range(3)]
    candidate_continuous, arr = _compute_continuous(
        _convert_rgb(arr_str2)[0], 1)
    candidate_list = \
        [i for i, j in zip(candidate_original,
                           candidate_continuous)
         if i == j]
    assert candidates == ''
Exemplo n.º 4
0
def test_discover_ndv_list_three(arr_str2):
    candidates = discover_ndv(arr_str2, debug=False, verbose=True)
    candidate_continuous, arr = _compute_continuous(_convert_rgb(arr_str2)[0], 1)
    assert candidates == [1, 1, 1]