From 3c16c143b94e918426642c9c770d3f7e99091bc6 Mon Sep 17 00:00:00 2001 From: Zineb Aly <zaly@km3net.de> Date: Thu, 12 Nov 2020 13:08:07 +0100 Subject: [PATCH] make black --- km3io/tools.py | 8 ++++---- tests/test_tools.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/km3io/tools.py b/km3io/tools.py index 1c8f2c8..b42a5ab 100644 --- a/km3io/tools.py +++ b/km3io/tools.py @@ -769,15 +769,15 @@ def is_CC(fobj): """Determin if an event (or events) are a result of a Charged Curent interaction (CC) or a Neutral Curent interaction (NC). - According to: https://wiki.km3net.de/index.php/Simulations/The_gSeaGen_code#Physics_event_entries + According to: https://wiki.km3net.de/index.php/Simulations/The_gSeaGen_code#Physics_event_entries the interaction types are defined as follow: - INTER Interaction type + INTER Interaction type 1 EM 2 Weak[CC] 3 Weak[NC] 4 Weak[CC+NC+interference] - 5 NucleonDecay + 5 NucleonDecay Parameters ---------- @@ -791,7 +791,7 @@ def is_CC(fobj): if all(len_w2lists <= 7): # old nu file have w2list of len 7. usr_names = fobj.events.mc_tracks.usr_names usr_data = fobj.events.mc_tracks.usr - mask_cc_flag = (usr_names[:, 0] == b"cc") + mask_cc_flag = usr_names[:, 0] == b"cc" inter_ID = usr_data[:, 0][mask_cc_flag] out = ak1.flatten(inter_ID == 2) # 2 is the interaction ID for CC. diff --git a/tests/test_tools.py b/tests/test_tools.py index d2a7325..719d5bb 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -536,5 +536,7 @@ class TestIsCC(unittest.TestCase): NC_file = is_CC(GENHEN_OFFLINE_FILE) CC_file = is_CC(GSEAGEN_OFFLINE_FILE) - self.assertFalse(all(NC_file) == True) # this test fails because the CC flags are not reliable in old files + self.assertFalse( + all(NC_file) == True + ) # this test fails because the CC flags are not reliable in old files self.assertTrue(all(CC_file) == True) -- GitLab