import imp import os import numpy as np from pyrl import utils from pyrl.figtools import Figure #========================================================================================= # Files #========================================================================================= here = utils.get_here(__file__) parent = utils.get_parent(here) # Paths scratchpath = os.environ.get('SCRATCH') if scratchpath is None: scratchpath = os.path.join(os.environ['HOME'], 'scratch') trialspath = os.path.join(scratchpath, 'work', 'pyrl', 'examples') analysispath = os.path.join(parent, 'examples', 'analysis') modelspath = os.path.join(parent, 'examples', 'models') # analysis/rdm rdm_analysisfile = os.path.join(analysispath, 'rdm.py') rdm_analysis = imp.load_source('rdm_analysis', rdm_analysisfile) # models/rdm_fixed rdm_fixed_modelfile = os.path.join(modelspath, 'rdm_fixed.py') rdm_fixed_model = imp.load_source('rdm_fixed_model', rdm_fixed_modelfile) rdm_fixed_behavior = os.path.join(trialspath, 'rdm_fixed',
p = argparse.ArgumentParser() p.add_argument('--simulate', action='store_true', default=False) p.add_argument('--gpu', dest='gpu', action='store_true', default=False) p.add_argument('args', nargs='*') a = p.parse_args() simulate = a.simulate args = a.args gpu = a.gpu #========================================================================================= # Shared steps #========================================================================================= here = utils.get_here(__file__) parent = utils.get_parent(here) dopath = join(parent, 'examples') modelspath = join(parent, 'examples', 'models') analysispath = join(parent, 'examples', 'analysis') paperpath = join(parent, 'paper') timespath = join(paperpath, 'times') paperdatapath = join(paperpath, 'work', 'data') paperfigspath = join(paperpath, 'work', 'figs') # Make paths for path in [timespath, paperdatapath, paperfigspath]: utils.mkdir_p(path) def call(s): if simulate: