forked from jan/fatamorgana
fixup array equality checking in the case where _USE_NUMPY is false but we somehow still get an ndarray
mostly happens during testing
This commit is contained in:
parent
55638fcde5
commit
aaef122178
@ -2649,10 +2649,13 @@ def dedup_field(record, r_field: str, modals: Modals, m_field: str):
|
|||||||
r = getattr(record, r_field)
|
r = getattr(record, r_field)
|
||||||
m = getattr(modals, m_field)
|
m = getattr(modals, m_field)
|
||||||
if r is not None:
|
if r is not None:
|
||||||
if _USE_NUMPY and m_field in ('polygon_point_list', 'path_point_list'):
|
if m_field in ('polygon_point_list', 'path_point_list'):
|
||||||
equal = numpy.array_equal(m, r)
|
if _USE_NUMPY:
|
||||||
|
equal = numpy.array_equal(m, r)
|
||||||
|
else:
|
||||||
|
equal = (m is not None) and all(tuple(mm) == tuple(rr) for mm, rr in zip(m, r))
|
||||||
else:
|
else:
|
||||||
equal = m is not None and m == r
|
equal = (m is not None) and m == r
|
||||||
|
|
||||||
if equal:
|
if equal:
|
||||||
setattr(record, r_field, None)
|
setattr(record, r_field, None)
|
||||||
|
Loading…
Reference in New Issue
Block a user