Skip to content

Commit 25ca240

Browse files
committed
Disable progress bar in unit tests.
1 parent 67bbb67 commit 25ca240

10 files changed

Lines changed: 59 additions & 59 deletions

tests/test_chemical_generation.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_fullscan_from_mzml(self, chems_from_mzml):
211211
ionisation_mode = POSITIVE
212212
controller = SimpleMs1Controller()
213213
ms = IndependentMassSpectrometer(ionisation_mode, chems_from_mzml)
214-
env = Environment(ms, controller, 500, 600, progress_bar=True)
214+
env = Environment(ms, controller, 500, 600, progress_bar=False)
215215
set_log_level_warning()
216216
env.run()
217217
filename = 'fullscan_from_mzml.mzML'
@@ -227,7 +227,7 @@ def test_topn_from_mzml(self, chems_from_mzml):
227227
controller = TopNController(ionisation_mode, N, isolation_width, mz_tol, rt_tol,
228228
min_ms1_intensity)
229229
ms = IndependentMassSpectrometer(ionisation_mode, chems_from_mzml)
230-
env = Environment(ms, controller, 500, 600, progress_bar=True)
230+
env = Environment(ms, controller, 500, 600, progress_bar=False)
231231
set_log_level_warning()
232232
env.run()
233233
check_non_empty_MS2(controller)
@@ -238,7 +238,7 @@ def test_mz_rt_i_from_mzml(self, chem_mz_rt_i_from_mzml):
238238
ionisation_mode = POSITIVE
239239
controller = SimpleMs1Controller()
240240
ms = IndependentMassSpectrometer(ionisation_mode, chem_mz_rt_i_from_mzml)
241-
env = Environment(ms, controller, 500, 600, progress_bar=True)
241+
env = Environment(ms, controller, 500, 600, progress_bar=False)
242242
set_log_level_warning()
243243
env.run()
244244
filename = 'fullscan_mz_rt_i_from_mzml.mzML'
@@ -259,7 +259,7 @@ def test_default_scan_time(self, chems_from_mzml):
259259
# run simulation using default scan times
260260
ms = IndependentMassSpectrometer(ionisation_mode, chems_from_mzml,
261261
scan_duration=DEFAULT_SCAN_TIME_DICT)
262-
env = Environment(ms, controller, 500, 600, progress_bar=True)
262+
env = Environment(ms, controller, 500, 600, progress_bar=False)
263263
set_log_level_warning()
264264
env.run()
265265
filename = 'test_scan_time_default.mzML'
@@ -285,7 +285,7 @@ def test_scan_time_from_mzml(self):
285285
ms = IndependentMassSpectrometer(ionisation_mode, chems, scan_duration=sd)
286286

287287
# run simulation
288-
env = Environment(ms, controller, 500, 600, progress_bar=True)
288+
env = Environment(ms, controller, 500, 600, progress_bar=False)
289289
set_log_level_warning()
290290
env.run()
291291
filename = 'test_scan_time_from_mzml.mzML'
@@ -311,7 +311,7 @@ def test_mean_scan_time_from_mzml(self):
311311
ms = IndependentMassSpectrometer(ionisation_mode, chems, scan_duration=sd)
312312

313313
# run simulation
314-
env = Environment(ms, controller, 500, 600, progress_bar=True)
314+
env = Environment(ms, controller, 500, 600, progress_bar=False)
315315
set_log_level_warning()
316316
env.run()
317317
filename = 'test_scan_time_mean_from_mzml.mzML'

tests/test_controllers_TopN.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_neg(self, even_chems):
2323
mass_spec = IndependentMassSpectrometer(NEGATIVE, even_chems)
2424
N = 10
2525
controller = TopNController(NEGATIVE, N, 0.7, 10, 15, 0, force_N=True)
26-
env = Environment(mass_spec, controller, 200, 300, progress_bar=True)
26+
env = Environment(mass_spec, controller, 200, 300, progress_bar=False)
2727
run_environment(env)
2828

2929
for level in controller.scans:
@@ -55,7 +55,7 @@ def test_TopN_forceN(self, ten_chems):
5555
mass_spec = IndependentMassSpectrometer(POSITIVE, ten_chems)
5656
N = 20
5757
controller = TopNController(POSITIVE, N, 0.7, 10, 15, 0, force_N=True)
58-
env = Environment(mass_spec, controller, 200, 300, progress_bar=True)
58+
env = Environment(mass_spec, controller, 200, 300, progress_bar=False)
5959
run_environment(env)
6060

