當前位置: 首頁>>代碼示例>>Python>>正文


Python Bash.mkdir方法代碼示例

本文整理匯總了Python中commopy.Bash.mkdir方法的典型用法代碼示例。如果您正苦於以下問題:Python Bash.mkdir方法的具體用法?Python Bash.mkdir怎麽用?Python Bash.mkdir使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在commopy.Bash的用法示例。


在下文中一共展示了Bash.mkdir方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def main():
    Bash.mkdir('cova')
    cova_list = Array.frange_stp(1.0, 1.05, 0.05)
    series = series_vasp.Produce('POSCAR', 'cova')
    series.set_cova(cova_list)
    series.make_files()
    series.append_list_run('run_cova.sh')
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:9,代碼來源:vasp_cova.py

示例2: from_new

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
    def from_new(cls):
        """
        seq ディレクトリを作成し originals ディレクトリ中に初期ファイルを保存
        実行ディレクトリを記憶
        """
        seq_list = glob.glob("seq*/")
        i = 0
        for seq in seq_list:
            try:
                j = int(seq.split("seq")[-1].split("/")[0])
                if i < j:
                    i = j
            except ValueError:
                pass
        i += 1
        dirc = 'seq{0}/originals/'.format(i)
        str_files = glob.glob('*.str')
        Bash.mkdir(dirc)
        for fname in ['IN.CVM', 'def.txt', 'energies.txt'] + str_files:
            copyfile(fname, os.path.join(dirc, fname))

        seq_dirc = "seq{0}".format(str(i))
        print("New directory of '{}' is created".format(seq_dirc))

        clus_name = cls.get_clus_name(".")

        results = CEMResults([])
        return cls(seq_dirc, None, None, clus_name, results)
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:30,代碼來源:sequence_cvm.py

示例3: test_plt

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
 def test_plt(self):
     clean_prev_dir(self.path, 'output')
     Bash.mkdir(os.path.join(self.path, 'output', 'text'))
     combi_para = [['Co'], ['Al']]
     pathA = os.path.join(self.path, 'typeA')
     pathB = os.path.join(self.path, 'typeB')
     path_out = os.path.join(self.path, 'output')
     self.plt_double(combi_para, pathA, pathB, path_out)
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:10,代碼來源:test_grapy.py

示例4: mkdirs

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
 def mkdirs(self):
     """
     pathに記された階層ディレクトリを作成
     階層の順番はsetした順番となる
     """
     for param in self.series:
         dst_path = param['path']
         Bash.mkdir(dst_path)
開發者ID:hackberry-tree,項目名稱:00_workSpace,代碼行數:10,代碼來源:series_vasp.py

示例5: main

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def main():
    Bash.mkdir('kp')
    kp_list = Array.frange_stp(0.08, 0.24, 0.02)
    #kp_list = Array.frange_stp(0.04, 0.07, 0.02)
    series = series_vasp.Produce('POSCAR', 'kp')
    series.set_kp_relax(kp_list)
    series.make_files()
    series.make_list_run('run.sh')
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:10,代碼來源:vasp_kprx.py

示例6: test_volume

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
 def test_volume(self):
     print("SeriesVasp test_volume")
     os.chdir(self.path)
     clean_prev_dir('.', 'volume')
     Bash.mkdir('volume')
     volume_list = [5, 6, 7]
     series = series_vasp.Produce('POSCAR', 'volume')
     series.set_volume(volume_list)
     series.make_files()
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:11,代碼來源:test_series_vasp.py

示例7: stack

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def stack(args):
    """
    hcp-fcc Mg stacking 構造を作成する
    """
    path = args
    strs = CVMStrs.from_str_file(path)
    for structure in strs:
        dirc = str(structure.label).split('*')[0]
        Bash.mkdir(dirc)
        structure.make_stack_poscar(os.path.join(dirc, "POSCAR"))
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:12,代碼來源:cvm_input.py

示例8: for_ferrite

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def for_ferrite():
    """
    ferrite係のcombinatorial
    """
    Bash.mkdir('combi')
    elem_list = ['Ni', 'Mn', 'Cu', 'Zn', 'Cr']
    comp_list = [['O', 'Fe', x] for x in elem_list]
    series = series_vasp.Produce('POSCAR', 'combi')
    series.set_elements(comp_list)
    series.make_files()
    series.append_list_run('run_combi.sh')
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:13,代碼來源:vasp_combi.py

示例9: expand_poscars

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
 def expand_poscars(self, elements):
     """
     self.poscarsのPOSCARをディレクトリ(ID名)に展開
     elements名も追記する
     self.path中に作成
     pathを変えたい場合はself.pathを変更
     """
     for poscar in self.poscars:
         Bash.mkdir(os.path.join(self.path, poscar['ID']))
         poscar['object'].elements = elements
         poscar['object'].write_poscar(os.path.join(self.path,
                                                    poscar['ID'], 'POSCAR'))
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:14,代碼來源:uspex.py

