diff --git a/km3io/rootio.py b/km3io/rootio.py index a3b3028ccc8555ae21c567901d8890ff088ffc9e..ffaf69f0f66b7b9f4123a0da935a85620d7ca6b7 100644 --- a/km3io/rootio.py +++ b/km3io/rootio.py @@ -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, diff --git a/km3io/tools.py b/km3io/tools.py index 5abeba7884f7232c079e661ffc62f3609a2a2efc..f664db0e020a0cb0fd1a909853395343347f3150 100644 --- a/km3io/tools.py +++ b/km3io/tools.py @@ -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) diff --git a/tests/test_tools.py b/tests/test_tools.py index 9d0517a889ab0cb8e97c5eb252a8256d52d6eba3..5306f42d0d4e7588626e0dc97207fc44f92e49db 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -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))