コード例 #1
0
ファイル: info.py プロジェクト: avcopan/filesystem
def conformer_trunk(nsamp, tors_info):
    """ information for the conformer trunk directory
    """
    tors_info = autoinf.Info(**dict(tors_info))
    assert isinstance(nsamp, numbers.Integral)
    inf_obj = autoinf.Info(nsamp=nsamp, tors_info=tors_info)
    assert autoinf.matches_function_signature(inf_obj, conformer_trunk)
    return inf_obj
コード例 #2
0
 def information(nsamp, tors_info):
     """ base information object
     """
     tors_info = autoinf.Info(**dict(tors_info))
     assert isinstance(nsamp, numbers.Integral)
     inf_obj = autoinf.Info(nsamp=nsamp, tors_info=tors_info)
     assert autoinf.matches_function_signature(inf_obj, information)
     return inf_obj
コード例 #3
0
def test_():
    """ tests
    """
    inf_obj = autoinf.Info(a=('b', 'c', 'd', 'e'), x=autoinf.Info(y=1, z=2))
    assert dict(inf_obj) == {'a': ['b', 'c', 'd', 'e'], 'x': {'y': 1, 'z': 2}}
    assert autoinf.object_(dict(inf_obj)) == inf_obj
    print(autoinf.object_({'a': ('b', 'c', 'd', 'e'), 'x': {'y': 1, 'z': 2}}))
    print(dict(autoinf.object_({'a': ('b', 'c', 'd', 'e'), 'x': {'y': 1, 'z': 2}})))
コード例 #4
0
ファイル: lj.py プロジェクト: avcopan/filesystem
def information(nsamp):
    """ create an information object for lennard-jones information
    """
    assert isinstance(nsamp, numbers.Integral)
    inf_obj = autoinf.Info(nsamp=nsamp)
    assert autoinf.matches_function_signature(inf_obj, information)
    return inf_obj
コード例 #5
0
ファイル: species.py プロジェクト: avcopan/filesystem
def conn_information(inchi, smiles):
    """ connectivity information object
    """
    assert _is_valid_connectivity_inchi(inchi)
    assert inchi == automol.smiles.inchi(smiles)
    inf_obj = autoinf.Info(inchi=inchi, smiles=smiles)
    assert autoinf.matches_function_signature(inf_obj, conn_information)
    return inf_obj
コード例 #6
0
ファイル: species.py プロジェクト: avcopan/filesystem
def information(inchi, smiles):
    """ stereo information object
    """
    assert _is_valid_stereo_inchi(inchi)
    assert inchi == automol.smiles.inchi(smiles)
    inf_obj = autoinf.Info(inchi=inchi, smiles=smiles)
    assert autoinf.matches_function_signature(inf_obj, information)
    return inf_obj
コード例 #7
0
ファイル: info.py プロジェクト: avcopan/filesystem
def species_leaf(inchi, smiles, mult):
    """ information for the species leaf directory
    """
    assert _is_valid_stereo_inchi(inchi)
    assert inchi == automol.smiles.inchi(smiles)
    inf_obj = autoinf.Info(inchi=inchi, smiles=smiles, mult=mult)
    assert autoinf.matches_function_signature(inf_obj, species_leaf)
    return inf_obj
コード例 #8
0
def test__information():
    """ test the information read/write functions
    """
    ref_inf_obj = autoinf.Info(a=['b', 'c', 'd', 'e'],
                               x=autoinf.Info(y=1, z=2))

    inf_file_name = autofile.name.information('test')
    inf_file_path = os.path.join(TMP_DIR, inf_file_name)
    inf_str = autofile.write.information(ref_inf_obj)

    assert not os.path.isfile(inf_file_path)
    autofile.write_file(inf_file_path, inf_str)
    assert os.path.isfile(inf_file_path)

    inf_str = autofile.read_file(inf_file_path)
    inf_obj = autofile.read.information(inf_str)
    assert inf_obj == ref_inf_obj
コード例 #9
0
ファイル: info.py プロジェクト: avcopan/filesystem
def run(job, prog, method, basis, utc_start_time=None, utc_end_time=None):
    """ run information
    """
    inf_obj = autoinf.Info(
        job=job,
        prog=prog,
        method=method,
        basis=basis,
        utc_start_time=utc_start_time,
        utc_end_time=utc_end_time,
    )
    assert autoinf.matches_function_signature(inf_obj, run)
    return inf_obj
コード例 #10
0
ファイル: info.py プロジェクト: avcopan/filesystem
def theory_leaf(method, basis, orb_restricted):
    """ information for the theory leaf directory

    This need not be tied to elstruct -- just take out the name checks.
    """
    assert elstruct.Method.contains(method)
    assert elstruct.Basis.contains(basis)
    assert isinstance(orb_restricted, bool)
    inf_obj = autoinf.Info(method=method,
                           basis=basis,
                           orb_restricted=orb_restricted)
    assert autoinf.matches_function_signature(inf_obj, theory_leaf)
    return inf_obj
コード例 #11
0
ファイル: theory.py プロジェクト: avcopan/filesystem
def information(method, basis, open_shell, orb_restricted):
    """ information object
    """
    method = elstruct.par.standard_case(method)
    basis = elstruct.par.standard_case(basis)
    assert isinstance(open_shell, bool)
    assert isinstance(orb_restricted, bool)
    inf_obj = autoinf.Info(method=method,
                           basis=basis,
                           open_shell=open_shell,
                           orb_restricted=orb_restricted)
    assert autoinf.matches_function_signature(inf_obj, information)
    return inf_obj