crusaderky / recursive_diff

Recursively compare Python data structures
Apache License 2.0
14 stars 2 forks source link

Support numpy structured arrays #17

Open shaunc opened 9 months ago

shaunc commented 9 months ago

Currently paths for differences in numpy structured arrays are not readable:

>>> aa = np.zeros(1, dtype=(('a', (np.float32, (2,)))))
>>> bb = np.ones(1, dtype=(('a', (np.float32, (2,)))))
>>> '\n'.join(recursive_diff(aa, bb))
"[data][0]: b'' != b'1'"
crusaderky commented 9 months ago

Thanks for the suggestion @shaunc. While I don't plan to dedicate time to this feature myself, contributions are welcome!