MCPcopy Create free account
hub / github.com/dask/dask / test_boolean_mask_with_unknown_shape

Function test_boolean_mask_with_unknown_shape

dask/array/tests/test_slicing.py:1133–1153  ·  view source on GitHub ↗
(
    shapes: tuple[float | int, float | int],
)

Source from the content-addressed store, hash-verified

1131 ],
1132)
1133def test_boolean_mask_with_unknown_shape(
1134 shapes: tuple[float | int, float | int],
1135) -> None:
1136 x_shape, mask_shape = shapes
1137 arr = delayed(np.ones(10))
1138 x = da.concatenate(
1139 [
1140 da.from_delayed(arr, shape=(x_shape,), dtype=float),
1141 da.from_delayed(arr, shape=(x_shape,), dtype=float),
1142 ]
1143 )
1144 mask = da.concatenate(
1145 [
1146 da.from_delayed(arr, shape=(mask_shape,), dtype=bool),
1147 da.from_delayed(arr, shape=(mask_shape,), dtype=bool),
1148 ]
1149 )
1150 x[mask] = 2
1151
1152 expected = np.full(20, 2.0)
1153 assert_eq(x, expected)

Callers

nothing calls this directly

Calls 5

delayedFunction · 0.90
assert_eqFunction · 0.90
from_delayedMethod · 0.80
onesMethod · 0.45
fullMethod · 0.45

Tested by

no test coverage detected