6161
all_scans = controller.scans[1] + controller.scans[2]
@@ -93,7 +93,7 @@ def test_TopN_controller_with_simulated_chems(self, fragscan_dataset):
9393
min_bound, max_bound = get_rt_bounds(fragscan_dataset, CENTRE_RANGE)
9494

9595
# create an environment to run both the mass spec and controller
96-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
96+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
9797
run_environment(env)
9898

9999
# check that there is at least one non-empty MS2 scan
@@ -123,7 +123,7 @@ def test_TopN_controller_with_simulated_chems_and_noise(self, fragscan_dataset):
123123
min_bound, max_bound = get_rt_bounds(fragscan_dataset, CENTRE_RANGE)
124124

125125
# create an environment to run both the mass spec and controller
126-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
126+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
127127
run_environment(env)
128128

129129
# check that there is at least one non-empty MS2 scan
@@ -148,7 +148,7 @@ def test_TopN_controller_with_beer_chems(self):
148148
MIN_MS1_INTENSITY)
149149

150150
# create an environment to run both the mass spec and controller
151-
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=True)
151+
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=False)
152152
run_environment(env)
153153

154154
# check that there is at least one non-empty MS2 scan
@@ -179,7 +179,7 @@ def test_TopN_controller_with_beer_chems_and_scan_duration_dict(self):
179179
MIN_MS1_INTENSITY)
180180

181181
# create an environment to run both the mass spec and controller
182-
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=True)
182+
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=False)
183183
run_environment(env)
184184

185185
# check that there is at least one non-empty MS2 scan
@@ -225,7 +225,7 @@ def test_TopN_controller_advanced_params(self):
225225
MIN_MS1_INTENSITY, advanced_params=params)
226226

227227
# create an environment to run both the mass spec and controller
228-
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=True)
228+
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=False)
229229
run_environment(env)
230230

231231
# check that some of the scan parameters returned are actually what we set
@@ -279,7 +279,7 @@ def test_TopN_controller_with_simulated_chems(self, fragscan_dataset):
279279
min_bound, max_bound = get_rt_bounds(fragscan_dataset, CENTRE_RANGE)
280280

281281
# create an environment to run both the mass spec and controller
282-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
282+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
283283
run_environment(env)
284284

285285
# check that there is at least one non-empty MS2 scan
@@ -307,7 +307,7 @@ def test_positive_fixed(self):
307307
ms = IndependentMassSpectrometer(POSITIVE, dataset)
308308
controller = TopNController(POSITIVE, N, isolation_width, mz_tol, rt_tol,
309309
MIN_MS1_INTENSITY)
310-
env = Environment(ms, controller, 102, 110, progress_bar=True)
310+
env = Environment(ms, controller, 102, 110, progress_bar=False)
311311
set_log_level_warning()
312312
env.run()
313313
ms1_mz_vals = [int(m) for m in controller.scans[1][0].mzs]
@@ -338,7 +338,7 @@ def test_negative_fixed(self):
338338
ms = IndependentMassSpectrometer(NEGATIVE, dataset)
339339
controller = TopNController(NEGATIVE, N, isolation_width, mz_tol, rt_tol,
340340
MIN_MS1_INTENSITY)
341-
env = Environment(ms, controller, 102, 110, progress_bar=True)
341+
env = Environment(ms, controller, 102, 110, progress_bar=False)
342342
set_log_level_warning()
343343
env.run()
344344
ms1_mz_vals = [int(m) for m in controller.scans[1][0].mzs]
@@ -372,7 +372,7 @@ def test_multiple_adducts(self):
372372
# some adducts might not be sampled if the probability is less than 0.2
373373
controller = SimpleMs1Controller()
374374
ms = IndependentMassSpectrometer(POSITIVE, dataset)
375-
env = Environment(ms, controller, 102, 110, progress_bar=True)
375+
env = Environment(ms, controller, 102, 110, progress_bar=False)
376376
set_log_level_warning()
377377
env.run()
378378
for scan in controller.scans[1]:
@@ -397,7 +397,7 @@ def test_TopN_controller_with_beer_chems_and_initial_exclusion_list(self):
397397
MIN_MS1_INTENSITY,
398398
initial_exclusion_list=initial_exclusion_list)
399399
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND,
400-
progress_bar=True)
400+
progress_bar=False)
401401
run_environment(env)
402402

403403
mz_intervals = list(controller.exclusion.exclusion_list.boxes_mz.items())
@@ -438,7 +438,7 @@ def test_exclusion_simple_data(self):
438438
controller = TopNController(ionisation_mode, N, isolation_width, mz_tol, rt_tol,
439439
min_ms1_intensity,
440440
initial_exclusion_list=initial_exclusion_list)
441-
env = Environment(mass_spec, controller, 0, 20, progress_bar=True)
441+
env = Environment(mass_spec, controller, 0, 20, progress_bar=False)
442442
run_environment(env)
443443

