Skip to content

Commit

Permalink
updated check.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mhmerrill committed Oct 19, 2019
1 parent fc87e57 commit ec3ed0b
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,25 @@ def check_zeros(N):

print("check zeros :", check_zeros(N))

def check_argsort(N):
# create np version
a = np.arange(N)
a = a[::-1]
iv = np.argsort(a)
a = a[iv]
a = ak.array(a)
# create ak version
b = ak.arange(N)
b = b[::-1]
iv = ak.argsort(b)
b = b[iv]
# print(a,b)
c = a == b
# print(type(c),c)
return pass_fail(c.all())

print("check argsort :", check_argsort(N))

def check_get_slice(N):
# create np version
a = np.ones(N)
Expand Down Expand Up @@ -236,24 +255,5 @@ def check_set_integer_idx(N):

print("check set integer idx = value:", check_set_integer_idx(N))

def check_argsort(N):
# create np version
a = np.arange(N)
a = a[::-1]
iv = np.argsort(a)
a = a[iv]
a = ak.array(a)
# create ak version
b = ak.arange(N)
b = b[::-1]
iv = ak.argsort(b)
b = b[iv]
# print(a,b)
c = a == b
# print(type(c),c)
return pass_fail(c.all())

print("check argsort :", check_argsort(N))

#ak.disconnect()
ak.shutdown()

0 comments on commit ec3ed0b

Please sign in to comment.