Skip to content

Comparison during snapshot update should use compare function. #60

@jessemyers

Description

@jessemyers

This line:

if encoded_expected_value is None or encoded_value != encoded_expected_value:

is using != rather than relying on the internal compare function, which means that this code cannot be adapted easily to types that do not support regular Python comparison, especially numpy arrays.

(Aside, it'd be especially nice if the Snapshot class allowed compare/encode/decode to be customized more easily; I'm currently experimenting with array comparison using numpy.allclose() by patching the internal _get_compare_encode_decode function.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions