You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When it contains non numeric data (e.g. strings), the maxdiff is 'nan' and thus, you get no colors.
Worse yet, when it does not contain strings but contains zeros it crashes with ZeroDivisionError because np.seterr(divide='ignore', invalid='ignore') has no effect for object arrays. In effect in that case a / b is mostly equal to calling __truediv__ on each cell and this raises ZeroDivisionError: division by zero
>>>arr1=ndtest(3).astype(object)
>>>arr2=ndtest(3).astype(object)
>>>compare(arr1, arr2)
<snip>FileC:\usr\devel\larray-editor\larray_editor\comparator.py:185, inComparatorWidget._update_from_combined_array(self)
183withnp.errstate(divide='ignore', invalid='ignore'):
184diff=self._combined_array-self._array0-->185reldiff=diff/self._array0186# make reldiff 0 where the values are the same than array0 even for187# special values (0, nan, inf, -inf)188# at this point reldiff can still contain nan and infs189reldiff=la.where(eq, 0, reldiff)
ZeroDivisionError: divisionbyzero
Activity
gdementen commentedon Mar 23, 2026
Simple test cases:
FIX: compare() for non-numeric arrays (fixes #163)
FIX: compare() for non-numeric arrays (fixes larray-project#163)