当前位置: 首页>>代码示例>>Python>>正文


Python Vasp.lmaxmix方法代码示例

本文整理汇总了Python中pylada.vasp.Vasp.lmaxmix方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.lmaxmix方法的具体用法?Python Vasp.lmaxmix怎么用?Python Vasp.lmaxmix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pylada.vasp.Vasp的用法示例。


在下文中一共展示了Vasp.lmaxmix方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_alias

# 需要导入模块: from pylada.vasp import Vasp [as 别名]
# 或者: from pylada.vasp.Vasp import lmaxmix [as 别名]
def test_alias():
    from pylada.vasp import Vasp
    from pylada.error import ValueError
    a = Vasp()

    assert a.ismear is None
    assert a._input['ismear'].keyword == 'ismear'
    assert a._input['ismear'].output_map() is None
    map = a._input['ismear'].aliases
    assert len(map) != 0
    for i, items in map.items():
        for item in items:
            a.ismear = item
            assert a.ismear == items[0]
            assert 'ismear' in a._input['ismear'].output_map()
            assert a._input['ismear'].output_map()['ismear'] == str(i)
            a.ismear = i
            assert a.ismear == items[0]
        a.ismear = str(i)
        assert a.ismear == items[0]

    try:
        a.lmaxmix = 'a'
    except ValueError:
        pass
    else:
        raise Exception()
开发者ID:,项目名称:,代码行数:29,代码来源:

示例2: test_lsorbit

# 需要导入模块: from pylada.vasp import Vasp [as 别名]
# 或者: from pylada.vasp.Vasp import lmaxmix [as 别名]
def test_lsorbit():
    from collections import namedtuple
    from pickle import loads, dumps
    from pylada.vasp import Vasp

    Restart = namedtuple('Restart', ['success', 'lmaxmix', 'lvhar'])
    a = Vasp()
    o = a._input['lsorbit']
    d = {'LSorbit': o.__class__}
    assert a.lsorbit is None
    assert a.nonscf == False
    assert a._input['lsorbit'].keyword == 'lsorbit'
    assert a._input['nonscf'].keyword is None
    assert o.output_map(vasp=a) is None
    assert eval(repr(o), d).output_map(vasp=a) is None
    assert eval(repr(o), d).value is None
    assert loads(dumps(o)).value is None

    a.lsorbit = True
    assert a.nonscf
    assert a.lsorbit
    try:
        a._input['lsorbit'].output_map(vasp=a)
    except ValueError:
        pass
    else:
        raise Exception()
    a.restart = Restart(False, 7, False)
    try:
        a._input['lsorbit'].output_map(vasp=a)
    except ValueError:
        pass
    else:
        raise Exception()
    a.restart = Restart(True, 7, False)
    assert 'lsorbit' in o.output_map(vasp=a)
    assert o.output_map(vasp=a)['lsorbit'] == '.TRUE.'
    assert a.lmaxmix == 7
    a.lmaxmix = 5
    a.restart = Restart(True, 6, False)
    assert 'lsorbit' in o.output_map(vasp=a)
    assert o.output_map(vasp=a)['lsorbit'] == '.TRUE.'
    assert a.lmaxmix == 6
    assert loads(dumps(o)).value is True
    assert eval(repr(o), d).value is True
开发者ID:pylada,项目名称:pylada-light,代码行数:47,代码来源:test_lsorbit.py


注:本文中的pylada.vasp.Vasp.lmaxmix方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。