示例10: make_system

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
    def make_system(self, dirname=None):
        os.chdir(CWD)
        font = ('Helevetica', 12, 'bold')
        self.initial.status.configure(text='None', font=font, fg='red')

        if not dirname:
            dirname = self.e_dir.get()
        dirname = "enshu_" + self.e_dir.get()
        path = os.path.join(CWD, dirname)
        Bash.mkdir(path)
        self.initial.listbox.delete(0, tk.END)
        SYSTEMS = [x[6:] for x in glob.glob('enshu_*')]
        print(SYSTEMS)
        self.initial.listbox.insert(tk.END, *SYSTEMS)
        self.top.destroy()
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:17,代碼來源:enshu_vasp.py

示例11: for_Fe16N2

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def for_Fe16N2():
    """
    perovskite係のcombinatorial
    """
    Bash.mkdir('combi')
    elem_list = [['Sc', 'As', 'Se', 'Y', 'Mo',
                  'Tc', 'Ag', 'Cd', 'In', 'Te',
                  'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir',
                  'Au', 'Hg', 'Tl', 'Pb', 'Bi'], ['C', 'B', 'N']]
    combi = Combinatorial(*elem_list)
    comp_list = [['Fe', x['elements'][0], 'Fe', x['elements'][1]]
                 for x in combi.compositions]
    series = series_vasp.Produce('POSCAR', 'combi')
    series.set_elements(comp_list)
    series.make_files()
    series.append_list_run('run_combi.sh')
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:18,代碼來源:vasp_combi.py

示例12: for_perovskite

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def for_perovskite():
    """
    perovskite係のcombinatorial
    """
    Bash.mkdir('combi')
    elem_list = [['Al', 'Co', 'Cr', 'Cu', 'Fe', 'Ga',
                  'Ge', 'Mn', 'Nb', 'Ni', 'Pd', 'Pt',
                  'Rh', 'Ru', 'Sb', 'Si', 'Sn', 'Ti',
                  'V', 'Zn', 'Zr'], ['C', 'B', 'N']]
    combi = Combinatorial(*elem_list)
    comp_list = [['Fe', x['elements'][0], x['elements'][1]]
                 for x in combi.compositions]
    series = series_vasp.Produce('POSCAR', 'combi')
    series.set_elements(comp_list)
    series.make_files()
    series.append_list_run('run_combi.sh')
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:18,代碼來源:vasp_combi.py

示例13: extract_strs

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
 def extract_strs(self, exch_fix,
                  src_path="../*/str.out", dst_dirc="extracts"):
     """
     src_path 中の等価な全ての構造を genstr から抽出する
     """
     for path in glob.glob(src_path):
         dst_path = os.path.join(
             dst_dirc, os.path.basename(os.path.dirname(path)))
         Bash.mkdir(dst_path)
         idx = self.get_idx_same_str(os.path.dirname(path), exch_fix=exch_fix)
         if idx:
             lines = self.lines[idx[0]:idx[1]]
             with open(os.path.join(dst_path, "str.out"), 'w') as wfile:
                 wfile.write("".join(lines))
         else:
             with open(os.path.join(dst_path, "too_large"), 'w') as wfile:
                 wfile.write("")
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:19,代碼來源:parse_atat.py

示例14: save_results

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [as 別名]
def save_results(temp, plot_data):
    Bash.mkdir('results_cv1')
    lines = "x\ty\n"
    for i in range(len(plot_data[0])):
        lines += str(plot_data[0][i]) + "\t"
        lines += str(plot_data[1][i]) + "\n"
    fname = "raw_" + str(temp)
    with open(os.path.join('results_cv1', fname), 'w') as wfile:
        wfile.write(lines)

    lines = "x_fit\ty_fit\n"
    for i in range(len(plot_data[2])):
        lines += str(plot_data[2][i]) + "\t"
        lines += str(plot_data[3][i]) + "\n"
    fname = "fit_" + str(temp)
    with open(os.path.join('results_cv1', fname), 'w') as wfile:
        wfile.write(lines)
開發者ID:hackberie,項目名稱:00_workSpace,代碼行數:19,代碼來源:cv1parser.py

示例15: prep_one

# 需要導入模塊: from commopy import Bash [as 別名]
# 或者: from commopy.Bash import mkdir [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)
開發者ID:buriedwood,項目名稱:00_workSpace,代碼行數:21,代碼來源:cifpy.py


注:本文中的commopy.Bash.mkdir方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。