コード例 #1
0
ファイル: pyaims.py プロジェクト: mmarianski/fafoom
 def clean_and_store(self):
     """Store the output and clean the working direction after the FHI-aims
     calculation has been completed.
     """
     os.remove('geometry.in')
     os.remove('control.in')
     shutil.copy('result.out', self.dirname)
     os.remove('result.out')
     remover_file('geometry.in.next_step')
     shutil.copy('geometry.out', self.dirname)
     os.remove('geometry.out')
コード例 #2
0
ファイル: pyaims.py プロジェクト: cbaldauf/fafoom
 def clean_and_store(self):
     """Store the output and clean the working direction after the FHI-aims
     calculation has been completed.
     """
     try:
         os.remove('geometry.in')
         os.remove('control.in')
         shutil.copy('result.out', self.dirname)
         os.remove('result.out')
         remover_file('geometry.in.next_step')
         shutil.copy('geometry.out', self.dirname)
         os.remove('geometry.out')
     except IOError:
         pass
コード例 #3
0
def simple_or_restart():
    """ Select the type of run. If the all backup files are present the run
    will be restarted. Otherwise, the directory will be cleaned and a new run
    will be started."""

    for_restart = [
        "backup_population.dat", "backup_mol.dat", "backup_min_energy.dat",
        "backup_iteration.dat", "backup_blacklist.dat"
    ]
    opt = "restart"
    for filename in for_restart:
        if glob.glob(filename):
            pass
        else:
            opt = "simple"
    if opt == "simple":
        print("Cleaning up the directory")
        for d in glob.glob("initial_*"):
            remover_dir(d)
        for d in glob.glob("generation_*_child*"):
            remover_dir(d)
        remover_dir("blacklist")
        for f in [
                "mol.sdf", "control.in", "geometry.in", "output.txt",
                "result.out", "kill.dat"
        ]:
            remover_file(f)
        for f in for_restart:
            remover_file(f)
    if opt == "restart":
        remover_file("kill.dat")
    return opt
コード例 #4
0
ファイル: run_utilities.py プロジェクト: Savasci/fafoom
def simple_or_restart():
    """ Select the type of run. If the all backup files are present the run
    will be restarted. Otherwise, the directory will be cleaned and a new run
    will be started."""

    for_restart = [
        "backup_population.dat",
        "backup_mol.dat",
        "backup_min_energy.dat",
        "backup_iteration.dat",
        "backup_blacklist.dat",
    ]
    opt = "restart"
    for filename in for_restart:
        if glob.glob(filename):
            pass
        else:
            opt = "simple"
    if opt == "simple":
        print_output("Cleaning up the directory")
        for d in glob.glob("initial_*"):
            remover_dir(d)
        for d in glob.glob("generation_*_child*"):
            remover_dir(d)
        remover_dir("blacklist")
        for f in ["mol.sdf", "control.in", "geometry.in", "output.txt", "result.out", "kill.dat"]:
            remover_file(f)
        for f in for_restart:
            remover_file(f)
    if opt == "restart":
        remover_file("kill.dat")
    return opt