Skip to content
Snippets Groups Projects
Commit bc847734 authored by Zineb Aly's avatar Zineb Aly
Browse files

make yapf

parent f62e97f5
No related branches found
No related tags found
No related merge requests found
Pipeline #11571 passed with warnings
......@@ -143,8 +143,7 @@ class Branch:
self._branch[self._keymap[key]]._context, 6)
out = self._branch[self._keymap[key]].lazyarray(
interpretation=interpretation,
basketcache=BASKET_CACHE)
interpretation=interpretation, basketcache=BASKET_CACHE)
if self._index_chain is not None and key in self._mapper.toawkward:
cache_key = self._mapper.name + '/' + key
if cache_key not in self._awkward_cache:
......@@ -159,8 +158,8 @@ class Branch:
if isinstance(item, str):
return self.__getkey__(item)
if item.__class__.__name__ == "ChunkedArray":
item = np.array(item)
# if item.__class__.__name__ == "ChunkedArray":
# item = np.array(item)
return self.__class__(self._tree,
self._mapper,
......
......@@ -59,7 +59,7 @@ def unique(array, dtype=np.int64):
out[entry_idx] = last
for i in range(1, n):
current = array[i]
if current == last: # shortcut for sorted arrays
if current == last: # shortcut for sorted arrays
continue
already_present = False
for j in range(entry_idx + 1):
......@@ -70,7 +70,7 @@ def unique(array, dtype=np.int64):
entry_idx += 1
out[entry_idx] = current
last = current
return out[:entry_idx+1]
return out[:entry_idx + 1]
@nb.jit(nopython=True)
......
......@@ -12,7 +12,8 @@ class TestUnique(unittest.TestCase):
max_range = 100
for i in range(23):
low = np.random.randint(0, max_range)
high = np.random.randint(low + 1, low + 2 + np.random.randint(max_range))
high = np.random.randint(low + 1,
low + 2 + np.random.randint(max_range))
n = np.random.randint(max_range)
arr = np.random.randint(low, high, n).astype(dtype)
np_reference = np.sort(np.unique(arr))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment