diff --git a/examples/plot_offline_hits.py b/examples/plot_offline_hits.py index 6e20ac627048e12ea63e7874d95f3c8382dfbd0a..a6f1c383393e7bbd6d01ee02f480ce1d9402828a 100644 --- a/examples/plot_offline_hits.py +++ b/examples/plot_offline_hits.py @@ -14,7 +14,7 @@ import km3io as ki # To access offline hits/mc_hits data: mc_hits = ki.OfflineReader("samples/numucc.root").events.mc_hits -hits = ki.OfflineReader("samples/aanet_v2.0.0.root").events.hits +hits = ki.OfflineReader("samples/km3net_offline.root").events.hits ##################################################### diff --git a/examples/plot_offline_tracks.py b/examples/plot_offline_tracks.py index 16d9ee132a5cacdb77bb78b51028cec53a0a4df4..d5bf65612c40a8fb2545fa8e1a89fb2163294013 100644 --- a/examples/plot_offline_tracks.py +++ b/examples/plot_offline_tracks.py @@ -13,7 +13,7 @@ import km3io as ki # To access offline tracks/mc_tracks data: mc_tracks = ki.OfflineReader("samples/numucc.root").events.mc_tracks -tracks = ki.OfflineReader("samples/aanet_v2.0.0.root").events.tracks +tracks = ki.OfflineReader("samples/km3net_offline.root").events.tracks ##################################################### diff --git a/examples/plot_online_example.py b/examples/plot_online_example.py index e9a45751fe44e024878469e3f70b4055dc327f09..2a1db9b276ec6513c8cde7953d061cffea100369 100644 --- a/examples/plot_online_example.py +++ b/examples/plot_online_example.py @@ -17,7 +17,7 @@ import km3io as ki # with: -f = ki.OnlineReader("samples/daq_v1.0.0.root") +f = ki.OnlineReader("samples/km3net_online.root") ##################################################### # Note that only some meta information is read into memory. @@ -64,4 +64,4 @@ print(f.summaryslices.headers.frame_index) # Reading TimeSlices # ------------------ # To be continued. -# \ No newline at end of file +# diff --git a/tests/samples/aanet_v2.0.0.root b/tests/samples/km3net_offline.root similarity index 100% rename from tests/samples/aanet_v2.0.0.root rename to tests/samples/km3net_offline.root diff --git a/tests/samples/daq_v1.0.0.root b/tests/samples/km3net_online.root similarity index 100% rename from tests/samples/daq_v1.0.0.root rename to tests/samples/km3net_online.root diff --git a/tests/test_gseagen.py b/tests/test_gseagen.py index 8a2c9bdb946dcb8636425b42408d83885ea7bd09..9063c5f6009a6979d805a176359fe2a714fd93c0 100644 --- a/tests/test_gseagen.py +++ b/tests/test_gseagen.py @@ -56,7 +56,7 @@ class TestGSGHeader(unittest.TestCase): self.assertListEqual(self.header["NuList"].tolist(), [-14, 14]) def test_unsupported_header(self): - f = GSGReader(os.path.join(SAMPLES_DIR, "daq_v1.0.0.root")) + f = GSGReader(os.path.join(SAMPLES_DIR, "km3net_online.root")) with self.assertWarns(UserWarning): f.header diff --git a/tests/test_offline.py b/tests/test_offline.py index 3ccc07459a4a159a1142c1a5261deec458172a52..0f4f42bb013324ca940f35530f0bea8bccd6f5f0 100644 --- a/tests/test_offline.py +++ b/tests/test_offline.py @@ -7,7 +7,7 @@ from km3io import OfflineReader from km3io.offline import _nested_mapper, Header, fitinf, fitparams, count_nested, _find, mask, best_track, rec_types SAMPLES_DIR = Path(__file__).parent / 'samples' -OFFLINE_FILE = OfflineReader(SAMPLES_DIR / 'aanet_v2.0.0.root') +OFFLINE_FILE = OfflineReader(SAMPLES_DIR / 'km3net_offline.root') OFFLINE_USR = OfflineReader(SAMPLES_DIR / 'usr-sample.root') OFFLINE_MC_TRACK_USR = OfflineReader( SAMPLES_DIR / @@ -113,7 +113,7 @@ class TestOfflineReader(unittest.TestCase): self.n_events = 10 def test_context_manager(self): - filename = SAMPLES_DIR / 'aanet_v2.0.0.root' + filename = SAMPLES_DIR / 'km3net_offline.root' with OfflineReader(filename) as r: assert r._filename == filename diff --git a/tests/test_online.py b/tests/test_online.py index 7e0dfdf30fffd427cf5caf66a52e806a130bc272..45897b76a38f4f76a3bf068f1228d18eb80368b8 100644 --- a/tests/test_online.py +++ b/tests/test_online.py @@ -5,19 +5,18 @@ import unittest from km3io.online import OnlineReader, get_rate, has_udp_trailer, get_udp_max_sequence_number, get_channel_flags, get_number_udp_packets SAMPLES_DIR = os.path.join(os.path.dirname(__file__), "samples") +ONLINE_FILE = os.path.join(SAMPLES_DIR, "km3net_online.root") class TestOnlineReaderContextManager(unittest.TestCase): def test_context_manager(self): - filename = os.path.join(SAMPLES_DIR, "daq_v1.0.0.root") - with OnlineReader(filename) as r: - assert r._filename == filename + with OnlineReader(ONLINE_FILE) as r: + assert r._filename == ONLINE_FILE class TestOnlineEvents(unittest.TestCase): def setUp(self): - self.events = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).events + self.events = OnlineReader(ONLINE_FILE).events def test_index_lookup(self): assert 3 == len(self.events) @@ -31,8 +30,7 @@ class TestOnlineEvents(unittest.TestCase): class TestOnlineEvent(unittest.TestCase): def setUp(self): - self.event = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).events[0] + self.event = OnlineReader(ONLINE_FILE).events[0] def test_str(self): assert re.match(".*event.*96.*snapshot.*18.*triggered", @@ -45,8 +43,7 @@ class TestOnlineEvent(unittest.TestCase): class TestOnlineEventsSnapshotHits(unittest.TestCase): def setUp(self): - self.events = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).events + self.events = OnlineReader(ONLINE_FILE).events self.lengths = {0: 96, 1: 124, -1: 78} self.total_item_count = 298 @@ -84,8 +81,7 @@ class TestOnlineEventsSnapshotHits(unittest.TestCase): class TestOnlineEventsTriggeredHits(unittest.TestCase): def setUp(self): - self.events = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).events + self.events = OnlineReader(ONLINE_FILE).events self.lengths = {0: 18, 1: 53, -1: 9} self.total_item_count = 80 @@ -125,8 +121,7 @@ class TestOnlineEventsTriggeredHits(unittest.TestCase): class TestTimeslices(unittest.TestCase): def setUp(self): - self.ts = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).timeslices + self.ts = OnlineReader(ONLINE_FILE).timeslices def test_data_lengths(self): assert 3 == len(self.ts._timeslices["L1"][0]) @@ -151,8 +146,7 @@ class TestTimeslices(unittest.TestCase): class TestTimeslice(unittest.TestCase): def setUp(self): - self.ts = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).timeslices + self.ts = OnlineReader(ONLINE_FILE).timeslices self.n_frames = {"L1": [69, 69, 69], "SN": [64, 66, 68]} def test_str(self): @@ -165,8 +159,7 @@ class TestTimeslice(unittest.TestCase): class TestSummaryslices(unittest.TestCase): def setUp(self): - self.ss = OnlineReader(os.path.join(SAMPLES_DIR, - "daq_v1.0.0.root")).summaryslices + self.ss = OnlineReader(ONLINE_FILE).summaryslices def test_headers(self): assert 3 == len(self.ss.headers)