def analyze_trial(trial_spec, session_metrics_list): '''Analyze trial and save data, then return metrics''' info_prepath = trial_spec['meta']['info_prepath'] # calculate metrics trial_metrics = calc_trial_metrics(session_metrics_list, info_prepath) # plot graphs viz.plot_trial(trial_spec, trial_metrics) # zip files if util.get_lab_mode() == 'train': predir, _, _, _, _, _ = util.prepath_split(info_prepath) shutil.make_archive(predir, 'zip', predir) logger.info(f'All trial data zipped to {predir}.zip') return trial_metrics
def analyze_trial(trial_spec, session_metrics_list): '''Analyze trial and save data, then return metrics''' info_prepath = trial_spec['meta']['info_prepath'] # calculate metrics trial_metrics = calc_trial_metrics(session_metrics_list, info_prepath) # plot graphs viz.plot_trial(trial_spec, trial_metrics) viz.plot_trial(trial_spec, trial_metrics, ma=True) # manually shut down orca server to avoid zombie processes viz.pio.orca.shutdown_server() # zip files if util.get_lab_mode() == 'train': predir, _, _, _, _, _ = util.prepath_split(info_prepath) zipdir = util.smart_path(predir) shutil.make_archive(zipdir, 'zip', zipdir) logger.info(f'All trial data zipped to {predir}.zip') return trial_metrics