DeepDiffs.jl icon indicating copy to clipboard operation
DeepDiffs.jl copied to clipboard

Needs heuristics for when to consider vector items "changed"

Open ssfrr opened this issue 7 years ago • 0 comments

Currently we don't support the concept of "changed" items in a vector, just added and removed. This makes sense for e.g. deepdiff([1, 2, 3], [1, 4, 3]), but for vectors of more complicated objects it would be nice to recurse down to recognize items that change.

Probably the right way to solve it is to do the following for composite objects:

  1. change the longest subsequence algorithm to use a similarity cost function rather than binary match/no-match
  2. When walking through the lowest-cost path, for each vertical or horizontal run, pick the closest item to be the one that "changed" and treat the others as "added" or "removed". We could also have some sort of cut-off where really dissimilar objects are treated as an addition/removal rather than a change

ssfrr avatar Feb 04 '17 19:02 ssfrr