|
1 | | -import logging |
2 | 1 | from one.api import ONE |
3 | 2 | import datetime |
4 | 3 | import re |
5 | 4 | import numpy as np |
6 | 5 | from iblutil.util import Bunch |
7 | 6 | import brainbox.behavior.pyschofit as psy |
8 | | - |
9 | | -logger = logging.getLogger('ibllib') |
| 7 | +import logging |
| 8 | +_logger = logging.getLogger('ibllib') |
10 | 9 |
|
11 | 10 |
|
12 | 11 | def get_lab_training_status(lab, date=None, details=True, one=None): |
@@ -110,7 +109,7 @@ def get_sessions(subj, date=None, one=None): |
110 | 109 |
|
111 | 110 | # If still 0 sessions then return with warning |
112 | 111 | if len(sessions) == 0: |
113 | | - logger.warning(f"No training sessions detected for {subj}") |
| 112 | + _logger.warning(f"No training sessions detected for {subj}") |
114 | 113 | return [None] * 4 |
115 | 114 |
|
116 | 115 | trials = Bunch() |
@@ -274,30 +273,30 @@ def display_status(subj, sess_dates, status, perf_easy=None, n_trials=None, psyc |
274 | 273 | """ |
275 | 274 |
|
276 | 275 | if perf_easy is None: |
277 | | - logger.info(f"\n{subj} : {status} \nSession dates=[{sess_dates[0]}, {sess_dates[1]}, " |
278 | | - f"{sess_dates[2]}]") |
| 276 | + print(f"\n{subj} : {status} \nSession dates=[{sess_dates[0]}, {sess_dates[1]}, " |
| 277 | + f"{sess_dates[2]}]") |
279 | 278 | elif psych_20 is None: |
280 | | - logger.info(f"\n{subj} : {status} \nSession dates={[x for x in sess_dates]}, " |
281 | | - f"Perf easy={[np.around(pe,2) for pe in perf_easy]}, " |
282 | | - f"N trials={[nt for nt in n_trials]} " |
283 | | - f"\nPsych fit over last 3 sessions: " |
284 | | - f"bias={np.around(psych[0],2)}, thres={np.around(psych[1],2)}, " |
285 | | - f"lapse_low={np.around(psych[2],2)}, lapse_high={np.around(psych[3],2)} " |
286 | | - f"\nMedian reaction time at 0 contrast over last 3 sessions = " |
287 | | - f"{np.around(rt,2)}") |
| 279 | + print(f"\n{subj} : {status} \nSession dates={[x for x in sess_dates]}, " |
| 280 | + f"Perf easy={[np.around(pe,2) for pe in perf_easy]}, " |
| 281 | + f"N trials={[nt for nt in n_trials]} " |
| 282 | + f"\nPsych fit over last 3 sessions: " |
| 283 | + f"bias={np.around(psych[0],2)}, thres={np.around(psych[1],2)}, " |
| 284 | + f"lapse_low={np.around(psych[2],2)}, lapse_high={np.around(psych[3],2)} " |
| 285 | + f"\nMedian reaction time at 0 contrast over last 3 sessions = " |
| 286 | + f"{np.around(rt,2)}") |
288 | 287 |
|
289 | 288 | else: |
290 | | - logger.info(f"\n{subj} : {status} \nSession dates={[x for x in sess_dates]}, " |
291 | | - f"Perf easy={[np.around(pe,2) for pe in perf_easy]}, " |
292 | | - f"N trials={[nt for nt in n_trials]} " |
293 | | - f"\nPsych fit over last 3 sessions (20): " |
294 | | - f"bias={np.around(psych_20[0],2)}, thres={np.around(psych_20[1],2)}, " |
295 | | - f"lapse_low={np.around(psych_20[2],2)}, lapse_high={np.around(psych_20[3],2)} " |
296 | | - f"\nPsych fit over last 3 sessions (80): bias={np.around(psych_80[0],2)}, " |
297 | | - f"thres={np.around(psych_80[1],2)}, lapse_low={np.around(psych_80[2],2)}, " |
298 | | - f"lapse_high={np.around(psych_80[3],2)} " |
299 | | - f"\nMedian reaction time at 0 contrast over last 3 sessions = " |
300 | | - f"{np.around(rt, 2)}") |
| 289 | + print(f"\n{subj} : {status} \nSession dates={[x for x in sess_dates]}, " |
| 290 | + f"Perf easy={[np.around(pe,2) for pe in perf_easy]}, " |
| 291 | + f"N trials={[nt for nt in n_trials]} " |
| 292 | + f"\nPsych fit over last 3 sessions (20): " |
| 293 | + f"bias={np.around(psych_20[0],2)}, thres={np.around(psych_20[1],2)}, " |
| 294 | + f"lapse_low={np.around(psych_20[2],2)}, lapse_high={np.around(psych_20[3],2)} " |
| 295 | + f"\nPsych fit over last 3 sessions (80): bias={np.around(psych_80[0],2)}, " |
| 296 | + f"thres={np.around(psych_80[1],2)}, lapse_low={np.around(psych_80[2],2)}, " |
| 297 | + f"lapse_high={np.around(psych_80[3],2)} " |
| 298 | + f"\nMedian reaction time at 0 contrast over last 3 sessions = " |
| 299 | + f"{np.around(rt, 2)}") |
301 | 300 |
|
302 | 301 |
|
303 | 302 | def concatenate_trials(trials): |
|
0 commit comments