コード例 #1
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_2b():
    res = intf_dftd3.from_arrays(name_hint='pbe', level_hint='d3')
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name)
    assert compare_strings('PBE-D3', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(
        name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #2
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1d():
    res = intf_dftd3.from_arrays(name_hint='b3lyp', level_hint='d3bJ', param_tweaks={'a2': 4.4211})
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name)
    assert compare_strings('B3LYP-D3(BJ)', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(
        name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #3
0
def test_recon_2c():
    res = intf_dftd3.from_arrays(name_hint='pbe-d3')
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name)
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(dpbed3zero, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #4
0
def test_recon_2b():
    res = intf_dftd3.from_arrays(name_hint='pbe', level_hint='d3')
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name)
    assert compare_strings('PBE-D3', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(dpbed3zero, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #5
0
def test_recon_1i():
    res = intf_dftd3.from_arrays(name_hint='b3lyp-d3bj',
                                 param_tweaks={'a2': 4.4211})
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name)
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(db3lypd3bj, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #6
0
def test_recon_1b():
    res = intf_dftd3.from_arrays(name_hint='b3LYP', level_hint='D3bj')
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name)
    assert compare_strings('B3LYP-D3(BJ)', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(db3lypd3bj, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #7
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1e():
    ans = copy.deepcopy(db3lypd3bj)
    ans['fctldash'] = ''
    ans['dashparams']['a2'] = 5.4211

    res = intf_dftd3.from_arrays(verbose=3, name_hint='b3lyp', level_hint='d3bJ', param_tweaks={'a2': 5.4211})
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name)
    #assert compare_strings('-D3BJ', compute_key(res), 'key')
    assert compare_strings('', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(
        verbose=3, name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #8
0
def test_recon_1c():
    res = intf_dftd3.from_arrays(param_tweaks={
        's8': 1.9889,
        's6': 1.0,
        'a2': 4.4211,
        'a1': 0.3981
    },
                                 level_hint='d3bj')
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name)
    assert compare_strings('B3LYP-D3(BJ)', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(db3lypd3bj, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #9
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_2e():
    ans = {'dashlevel': 'chg', 'dashparams': {'s6': 4.05}, 'fctldash': 'asdf-d4', 'dashparams_citation': '    mypaper\n'}
    supp = {'chg': {'definitions': {'asdf-d4': {'params': {'s6': 4.05}, 'citation': '    mypaper\n'}}}}

    res = intf_dftd3.from_arrays(name_hint='asdf-d4', level_hint='chg', dashcoeff_supplement=supp)
    print(res)
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name)
    with pytest.raises(qcdb.ValidationError):
        intf_dftd3.from_arrays(name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    res = intf_dftd3.from_arrays(
        name_hint=res['fctldash'],
        level_hint=res['dashlevel'],
        param_tweaks=res['dashparams'],
        dashcoeff_supplement=supp)
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #10
0
def test_recon_1j():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(name_hint='b3lyp-d3bj',
                                     param_tweaks={
                                         'a2': 4.4211,
                                         'zzz': 0.0
                                     })
コード例 #11
0
def test_recon_1e():
    ans = copy.deepcopy(db3lypd3bj)
    ans['fctldash'] = ''
    ans['dashparams']['a2'] = 5.4211

    res = intf_dftd3.from_arrays(verbose=3,
                                 name_hint='b3lyp',
                                 level_hint='d3bJ',
                                 param_tweaks={'a2': 5.4211})
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name)
    #assert compare_strings('-D3BJ', compute_key(res), 'key')
    assert compare_strings('', compute_key(res), 'key')
    res = intf_dftd3.from_arrays(verbose=3,
                                 name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'])
    assert compare_dicts(ans, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #12
0
def test_recon_2e():
    ans = {
        'dashlevel': 'chg',
        'dashparams': {
            's6': 4.05
        },
        'fctldash': 'asdf-d4',
        'dashparams_citation': '    mypaper\n'
    }
    supp = {
        'chg': {
            'definitions': {
                'asdf-d4': {
                    'params': {
                        's6': 4.05
                    },
                    'citation': '    mypaper\n'
                }
            }
        }
    }

    res = intf_dftd3.from_arrays(name_hint='asdf-d4',
                                 level_hint='chg',
                                 dashcoeff_supplement=supp)
    print(res)
    assert compare_dicts(ans, res, 4, sys._getframe().f_code.co_name)
    with pytest.raises(qcdb.ValidationError):
        intf_dftd3.from_arrays(name_hint=res['fctldash'],
                               level_hint=res['dashlevel'],
                               param_tweaks=res['dashparams'])
    res = intf_dftd3.from_arrays(name_hint=res['fctldash'],
                                 level_hint=res['dashlevel'],
                                 param_tweaks=res['dashparams'],
                                 dashcoeff_supplement=supp)
    assert compare_dicts(ans, res, 4,
                         sys._getframe().f_code.co_name + ' idempotent')
コード例 #13
0
def test_recon_1h():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(level_hint='d3bJ',
                                     param_tweaks={'s6': 5.4211})
コード例 #14
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_2d():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(name_hint='asdf-d4')
コード例 #15
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_2c():
    res = intf_dftd3.from_arrays(name_hint='pbe-d3')
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name)
    res = intf_dftd3.from_arrays(
        name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    assert compare_dicts(dpbed3zero, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #16
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1j():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(name_hint='b3lyp-d3bj', param_tweaks={'a2': 4.4211, 'zzz': 0.0})
コード例 #17
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1i():
    res = intf_dftd3.from_arrays(name_hint='b3lyp-d3bj', param_tweaks={'a2': 4.4211})
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name)
    res = intf_dftd3.from_arrays(
        name_hint=res['fctldash'], level_hint=res['dashlevel'], param_tweaks=res['dashparams'])
    assert compare_dicts(db3lypd3bj, res, 4, sys._getframe().f_code.co_name + ' idempotent')
コード例 #18
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1h():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(level_hint='d3bJ', param_tweaks={'s6': 5.4211})
コード例 #19
0
ファイル: test_dftd3.py プロジェクト: SebWouters/psi4
def test_recon_1g():
    with pytest.raises(qcdb.ValidationError):
        intf_dftd3.from_arrays(name_hint='fakeb3lyp', level_hint='d3bJ', param_tweaks={'s6': 5.4211})
コード例 #20
0
def test_recon_1g():
    with pytest.raises(qcdb.ValidationError):
        intf_dftd3.from_arrays(name_hint='fakeb3lyp',
                               level_hint='d3bJ',
                               param_tweaks={'s6': 5.4211})
コード例 #21
0
def test_recon_2d():
    with pytest.raises(qcdb.ValidationError):
        res = intf_dftd3.from_arrays(name_hint='asdf-d4')