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

Class FakeSparse

dask/tests/test_utils.py:973–976  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

971 """Simulate sparse arrays via fake .nnz and .shape attributes."""
972
973 class FakeSparse:
974 def __init__(self, nnz, shape):
975 self.nnz = nnz
976 self.shape = shape
977
978 assert is_empty(FakeSparse(0, (10, 10))) is True # nnz == 0 → True
979 assert is_empty(FakeSparse(5, (10, 10))) is False # nnz != 0 → False

Calls

no outgoing calls