本文整理汇总了Python中commopy.Bash.find_files方法的典型用法代码示例。如果您正苦于以下问题:Python Bash.find_files方法的具体用法?Python Bash.find_files怎么用?Python Bash.find_files使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类commopy.Bash
的用法示例。
在下文中一共展示了Bash.find_files方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: clean_prev_dir
# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import find_files [as 别名]
def clean_prev_dir(path, dirc):
"""
既存dirctoryを消去
"""
trush_list = Bash.find_files(path, dirc)
for trush in trush_list:
fname = os.path.join(path, trush)
shutil.rmtree(fname)
print("{0} is removed.".format(fname))
示例2: convert_all
# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import find_files [as 别名]
def convert_all(self, dst_path):
"""
det_path中の5種のINCARファイルを修正し上書きする
追加したパラメータを出力
"""
incar_list = Bash.find_files('INCAR_*soc*')
for incar in incar_list:
self.convert_incar(dst_path, incar)
self.note_update()
示例3: clean_prev
# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import find_files [as 别名]
def clean_prev(path, files):
"""
既存filesを消去
"""
trush_list = Bash.find_files(path, files)
for trush in trush_list:
fname = os.path.join(path, trush)
os.remove(fname)
print("{0} is removed.".format(fname))
示例4: plt_double_MAE
# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import find_files [as 别名]
def plt_double_MAE(self, in_dir, in_dir2, out_dir):
""" 2014/01/28 MAEをプロット for Heusler"""
for compo in self.compos:
print compo
dir_List = Bash.find_files(os.path.join(in_dir, compo),
'fixed_*')
dir_list_total = [os.path.join(in_dir, compo, x) for x in dir_List]
#regular
DataA = self.obj(dir_list_total, 'POSCAR',
'OUTCAR_polarized', 'regular')
for i in range(1, len(compo)):
if compo[i].isupper():
ele_list = [compo[0:i], compo[i:]]
DataA.get_enthalpy(*ele_list)
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC100', 'MAE[100-001]')
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC110', 'MAE[110-001]')
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC100',
'OSZICAR_SOC110', 'MAE[110-100]')
#inverse
dir_list_total = [os.path.join(in_dir2, compo, x)
for x in dir_List]
DataB = self.obj(dir_list_total, 'POSCAR', 'OUTCAR_polarized',
'inverse')
DataB.get_enthalpy(*ele_list)
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC100', 'MAE[100-001]')
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC110', 'MAE[110-001]')
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC100',
'OSZICAR_SOC110', 'MAE[110-100]')
plt = PlotResults('Fe$_2$%s' % compo, 3)
plt.EneMomMae_CovA(DataA.data_array, 'blue', DataA.label)
plt.EneMomMae_CovA(DataB.data_array, 'magenta', DataB.label)
pylab.savefig('%s/%s.eps' % (out_dir, compo))
示例5: plot_mae
# 需要导入模块: from commopy import Bash [as 别名]
# 或者: from commopy.Bash import find_files [as 别名]
def plot_mae(self, in_dir, out_dir):
for dirc in self.dir_list:
print(dirc)
dir_List = Bash.find_files(os.path.join(in_dir, dirc),
'fixed_*')
dir_list_total = [os.path.join(in_dir, dirc, x) for x in dir_List]
#regular
DataA = self.obj(dir_list_total, 'POSCAR',
'OUTCAR_polarized', 'regular')
for i in range(1, len(dirc)):
if dirc[i].isupper():
ele_list = [dirc[0:i], dirc[i:]]
DataA.get_enthalpy(*ele_list)
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC100', 'MAE[100-001]')
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC110', 'MAE[110-001]')
DataA.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC100',
'OSZICAR_SOC110', 'MAE[110-100]')
#inverse
dir_list_total = [os.path.join(in_dir2, dirc, x) for x in dir_List]
DataB = self.obj(dir_list_total, 'POSCAR', 'OUTCAR_polarized',
'inverse')
DataB.get_enthalpy(*ele_list)
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC100', 'MAE[100-001]')
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC001',
'OSZICAR_SOC110', 'MAE[110-001]')
DataB.add_mae(dir_list_total, 'POSCAR', 'OSZICAR_SOC100',
'OSZICAR_SOC110', 'MAE[110-100]')
plt = PlotResults('Fe$_2$%s' % dirc, 3)
plt.EneMomMae_CovA(DataA.data_array, 'blue', DataA.label)
plt.EneMomMae_CovA(DataB.data_array, 'magenta', DataB.label)
pylab.savefig('%s/%s.eps' % (out_dir, dirc))