444444
mz_intervals = list(controller.exclusion.exclusion_list.boxes_mz.items())
@@ -480,7 +480,7 @@ def test_TopN_controller_with_beer_chems(self):
480480

481481
# create an environment to run both the mass spec and controller
482482
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND,
483-
progress_bar=True)
483+
progress_bar=False)
484484
run_environment(env)
485485

486486
# check that there is at least one non-empty MS2 scan
@@ -517,7 +517,7 @@ def test_WeightedDEW_controller_with_beer_chems(self):
517517

518518
# create an environment to run both the mass spec and controller
519519
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND,
520-
progress_bar=True)
520+
progress_bar=False)
521521
run_environment(env)
522522

523523
# check that there is at least one non-empty MS2 scan

tests/test_controllers_agent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def test_TopNDEW_agent(self):
2828
controller = AgentBasedController(agent)
2929
spike_noise = UniformSpikeNoise(0.1, 1000)
3030
mass_spec = IndependentMassSpectrometer(ionisation_mode, d, spike_noise=spike_noise)
31-
env = Environment(mass_spec, controller, 0, 100, progress_bar=True)
31+
env = Environment(mass_spec, controller, 0, 100, progress_bar=False)
3232
set_log_level_warning()
3333
env.run()
3434

@@ -38,7 +38,7 @@ def test_TopNDEW_agent(self):
3838

3939
controller = AgentBasedController(agent)
4040
mass_spec = IndependentMassSpectrometer(ionisation_mode, d, spike_noise=spike_noise)
41-
env = Environment(mass_spec, controller, 0, 100, progress_bar=True)
41+
env = Environment(mass_spec, controller, 0, 100, progress_bar=False)
4242
set_log_level_warning()
4343
env.run()
4444

@@ -48,7 +48,7 @@ def test_TopNDEW_agent(self):
4848

4949
controller = AgentBasedController(agent)
5050
mass_spec = IndependentMassSpectrometer(ionisation_mode, d, spike_noise=spike_noise)
51-
env = Environment(mass_spec, controller, 0, 100, progress_bar=True)
51+
env = Environment(mass_spec, controller, 0, 100, progress_bar=False)
5252
set_log_level_warning()
5353
env.run()
5454

tests/test_controllers_dia.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_AIF_controller_with_simulated_chems(self, fragscan_dataset):
5353

5454
# create an environment to run both the mass spec and controller
5555
min_bound, max_bound = get_rt_bounds(fragscan_dataset, CENTRE_RANGE)
56-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
56+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
5757

5858
# set the log level to WARNING so we don't see too many messages when
5959
# environment is running
@@ -83,7 +83,7 @@ def test_AIF_controller_with_simulated_chems(self, fragscan_dataset):
8383

8484
# create an environment to run both the mass spec and controller
8585
min_bound, max_bound = get_rt_bounds(fragscan_dataset, CENTRE_RANGE)
86-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
86+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
8787

8888
# set the log level to WARNING so we don't see too many messages
8989
# when environment is running
@@ -123,7 +123,7 @@ def test_AIF_controller_with_beer_chems(self):
123123

124124
# create an environment to run both the mass spec and controller
125125
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND,
126-
progress_bar=True)
126+
progress_bar=False)
127127

128128
# set the log level to WARNING so we don't see too many messages
129129
# when environment is running
@@ -172,7 +172,7 @@ def test_aif_with_fixed_chems(self):
172172
controller = AIF(ms1_source_cid_energy)
173173
ionisation_mode = POSITIVE
174174
mass_spec = IndependentMassSpectrometer(ionisation_mode, d)
175-
env = Environment(mass_spec, controller, 10, 20, progress_bar=True)
175+
env = Environment(mass_spec, controller, 10, 20, progress_bar=False)
176176

177177
set_log_level_warning()
178178
env.run()
@@ -208,7 +208,7 @@ def test_swath(self, ten_chems):
208208
spike_noise=spike_noise,
209209
scan_duration=scan_time_dict)
210210

211-
env = Environment(mass_spec, controller, 200, 300, progress_bar=True)
211+
env = Environment(mass_spec, controller, 200, 300, progress_bar=False)
212212

213213
set_log_level_warning()
214214

@@ -235,7 +235,7 @@ def test_swath_more(self, even_chems):
235235
scan_time_dict = {1: 0.124, 2: 0.124}
236236
mass_spec = IndependentMassSpectrometer(ionisation_mode, even_chems,
237237
scan_duration=scan_time_dict)
238-
env = Environment(mass_spec, controller, 200, 300, progress_bar=True)
238+
env = Environment(mass_spec, controller, 200, 300, progress_bar=False)
239239
set_log_level_warning()
240240
env.run()
241241

