Skip to content
Snippets Groups Projects
Commit 1ba0c807 authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Merge branch '45-error-when-trying-to-get-track-info' into 'master'

Resolve "Error when trying to get track info"

Closes #45

See merge request !29
parents 657223e1 83c136b0
No related branches found
No related tags found
1 merge request!29Resolve "Error when trying to get track info"
Pipeline #10663 failed
......@@ -159,6 +159,9 @@ class Branch:
if isinstance(item, str):
return self.__getkey__(item)
if item.__class__.__name__ == "ChunkedArray":
item = np.array(item)
return self.__class__(self._tree,
self._mapper,
index_chain=self._index_chain + [item],
......
......@@ -179,6 +179,14 @@ class TestOfflineEvents(unittest.TestCase):
assert np.allclose(self.events.hits[3:5][1][4].dom_id,
self.events[3:5][1][4].hits.dom_id)
def test_fancy_indexing(self):
mask = self.events.n_tracks > 55
tracks = self.events.tracks[mask]
first_tracks = tracks[:, 0]
assert 8 == len(first_tracks)
assert 8 == len(first_tracks.rec_stages)
assert 8 == len(first_tracks.lik)
def test_iteration(self):
i = 0
for event in self.events:
......
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