Example #1
0
def rcts_cnf_fs(rct_infos, thy_dct, es_keyword_dct, run_prefix, save_prefix):
    """ set reactant filesystem stuff
    """

    ini_method_dct = thy_dct.get(es_keyword_dct['inplvl'])
    ini_thy_info = tinfo.from_dct(ini_method_dct)

    rct_cnf_fs = ()

    for rct_info in rct_infos:

        mod_ini_thy_info = tinfo.modify_orb_label(ini_thy_info, rct_info)

        # Build filesys for ini thy info
        ini_cnf_run_fs, ini_cnf_save_fs = build_fs(
            run_prefix,
            save_prefix,
            'CONFORMER',
            spc_locs=rct_info,
            thy_locs=mod_ini_thy_info[1:])

        ini_loc_info = min_energy_conformer_locators(ini_cnf_save_fs,
                                                     mod_ini_thy_info)
        ini_min_cnf_locs, ini_min_cnf_path = ini_loc_info

        # Create run fs if that directory has been deleted to run the jobs
        ini_cnf_run_fs[-1].create(ini_min_cnf_locs)

        rct_cnf_fs += ((ini_cnf_run_fs, ini_cnf_save_fs, ini_min_cnf_locs,
                        ini_min_cnf_path), )

    return rct_cnf_fs
Example #2
0
def instability_transformation(spc_dct,
                               spc_name,
                               thy_info,
                               save_prefix,
                               zma_locs=(0, )):
    """ see if a species and unstable and handle task management
    """

    spc_info = sinfo.from_dct(spc_dct[spc_name])
    mod_thy_info = tinfo.modify_orb_label(thy_info, spc_info)

    _, cnf_save_fs = build_fs('',
                              save_prefix,
                              'CONFORMER',
                              spc_locs=spc_info,
                              thy_locs=mod_thy_info[1:])

    # Check if any locs exist first?
    ini_loc_info = min_energy_conformer_locators(cnf_save_fs, mod_thy_info)
    _, min_cnf_path = ini_loc_info

    zma_save_fs = autofile.fs.zmatrix(min_cnf_path)

    # Check if the instability files exist
    if zma_save_fs[-1].file.instability.exists(zma_locs):
        instab_trans = zma_save_fs[-1].file.instability.read(zma_locs)
        zma = zma_save_fs[-1].file.zmatrix.read(zma_locs)
        _instab = (instab_trans, zma)
        path = zma_save_fs[-1].file.zmatrix.path(zma_locs)
    else:
        _instab = None
        path = None

    return _instab, path
Example #3
0
def reactions(rxn_info, ini_thy_info, zma_locs, save_prefix):
    """ Check if reaction exists in the filesystem and has been identified
    """

    zrxns, zmas = (), ()

    sort_rxn_info = rinfo.sort(rxn_info, scheme='autofile')
    ts_info = rinfo.ts_info(rxn_info)
    mod_ini_thy_info = tinfo.modify_orb_label(ini_thy_info, ts_info)

    rxn_fs = autofile.fs.reaction(save_prefix)
    if rxn_fs[-1].exists(sort_rxn_info):
        _, ts_save_fs = build_fs(save_prefix,
                                 save_prefix,
                                 'TRANSITION STATE',
                                 rxn_locs=sort_rxn_info,
                                 thy_locs=mod_ini_thy_info[1:])
        for ts_locs in ts_save_fs[-1].existing():
            zrxn, zma = reaction(rxn_info,
                                 ini_thy_info,
                                 zma_locs,
                                 save_prefix,
                                 ts_locs=ts_locs)
            if zrxn is not None:
                zrxns += (zrxn, )
                zmas += (zma, )

    if not zrxns:
        zrxns, zmas = None, None

    return zrxns, zmas
Example #4
0
def reaction(rxn_info,
             ini_thy_info,
             zma_locs,
             save_prefix,
             ts_locs=(0, ),
             hbond_cutoffs=None):
    """ Check if reaction exists in the filesystem and has been identified
    """

    zrxn, zma = None, None

    sort_rxn_info = rinfo.sort(rxn_info, scheme='autofile')
    ts_info = rinfo.ts_info(rxn_info)
    mod_ini_thy_info = tinfo.modify_orb_label(ini_thy_info, ts_info)

    rxn_fs = autofile.fs.reaction(save_prefix)
    if rxn_fs[-1].exists(sort_rxn_info):
        _, cnf_save_fs = build_fs(save_prefix,
                                  save_prefix,
                                  'CONFORMER',
                                  rxn_locs=sort_rxn_info,
                                  thy_locs=mod_ini_thy_info[1:],
                                  ts_locs=ts_locs)

        _, ini_min_cnf_path = min_energy_conformer_locators(
            cnf_save_fs, mod_ini_thy_info, hbond_cutoffs=hbond_cutoffs)
        if ini_min_cnf_path:
            zma_fs = autofile.fs.zmatrix(ini_min_cnf_path)
            if zma_fs[-1].file.reaction.exists(zma_locs):
                zrxn = zma_fs[-1].file.reaction.read(zma_locs)
                zma = zma_fs[-1].file.zmatrix.read(zma_locs)

        # For barrierless reactions with no conformer
        if zrxn is None:
            _, zma_fs = build_fs(save_prefix,
                                 save_prefix,
                                 'ZMATRIX',
                                 rxn_locs=sort_rxn_info,
                                 ts_locs=ts_locs,
                                 thy_locs=mod_ini_thy_info[1:])

            if zma_fs[-1].file.reaction.exists(zma_locs):
                zrxn = zma_fs[-1].file.reaction.read(zma_locs)
                zma = zma_fs[-1].file.zmatrix.read(zma_locs)

    return zrxn, zma
