Пример #1
0
def test_asarraylike_array():
    """
    passing in a list should return a np.ndarray
    """
    arr = np.array([1,2,3,4])
    result = util.asarraylike(arr)

    assert result is arr
Пример #2
0
def test_asarraylike_array():
    """
    passing in a list should return a np.ndarray
    """
    arr = np.array([1, 2, 3, 4])
    result = util.asarraylike(arr)

    assert result is arr
Пример #3
0
def test_asarraylike_list():
    """
    Passing in a list should return a np.ndarray.

    """
    lst = [1, 2, 3, 4]
    result = util.asarraylike(lst)
    assert isinstance(result, np.ndarray)
    assert np.array_equal(result, lst)
Пример #4
0
def test_asarraylike_list():
    """
    passing in a list should return a np.ndarray
    """
    lst = [1,2,3,4]
    result = util.asarraylike(lst)
    print(result)
    assert isinstance(result, np.ndarray)
    assert np.array_equal(result, lst)
Пример #5
0
def test_as_test_asarraylike_dummy():
    dum = DummyArrayLike()
    result = util.asarraylike(dum)
    assert result is dum
Пример #6
0
def test_as_test_asarraylike_dummy():
    dum = DummyArrayLike()

    result = util.asarraylike(dum)

    assert result is dum