Skip to content

CHANGE: PartialEq for Distributions #1217

@Will-Low

Description

@Will-Low

Summary

I'd like to be able to compare distributions to one another, defined as comparing their fields for equality. I'm trying to understand if there is a reason why this isn't currently implemented.

Details

I think this could be added to distributions by just added the PartialEq derive macro.

Motivation

When conducting unit tests, I'd like to be able to compare a created distributions to an expected distribution to they can be considered equal. In #560, it appears this idea was discussed, but people didn't think there was a need. I personally think the unit test case is compelling.

Alternatives

I'm not aware of another way of handling the equality check, since the distribution fields are private.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions