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

make yapf

parent 0a92e8c2
No related branches found
No related tags found
No related merge requests found
Pipeline #12603 passed with warnings
...@@ -306,7 +306,7 @@ def best_track(events, strategy="default", rec_type=None, rec_stages=None): ...@@ -306,7 +306,7 @@ def best_track(events, strategy="default", rec_type=None, rec_stages=None):
raise ValueError("{} not in {}".format(strategy, options)) raise ValueError("{} not in {}".format(strategy, options))
n_events = len(events) n_events = len(events)
if n_events>1 and any(events.n_tracks == 0): if n_events > 1 and any(events.n_tracks == 0):
raise ValueError( raise ValueError(
"'events' should not contain empty tracks. Consider applying the mask: events.n_tracks>0" "'events' should not contain empty tracks. Consider applying the mask: events.n_tracks>0"
) )
......
...@@ -8,7 +8,8 @@ from pathlib import Path ...@@ -8,7 +8,8 @@ from pathlib import Path
from km3io import OfflineReader from km3io import OfflineReader
from km3io.tools import (to_num, cached_property, unfold_indices, unique, from km3io.tools import (to_num, cached_property, unfold_indices, unique,
uniquecount, fitinf, fitparams, count_nested, _find, uniquecount, fitinf, fitparams, count_nested, _find,
mask, best_track, rec_types, get_w2list_param, get_multiplicity) mask, best_track, rec_types, get_w2list_param,
get_multiplicity)
SAMPLES_DIR = Path(__file__).parent / 'samples' SAMPLES_DIR = Path(__file__).parent / 'samples'
OFFLINE_FILE = OfflineReader(SAMPLES_DIR / 'km3net_offline.root') OFFLINE_FILE = OfflineReader(SAMPLES_DIR / 'km3net_offline.root')
...@@ -90,11 +91,13 @@ class TestBestTrack(unittest.TestCase): ...@@ -90,11 +91,13 @@ class TestBestTrack(unittest.TestCase):
class TestGetMultiplicity(unittest.TestCase): class TestGetMultiplicity(unittest.TestCase):
def test_get_multiplicity(self): def test_get_multiplicity(self):
rec_stages_tracks = get_multiplicity(OFFLINE_FILE.events.tracks, [1, 3, 5, 4]) rec_stages_tracks = get_multiplicity(OFFLINE_FILE.events.tracks,
[1, 3, 5, 4])
assert rec_stages_tracks.rec_stages[0] == [1, 3, 5, 4] assert rec_stages_tracks.rec_stages[0] == [1, 3, 5, 4]
assert rec_stages_tracks.rec_stages[1] == [1, 3, 5, 4] assert rec_stages_tracks.rec_stages[1] == [1, 3, 5, 4]
class TestCountNested(unittest.TestCase): class TestCountNested(unittest.TestCase):
def test_count_nested(self): def test_count_nested(self):
fit = OFFLINE_FILE.events.tracks.fitinf fit = OFFLINE_FILE.events.tracks.fitinf
......
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