コード例 #1
0
ファイル: test_handlers.py プロジェクト: shyamd/custodian
    def test_correct(self):

        shutil.copy("INCAR", "INCAR.orig")

        h = DriftErrorHandler(max_drift=0.0001,enaug_multiply=2)
        h.check()
        d = h.correct()
        incar = Incar.from_file("INCAR")
        self.assertTrue(incar.get("ADDGRID",False))

        d = h.correct()
        incar = Incar.from_file("INCAR")
        self.assertEqual(incar.get("PREC"),"High")
        self.assertEqual(incar.get("ENAUG",0),incar.get("ENCUT",2)*2)

        clean_dir()
        shutil.move("INCAR.orig", "INCAR")
コード例 #2
0
    def test_correct(self):

        shutil.copy("INCAR", "INCAR.orig")

        h = DriftErrorHandler(max_drift=0.0001,enaug_multiply=2)
        h.check()
        d = h.correct()
        incar = Incar.from_file("INCAR")
        self.assertTrue(incar.get("ADDGRID",False))

        d = h.correct()
        incar = Incar.from_file("INCAR")
        self.assertEqual(incar.get("PREC"),"High")
        self.assertEqual(incar.get("ENAUG",0),incar.get("ENCUT",2)*2)

        clean_dir()
        shutil.move("INCAR.orig", "INCAR")
コード例 #3
0
ファイル: test_handlers.py プロジェクト: shyamd/custodian
    def test_check(self):

        shutil.copy("INCAR", "INCAR.orig")

        h = DriftErrorHandler(max_drift=0.05, to_average=11)
        self.assertFalse(h.check())

        h = DriftErrorHandler(max_drift=0.05)
        self.assertFalse(h.check())

        h = DriftErrorHandler(max_drift=0.0001)
        self.assertFalse(h.check())

        incar = Incar.from_file("INCAR")
        incar["EDIFFG"] = -0.01
        incar.write_file("INCAR")

        h = DriftErrorHandler(max_drift=0.0001)
        self.assertTrue(h.check())

        h = DriftErrorHandler()
        h.check()
        self.assertEqual(h.max_drift,0.01)

        clean_dir()
        shutil.move("INCAR.orig", "INCAR")
コード例 #4
0
    def test_check(self):

        shutil.copy("INCAR", "INCAR.orig")

        h = DriftErrorHandler(max_drift=0.05, to_average=11)
        self.assertFalse(h.check())

        h = DriftErrorHandler(max_drift=0.05)
        self.assertFalse(h.check())

        h = DriftErrorHandler(max_drift=0.0001)
        self.assertFalse(h.check())

        incar = Incar.from_file("INCAR")
        incar["EDIFFG"] = -0.01
        incar.write_file("INCAR")

        h = DriftErrorHandler(max_drift=0.0001)
        self.assertTrue(h.check())

        h = DriftErrorHandler()
        h.check()
        self.assertEqual(h.max_drift,0.01)

        clean_dir()
        shutil.move("INCAR.orig", "INCAR")