Skip to content
Snippets Groups Projects
Commit d0b4b09b authored by Rodrigo G. Ruiz's avatar Rodrigo G. Ruiz
Browse files

make black

parent f8e6bda1
No related branches found
No related tags found
1 merge request!54Resolve "Missing status and mother_id in offline reader"
Pipeline #18606 passed
...@@ -18,7 +18,10 @@ OFFLINE_MC_TRACK_USR = OfflineReader( ...@@ -18,7 +18,10 @@ OFFLINE_MC_TRACK_USR = OfflineReader(
) )
) )
OFFLINE_NUMUCC = OfflineReader(data_path("offline/numucc.root")) # with mc data OFFLINE_NUMUCC = OfflineReader(data_path("offline/numucc.root")) # with mc data
OFFLINE_MC_TRACK = OfflineReader(data_path("gseagen/gseagen_v7.0.0_numuCC_diffuse.aa.root")) OFFLINE_MC_TRACK = OfflineReader(
data_path("gseagen/gseagen_v7.0.0_numuCC_diffuse.aa.root")
)
class TestOfflineReader(unittest.TestCase): class TestOfflineReader(unittest.TestCase):
def setUp(self): def setUp(self):
...@@ -185,7 +188,7 @@ class TestOfflineEvents(unittest.TestCase): ...@@ -185,7 +188,7 @@ class TestOfflineEvents(unittest.TestCase):
500000000, 500000000,
400000000, 400000000,
] ]
def test_len(self): def test_len(self):
assert self.n_events == len(self.events) assert self.n_events == len(self.events)
...@@ -438,14 +441,14 @@ class TestOfflineTracks(unittest.TestCase): ...@@ -438,14 +441,14 @@ class TestOfflineTracks(unittest.TestCase):
def test_status(self): def test_status(self):
assert np.allclose(self.status, self.mc_tracks[1].status[:10].tolist()) assert np.allclose(self.status, self.mc_tracks[1].status[:10].tolist())
def test_mother_id(self): def test_mother_id(self):
assert np.allclose(self.mother_id, self.mc_tracks[1].mother_id[:10].tolist()) assert np.allclose(self.mother_id, self.mc_tracks[1].mother_id[:10].tolist())
def test_attribute_error_raised_for_older_files(self): def test_attribute_error_raised_for_older_files(self):
with self.assertRaises(AttributeError): with self.assertRaises(AttributeError):
self.tracks[1].mother_id self.tracks[1].mother_id
def test_item_selection(self): def test_item_selection(self):
self.assertListEqual( self.assertListEqual(
list(self.tracks[0].dir_z[:2]), [-0.872885221293917, -0.872885221293917] list(self.tracks[0].dir_z[:2]), [-0.872885221293917, -0.872885221293917]
......
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