Skip to content

Make == , hash not depend on canonicalize? #231

Open
@oxinabox

Description

@oxinabox

#230
made == and hash use canonicalize.
JuliaDiff/FiniteDifferences.jl#111 does the same to FiniteDifferences.to_vec
this is a problem if ever we are having fields that for example match to the properties rather than the fields.
This was brought up in JuliaDiff/ChainRules.jl#285 (comment)

One option might be to introduce a Maybe we should have a canonicalize(x, mode=propertynames) or just always use propertynames rather than fieldnames

But specifically for these cases:
For isequals instead we should probably check that any fields not in both are iszero.
For hash we might be able to drop any fields that are iszero or maybe just any that are Zero.

to_vec is harder and not for this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Structural TangentRelated to the `Tangent` type for structured (composite) values

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions