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

Class FakeSparse

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

Source from the content-addressed store, hash-verified

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

Calls

no outgoing calls