55from ctapipe .instrument import SubarrayDescription
66from ctapipe .io import EventSource , TableLoader
77from ctapipe .tools .process import ProcessorTool
8+ from traitlets .config import Config
89
910
1011def test_is_compatible (dummy_dl0 ):
@@ -27,8 +28,10 @@ def test_subarray(dummy_dl0):
2728
2829def test_subarray_events (dummy_dl0 ):
2930 time = dummy_dl0 ["obs_start" ]
31+ all_chunks = dummy_dl0 .get ("all_chunks" , False )
32+ config = Config ({"MultiFiles" : {"all_chunks" : all_chunks }})
3033
31- with EventSource (dummy_dl0 ["trigger_path" ]) as source :
34+ with EventSource (dummy_dl0 ["trigger_path" ], config = config ) as source :
3235 n_read = 0
3336 for i , array_event in enumerate (source ):
3437 assert array_event .count == i
@@ -46,7 +49,7 @@ def test_subarray_events(dummy_dl0):
4649 n_read += 1
4750 time = time + 0.001 * u .s
4851
49- assert n_read == 100
52+ assert n_read == ( 100 if all_chunks else 40 )
5053
5154
5255def test_process (dummy_dl0 , tmp_path ):
@@ -130,7 +133,8 @@ def test_telescope_event_source_missing_ids(dummy_tel_file_no_ids):
130133 assert ProtozfitsDL0TelescopeEventSource .is_compatible (first_ff_file )
131134 assert ProtozfitsDL0TelescopeEventSource .is_compatible (first_ped_file )
132135
133- with EventSource (first_ff_file ) as source :
136+ config = Config ({"MultiFiles" : {"all_chunks" : True }})
137+ with EventSource (first_ff_file , config = config ) as source :
134138 assert isinstance (source , ProtozfitsDL0TelescopeEventSource )
135139
136140 n_read = 0
@@ -142,7 +146,7 @@ def test_telescope_event_source_missing_ids(dummy_tel_file_no_ids):
142146
143147 assert n_read == 50
144148
145- with EventSource (first_ped_file ) as source :
149+ with EventSource (first_ped_file , config = config ) as source :
146150 assert isinstance (source , ProtozfitsDL0TelescopeEventSource )
147151
148152 n_read = 0
0 commit comments