Skip to content

Commit

Permalink
fake removal of __eq__ to see what coverage would be
Browse files Browse the repository at this point in the history
  • Loading branch information
mavaylon1 committed Oct 24, 2024
1 parent 55e534a commit 5c6c3eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
Binary file added SortedQueryTest.h5
Binary file not shown.
58 changes: 0 additions & 58 deletions src/hdmf/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,64 +93,6 @@ def __sort(a):
else:
return a

def __eq__(self, other):
if isinstance(other, list):
ret = list()
for i in other:
eq = self == i
ret.append(eq)
ret = sorted(ret, key=self.__sort)
tmp = list()
for i in range(1, len(ret)):
a, b = ret[i - 1], ret[i]
if isinstance(a, tuple):
if isinstance(b, tuple):
if a[1] >= b[0]:
b[0] = a[0]
else:
tmp.append(slice(*a))
else:
if b > a[1]:
tmp.append(slice(*a))
elif b == a[1]:
a[1] == b + 1
else:
ret[i] = a
else:
if isinstance(b, tuple):
if a < b[0]:
tmp.append(a)
else:
if b - a == 1:
ret[i] = (a, b)
else:
tmp.append(a)
if isinstance(ret[-1], tuple):
tmp.append(slice(*ret[-1]))
else:
tmp.append(ret[-1])
ret = tmp
return ret
elif isinstance(other, tuple):
ge = self >= other[0]
ge = ge.start
lt = self < other[1]
lt = lt.stop
if ge == lt:
return ge
else:
return slice(ge, lt)
else:
lower = self.__lower(other)
upper = self.__upper(other)
d = upper - lower
if d == 1:
return lower
elif d == 0:
return None
else:
return slice(lower, upper)

def __ne__(self, other):
eq = self == other
if isinstance(eq, tuple):
Expand Down

0 comments on commit 5c6c3eb

Please sign in to comment.