本文整理汇总了Python中commopy.Cabinet.reserve_file方法的典型用法代码示例。如果您正苦于以下问题:Python Cabinet.reserve_file方法的具体用法?Python Cabinet.reserve_file怎么用?Python Cabinet.reserve_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commopy.Cabinet
的用法示例。
在下文中一共展示了Cabinet.reserve_file方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_poscar
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def write_poscar(self, poscar='POSCAR'):
"""
write_poscar(path)
Make a 'POSCAR' file at 'path'
"""
Cabinet.reserve_file(poscar)
Cabinet.write_file(poscar, str(self))
示例2: std
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def std(src='POSCAR'):
"""
conventional standard cell に変換
"""
srcpos = Poscar.from_file(src)
finder = SpacegroupAnalyzer(srcpos.structure)
std_str = finder.get_conventional_standard_structure()
dstpos = Poscar(std_str)
dst = 'POSCAR_std'
Cabinet.reserve_file(dst)
dstpos.write_file(dst)
示例3: prim
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def prim(src):
"""
primitive cell に変換
"""
srcpos = Poscar.from_file(src)
finder = SpacegroupAnalyzer(srcpos.structure)
prim_str = finder.get_primitive_standard_structure()
dstpos = Poscar(prim_str)
dst = 'POSCAR_prim'
Cabinet.reserve_file(dst)
dstpos.write_file(dst)
示例4: standard
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def standard(src="POSCAR"):
"""
standardに変換
"""
srcpos = Poscar.from_file(src)
finder = SpacegroupAnalyzer(srcpos.structure)
std = finder.get_conventional_standard_structure()
dstpos = Poscar(std)
dst = "POSCAR_std"
Cabinet.reserve_file(dst)
dstpos.write_file(dst)
示例5: primitive
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def primitive(src="POSCAR"):
"""
primitiveに変換
"""
srcpos = Poscar.from_file(src)
finder = SpacegroupAnalyzer(srcpos.structure)
prim = finder.get_primitive_standard_structure()
dstpos = Poscar(prim)
dst = "POSCAR_prim"
Cabinet.reserve_file(dst)
dstpos.write_file(dst)
示例6: refined
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def refined(src="POSCAR"):
"""
refined poscar を 作成する
"""
srcpos = Poscar.from_file(src)
finder = SpacegroupAnalyzer(srcpos.structure, symprec=5e-1, angle_tolerance=8)
std = finder.get_refined_structure()
dstpos = Poscar(std)
dst = "POSCAR_refined"
Cabinet.reserve_file(dst)
dstpos.write_file(dst)
示例7: prep_one
# 需要导入模块: from commopy import Cabinet [as 别名]
# 或者: from commopy.Cabinet import reserve_file [as 别名]
def prep_one(cls, cif_file, dst_dir):
"""
The dst_dir is current directory,
this method search POSCAR and reserve it.
If not, it will search whethre dst_dir already exist or not.
If it already exist, this module will do nothing.
If not, new directory make and prepare POSCAR file.
"""
if dst_dir == '.':
Cabinet.reserve_file('POSCAR')
elif glob.glob(dst_dir):
line = ("\'{0}\' directory is already exist.\n"
"Do Nothing...\n".format(dst_dir.split('/')[-1]))
print(line)
return
else:
Bash.mkdir(dst_dir)
cls.conv2poscar(cif_file, dst_dir)
shutil.copy(cif_file, dst_dir)