(spec, assert_not_exists=False)
return taskname2outfile
Generate dataset filenames for each task. Phase 0 (sampling) writes to these files,
    phase 1 (training) reads from them.
Generate dataset filenames for each task. Phase 0 (sampling) writes to these files,
    phase 1 (training) reads from them.
Generate dataset filenames for each task . Phase 0 ( sampling ) writes to these files phase 1 ( training ) reads from them .
def gen_taskname2outfile(spec, assert_not_exists=False):
    '''
    Generate dataset filenames for each task. Phase 0 (sampling) writes to these files,
    phase 1 (training) reads from them.
    '''
    taskname2outfile = {}
    trajdir = os.path.join(spec['options']['storagedir'], spec['options']['traj_subdir'])
    util.mkdir_p(trajdir)
    for task in spec['tasks']:
        assert task['name'] not in taskname2outfile
        fname = os.path.join(trajdir, 'trajs_{}.h5'.format(task['name']))
        if assert_not_exists:
            assert not os.path.exists(fname), 'Traj destination {} already exists'.format(fname)
        taskname2outfile[task['name']] = fname
    return taskname2outfile
def gen_taskname2outfile ( spec , assert_not_exists = False ) : taskname2outfile = { } trajdir = os . path . join ( spec [ 'options' ] [ 'storagedir' ] , spec [ 'options' ] [ 'traj_subdir' ] ) util . mkdir_p ( trajdir ) for task in spec [ 'tasks' ] : assert task [ 'name' ] not in taskname2outfile fname = os . path . join ( trajdir , 'trajs_{}.h5' . format ( task [ 'name' ] ) ) if assert_not_exists : assert not os . path . exists ( fname ) , 'Traj destination {} already exists' . format ( fname ) taskname2outfile [ task [ 'name' ] ] = fname return taskname2outfile