Skip to content

Commit

Permalink
Minor testfix for masked value comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Jan 29, 2024
1 parent 8d11cb3 commit b2d33e7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/test_SparseNdarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,15 @@ def _compare_sparse_vectors(left, right):

val_l = sanitize_ndarray(val_l)
val_r = sanitize_ndarray(val_r)
assert (val_l == val_r).all()
comp = (val_l == val_r)

masked = numpy.ma.is_masked(val_l)
assert masked == numpy.ma.is_masked(val_r)
if masked:
assert (val_l.mask == val_r.mask).all()
assert numpy.logical_or(comp, val_r.mask).all()
else:
assert comp.all()


def _recursive_compare_contents(left, right, dim):
Expand Down

0 comments on commit b2d33e7

Please sign in to comment.