当前位置: 首页>>代码示例>>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;未经允许,请勿转载。