|
11 | 11 | import string |
12 | 12 | import sys |
13 | 13 |
|
14 | | -import cycler |
15 | 14 | import matplotlib |
16 | 15 | import matplotlib.pyplot as plt |
17 | 16 | import numpy as np |
|
28 | 27 | from pcpostprocess.leak_correct import fit_linear_leak, get_leak_corrected |
29 | 28 | from pcpostprocess.subtraction_plots import do_subtraction_plot |
30 | 29 |
|
31 | | -# TODO: Remove this |
32 | | -color_cycle = ["#5790fc", "#f89c20", "#e42536", "#964a8b", "#9c9ca1", "#7a21dd"] |
33 | | -plt.rcParams['axes.prop_cycle'] = cycler.cycler('color', color_cycle) |
34 | | - |
35 | | -# TODO: Not sure we need to explicitly set this! |
36 | | -matplotlib.use('Agg') |
37 | | - |
38 | 30 |
|
39 | 31 | def run_from_command_line(): |
40 | 32 | """ |
41 | | - Reads arguments from the command line and runs herg QC. |
| 33 | + Reads arguments from the command line and an ``export_config.py`` and then |
| 34 | + runs herg QC. |
42 | 35 | """ |
43 | 36 |
|
44 | 37 | parser = argparse.ArgumentParser() |
@@ -109,11 +102,7 @@ def run(data_path, output_path, qc_map, wells=None, |
109 | 102 | write_traces=False, write_failed_traces=False, write_map={}, |
110 | 103 | reversal_potential=-90, reversal_spread_threshold=10, |
111 | 104 | max_processes=1, figure_size=None, |
112 | | - debug=False, |
113 | | - |
114 | | - save_id=None, |
115 | | - |
116 | | - ): |
| 105 | + debug=False, save_id=None): |
117 | 106 | """ |
118 | 107 | Imports traces and runs QC. |
119 | 108 |
|
@@ -148,6 +137,9 @@ def run(data_path, output_path, qc_map, wells=None, |
148 | 137 | # TODO Remove protocol selection here: this is done via the export file! |
149 | 138 | # Only protocols listed there are accepted |
150 | 139 |
|
| 140 | + # TODO: Find some way around setting this? |
| 141 | + matplotlib.use('Agg') |
| 142 | + |
151 | 143 | # Select wells to use |
152 | 144 | all_wells = [row + str(i).zfill(2) for row in string.ascii_uppercase[:16] |
153 | 145 | for i in range(1, 25)] |
@@ -503,8 +495,6 @@ def agg_func(x): |
503 | 495 | qc_df['protocol'] = ['staircaseramp1_2' if p == 'staircaseramp2' else p |
504 | 496 | for p in qc_df.protocol] |
505 | 497 |
|
506 | | - print(qc_df.protocol.unique()) |
507 | | - |
508 | 498 | fails_dict = {} |
509 | 499 | no_wells = 384 |
510 | 500 |
|
@@ -1255,7 +1245,7 @@ def fit_func(x, args=None): |
1255 | 1245 | ] |
1256 | 1246 |
|
1257 | 1247 | # TESTING ONLY |
1258 | | - np.random.seed(1) |
| 1248 | + # np.random.seed(1) |
1259 | 1249 |
|
1260 | 1250 | # Repeat optimisation with different starting guesses |
1261 | 1251 | x0s = [[np.random.uniform(lower_b, upper_b) for lower_b, upper_b in bounds] for i in range(100)] |
|
0 commit comments