Example #5
0
def set_model_filesys(spc_dct_i,
                      level,
                      run_prefix,
                      save_prefix,
                      saddle,
                      name=None,
                      cnf_range='min',
                      spc_locs=None,
                      nprocs=1):
    """ Gets filesystem objects for reading many calculations
    """

    # Set the spc_info
    if saddle:
        rxn_info = spc_dct_i['rxn_info']
        spc_info = rinfo.ts_info(rxn_info)
    else:
        spc_info = sinfo.from_dct(spc_dct_i)

    levelp = tinfo.modify_orb_label(level, spc_info)

    _root = root_locs(spc_dct_i, saddle=saddle, name=name)
    cnf_run_fs, cnf_save_fs = build_fs(run_prefix,
                                       save_prefix,
                                       'CONFORMER',
                                       thy_locs=levelp[1:],
                                       **_root)

    hbond_cutoffs = spc_dct_i['hbond_cutoffs']
    if cnf_range == 'specified':
        min_rngs_locs = spc_locs
        min_rngs_path = cnf_save_fs[-1].path(min_rngs_locs)
        cnf_run_fs[-1].create(min_rngs_locs)
    elif cnf_range == 'min':
        min_rngs_locs, min_rngs_path = min_energy_conformer_locators(
            cnf_save_fs, levelp, hbond_cutoffs=hbond_cutoffs)
        cnf_run_fs[-1].create(min_rngs_locs)
    else:
        min_rngs_locs_lst, min_rngs_path_lst = conformer_locators(
            cnf_save_fs,
            levelp,
            cnf_range=cnf_range,
            hbond_cutoffs=hbond_cutoffs,
            nprocs=nprocs)
        for min_locs in min_rngs_locs_lst:
            cnf_run_fs[-1].create(min_locs)
        min_rngs_locs = min_rngs_locs_lst[0]
        min_rngs_path = min_rngs_path_lst[0]
        ioprinter.warning_message('Only returning first location in this list')
    # Create run fs if that directory has been deleted to run the jobs

    return [cnf_save_fs, min_rngs_path, min_rngs_locs, '', cnf_run_fs]
Example #6
0
def set_model_filesys(spc_dct_i,
                      level,
                      run_prefix,
                      save_prefix,
                      saddle,
                      name=None,
                      rings='all'):
    """ Gets filesystem objects for reading many calculations
    """

    # Set the spc_info
    if saddle:
        rxn_info = spc_dct_i['rxn_info']
        spc_info = rinfo.ts_info(rxn_info)
    else:
        spc_info = sinfo.from_dct(spc_dct_i)

    levelp = tinfo.modify_orb_label(level, spc_info)

    _root = root_locs(spc_dct_i, saddle=saddle, name=name)
    cnf_run_fs, cnf_save_fs = build_fs(run_prefix,
                                       save_prefix,
                                       'CONFORMER',
                                       thy_locs=levelp[1:],
                                       **_root)

    if rings == 'min':
        min_rngs_locs, min_rngs_path = min_energy_conformer_locators(
            cnf_save_fs, levelp)
        cnf_run_fs[-1].create(min_rngs_locs)
    else:
        min_rngs_locs, min_rngs_path = conformer_locators(cnf_save_fs,
                                                          levelp,
                                                          cnf_range='r100')
        for min_locs in min_rngs_locs:
            cnf_run_fs[-1].create(min_locs)

    # Create run fs if that directory has been deleted to run the jobs

    return [cnf_save_fs, min_rngs_path, min_rngs_locs, '', cnf_run_fs]
Example #7
0
def _get_prop_fs(spc_model_dct_i,
                 spc_dct_i,
                 prop,
                 sort_info_lst,
                 run_prefix,
                 save_prefix,
                 saddle=False,
                 name=None):
    """ Get filesystem info for a property in the spc model dct
    """
    if saddle:
        rxn_info = spc_dct_i['rxn_info']
        spc_info = rinfo.ts_info(rxn_info)
    else:
        spc_info = sinfo.from_dct(spc_dct_i)

    level = spc_model_dct_i[prop]['geolvl'][1][1]
    levelp = tinfo.modify_orb_label(level, spc_info)
    mod_info_lst = []
    if sort_info_lst is not None:
        for info in sort_info_lst[:2]:
            if info is not None:
                mod_info_lst.append(tinfo.modify_orb_label(info, spc_info))
            else:
                mod_info_lst.append(info)
        for info in sort_info_lst[2:]:
            mod_info_lst.append(info)

    _root = root_locs(spc_dct_i, saddle=saddle, name=name)
    cnf_run_fs, cnf_save_fs = build_fs(run_prefix,
                                       save_prefix,
                                       'CONFORMER',
                                       thy_locs=levelp[1:],
                                       **_root)

    return cnf_run_fs, cnf_save_fs, levelp, mod_info_lst