8000 ENH: equal_mask flag for assert_array_equal · Issue #30564 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: equal_mask flag for assert_array_equal #30564

@dpinol

Description

@dpinol

Proposed new feature or change:

Working with masked arrays, unit tests often need to check if a function returns the expected masked array.
However, doing it with assert_array_equal is error prone because masked dimensions will not be compared.
Hence this will succeed:

ret = tested_function() # suppose returned np.ma.MaskedArray([4.0], mask=[True])
assert_array_equal(ret, np.array([3.0]))

May an equal_mask flag could be added so that the function compares that, for each item, both or none are masked

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0