code
stringlengths
3
6.57k
da.core.asarray(x)
assert_eq(xx, yy)
test_negative_n_slicing()
assert_eq(da.ones(2, chunks=2)
np.ones(2)
test_negative_list_slicing()
np.arange(5)
da.from_array(x, chunks=2)
assert_eq(dx[[0, -5]], x[[0, -5]])
assert_eq(dx[[4, -1]], x[[4, -1]])
test_permit_oob_slices()
np.arange(5)
da.from_array(x, chunks=2)
assert_eq(x[-102:], dx[-102:])
assert_eq(x[102:], dx[102:])
assert_eq(x[:102], dx[:102])
assert_eq(x[:-102], dx[:-102])
test_normalize_index()
normalize_index((Ellipsis, None)
slice(None)
normalize_index(5, (np.nan,)
normalize_index(-5, (np.nan,)
normalize_index([-5, -2, 1], (np.nan,)
result.tolist()
normalize_index(slice(-5, -2)
slice(-5, -2)
test_take_semi_sorted()
da.ones(10, chunks=(5,)
np.arange(15)
np.arange(5, 15)
np.arange(5)
np.arange(5)
np.arange(20)
np.arange(10)
np.arange(10)
test_slicing_plan(chunks, index, expected)
slicing_plan(chunks, index)
len(plan)
len(expected)
for (i, x)
zip(plan, expected)
len(x)
len(y)
assert (x == y)
all()
test_pathological_unsorted_slicing()
da.ones(100, chunks=10)
np.arange(100)
reshape(10, 10)
ravel(order='F')
pytest.warns(da.PerformanceWarning)
str(info.list[0])
str(info.list[0])
pytest.mark.parametrize('params', [(2, 2, 1)
test_setitem_with_different_chunks_preserves_shape(params)
da.zeros(array_size, chunks=chunk_size1)
da.zeros(array_size, chunks=chunk_size2)
x.compute()
test_gh3579()
assert_eq(np.arange(10)
da.arange(10, chunks=3)
assert_eq(np.arange(10)
da.arange(10, chunks=3)
pytest.mark.parametrize('lock', [True, False])
pytest.mark.parametrize('asarray', [True, False])
pytest.mark.parametrize('fancy', [True, False])
test_gh4043(lock, asarray, fancy)
da.from_array(np.zeros(3,)
da.from_array(np.ones(3,)
da.stack([a1, a2])
assert_eq(al, al)
Copyright (C)
os.path.abspath(os.path.join(os.path.dirname(__file__)
sys.path.insert(0, top_dir)
collections.namedtuple("Point", "x,y")
is_near(val, expected, tolerance=0.001)
DistanceTask(task.Task)
execute(self, a=Point(0, 0)
Point(0, 0)
math.sqrt(math.pow(b.x - a.x, 2)
math.pow(b.y - a.y, 2)
execute()
origin (and we override it with store values when we want)
time (which then influences what is calculated)
linear_flow.Flow("origin")
add(DistanceTask()
engines.run(any_distance)
print(results)
is_near(results['distance'], 0.0)
engines.run(any_distance, store={'a': Point(1, 1)
print(results)
engines.run(any_distance, store={'a': Point(10, 10)
print(results)
Point(5, 5)
Point(10, 10)
print(results)
at (10, 10)
of (0, 0)
linear_flow.Flow("ten")
ten_distance.add(DistanceTask(inject={'a': Point(10, 10)