from glob import glob import os from os import path import itertools as it fname_merged = '../data/VRCliff_AllData.h5' def task_merge_sessions(): loadpath = '/home/nickdg/labshare/Projects/VRExperiments_Round2/Data/motion_tracking/processed' fnames = glob(loadpath + '/VRWall*/*.h5', recursive=True) print(len(fnames)) return { 'actions': ['python merge_data.py'], 'file_dep': [sorted(fnames)[0]], 'targets': [fname_merged], 'verbosity': 2, } # fname_clean = '../data/VRCliff_AllData_cleaned.h5' # def task_process_cliffdata(): # return { # 'actions': ['python cleaning.py'], # 'file_dep': [fname_merged], # 'targets': [fname_clean], # 'verbosity': 0, # } # Write the notebook filenames in the order you want them to be run. notebooks = [ 'Merge Data and Label Phases.ipynb', 'Calculate and Transform Data.ipynb', 'Crossings Deflections Analysis By Distance2.ipynb', 'Movement Direction Analysis2.ipynb', ] def task_update_and_export_notebooks(): for basename in notebooks: notebook = '../notebooks/{}'.format(basename) yield { 'actions': ['jupyter nbconvert --config=/home/nickdg/.ipython/profile_default/ipython_nbconvert_config.py --execute "%(dependencies)s" '], 'file_dep': [notebook], 'name': 'run_notebook: {}'.format(path.basename(notebook)), # 'verbosity': 2, } for output in ['html', 'latex']: pdf_dirname = path.join(path.dirname(notebook), output) if not path.exists(pdf_dirname): os.mkdir(pdf_dirname) yield { 'actions': ['jupyter nbconvert "%(dependencies)s" --to {} --output-dir "{}"'.format(output, path.abspath(pdf_dirname))], 'file_dep': [path.abspath(notebook)], 'targets': [path.join(pdf_dirname, path.splitext(path.basename(notebook))[0] + '.' + output)], 'name': 'convert_to_{}: {}'.format(output, path.basename(notebook)), 'verbosity': 2 }