@@ -249,7 +249,7 @@ def test_swath_more(self, even_chems):
249249
scan_time_dict = {1: 0.124, 2: 0.124}
250250
mass_spec = IndependentMassSpectrometer(ionisation_mode, even_chems,
251251
scan_duration=scan_time_dict)
252-
env = Environment(mass_spec, controller2, 200, 300, progress_bar=True)
252+
env = Environment(mass_spec, controller2, 200, 300, progress_bar=False)
253253
env.run()
254254

255255
ms2_scans2 = controller2.scans[2]
@@ -262,7 +262,7 @@ def test_swath_more(self, even_chems):
262262
scan_time_dict = {1: 0.124, 2: 0.124}
263263
mass_spec = IndependentMassSpectrometer(ionisation_mode, even_chems,
264264
scan_duration=scan_time_dict)
265-
env = Environment(mass_spec, controller3, 200, 300, progress_bar=True)
265+
env = Environment(mass_spec, controller3, 200, 300, progress_bar=False)
266266
env.run()
267267

268268
ms2_scans3 = controller3.scans[2]
@@ -315,7 +315,7 @@ def test_swath_msdial_experiment_file(self):
315315
# scan_duration=scan_time_dict)
316316
# controller = DiaController(min_mz, max_mz, window_type, kaufmann_design, num_windows,
317317
# scan_overlap=scan_overlap)
318-
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=True)
318+
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=False)
319319
# set_log_level_warning()
320320
# env.run()
321321
#
@@ -346,7 +346,7 @@ def test_swath_msdial_experiment_file(self):
346346
# scan_duration=scan_time_dict)
347347
# controller = DiaController(min_mz, max_mz, window_type, kaufmann_design, num_windows,
348348
# scan_overlap=scan_overlap)
349-
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=True)
349+
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=False)
350350
# set_log_level_warning()
351351
# env.run()
352352
#
@@ -377,7 +377,7 @@ def test_swath_msdial_experiment_file(self):
377377
# scan_duration=scan_time_dict)
378378
# controller = DiaController(min_mz, max_mz, window_type, kaufmann_design, num_windows,
379379
# scan_overlap=scan_overlap)
380-
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=True)
380+
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=False)
381381
# set_log_level_warning()
382382
# env.run()
383383
#
@@ -408,7 +408,7 @@ def test_swath_msdial_experiment_file(self):
408408
# scan_duration=scan_time_dict)
409409
# controller = DiaController(min_mz, max_mz, window_type, kaufmann_design, num_windows,
410410
# scan_overlap=scan_overlap)
411-
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=True)
411+
# env = Environment(mass_spec, controller, min_rt, max_rt, progress_bar=False)
412412
# set_log_level_warning()
413413
# env.run()
414414
#

tests/test_controllers_fullscan.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def test_ms1_controller_with_simulated_chems(self, fragscan_dataset):
2525
controller = SimpleMs1Controller()
2626

2727
# create an environment to run both the mass spec and controller
28-
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=True)
28+
env = Environment(mass_spec, controller, min_bound, max_bound, progress_bar=False)
2929
run_environment(env)
3030

3131
# write simulated output to mzML file
@@ -40,7 +40,7 @@ def test_ms1_controller_with_qcbeer_chems(self):
4040
controller = SimpleMs1Controller()
4141

4242
# create an environment to run both the mass spec and controller
43-
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=True)
43+
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=False)
4444
run_environment(env)
4545

4646
# write simulated output to mzML file
@@ -61,7 +61,7 @@ def test_peaks_in_range(self):
6161
controller = SimpleMs1Controller(advanced_params=params)
6262

6363
# create an environment to run both the mass spec and controller
64-
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=True)
64+
env = Environment(mass_spec, controller, BEER_MIN_BOUND, BEER_MAX_BOUND, progress_bar=False)
6565
run_environment(env)
6666

6767
# write simulated output to mzML file

tests/test_controllers_misc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def test_FixedScansController(self, two_fixed_chems):
112112
# # ionisation_mode = POSITIVE
113113
# controller = MultiIsolationController(N)
114114
# ms = IndependentMassSpectrometer(POSITIVE, d)
115-
# env = Environment(ms, controller, 10, 20, progress_bar=True)
115+
# env = Environment(ms, controller, 10, 20, progress_bar=False)
116116
# set_log_level_warning()
117117
# env.run()
118118
#

0 commit comments

Comments
 (0)