From d4997d63f16fbdad4653ed0b932600d7bc5881cc Mon Sep 17 00:00:00 2001 From: zineb aly <aly.zineb.az@gmail.com> Date: Mon, 29 Jun 2020 14:54:30 +0200 Subject: [PATCH] make yapf --- km3io/tools.py | 2 +- tests/test_tools.py | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/km3io/tools.py b/km3io/tools.py index 22bf1e6..045c0cb 100644 --- a/km3io/tools.py +++ b/km3io/tools.py @@ -306,7 +306,7 @@ def best_track(events, strategy="default", rec_type=None, rec_stages=None): raise ValueError("{} not in {}".format(strategy, options)) 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( "'events' should not contain empty tracks. Consider applying the mask: events.n_tracks>0" ) diff --git a/tests/test_tools.py b/tests/test_tools.py index 17f1fd1..05dd386 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -8,7 +8,8 @@ from pathlib import Path from km3io import OfflineReader from km3io.tools import (to_num, cached_property, unfold_indices, unique, 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' OFFLINE_FILE = OfflineReader(SAMPLES_DIR / 'km3net_offline.root') @@ -90,11 +91,13 @@ class TestBestTrack(unittest.TestCase): class TestGetMultiplicity(unittest.TestCase): 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[1] == [1, 3, 5, 4] + class TestCountNested(unittest.TestCase): def test_count_nested(self): fit = OFFLINE_FILE.events.tracks.fitinf -- GitLab