zgrossbart / jdd

A semantic JSON compare tool
http://www.jsondiff.com
Apache License 2.0
1.03k stars 180 forks source link

Fuzzy numeric diffs #13

Closed RobertHenry6bev closed 6 years ago

RobertHenry6bev commented 6 years ago

Is there a way to specify that certain fields are considered equal if they are ieee-64 doubles that differ by less than epsilon, where epsilon is field-specific?

I'm also wondering if the tool supports the extended JSON allowed by default by python, namely supports infinities and nans for numeric input.

zgrossbart commented 6 years ago

Thanks for using JSONDiff. We do not have a mechanism for a fuzzy numeric diff. JSONDiff considers two numbers the same only if they are exactly the same.

JSONDiff also only works on standard JSON documents and not the extended values from Python.

It would probably be possible to change the tool to support these options, but that would be a different tool.

I'd be happy to give you some pointers into the code if you're interested.