本文整理汇总了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()
示例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