本文整理匯總了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))