def _run(self, molName): self.molName = molName logger.info("Molecule: {}".format(self.molName)) molFile = os.path.join(home("test-charge"), self.molName + ".mol2") self.mol = Molecule(molFile) self.new_mols = {} self.extras = {} self.new_mols["Gasteiger"] = fitGasteigerCharges(self.mol) try: self.new_mols["AM1-BCC"] = fitChargesWithAntechamber(self.mol, type="bcc") except: pass qm = Psi4() qm.theory = "B3LYP" qm.basis = "6-311++G**" workDir = os.path.join("tmp", self.molName) os.makedirs(workDir, exist_ok=True) for factor in [-10, -5, -4, -3, -2, -1]: logger.info("Factor: {}".format(factor)) key = "ESP b {}".format(factor) np.random.seed(20181114) # Make ESP grid generation deterministic self.new_mols[key], self.extras[key] = fitESPCharges( self.mol, qm, workDir, restraint_factor=10**factor)
def setUp(self): # For Slurm, the test directory has to be on a shared filesystem self.testDir = os.getcwd() self.qm = Psi4() self.qm.queue = SlurmQueue() self.qm.queue.partition = "normalGPU" # TODO use CPU partition when available self.qm.queue.jobname = "Psi4_test" super().setUp()
def _get_qm_calculator(args, queue): from parameterize.qm import Psi4, Gaussian, FakeQM2 logger.info("=== QM configuration ===") # Create a QM object logger.info("Code: {}".format(args.code)) if args.code == "Psi4": qm = Psi4() elif args.code == "Gaussian": qm = Gaussian() else: raise AssertionError() # Override with a FakeQM object if args.fake_qm: qm = FakeQM2() logger.warning("Using FakeQM") # Configure the QM object qm.theory = args.theory logger.info("Theory: {}".format(qm.theory)) qm.basis = args.basis logger.info("Basis sets: {}".format(qm.basis)) qm.solvent = args.environment logger.info("Environment: {}".format(qm.solvent)) qm.queue = queue qm.charge = args.charge # Update B3LYP to B3LYP-D3 # TODO: this is silent and not documented stuff if qm.theory == "B3LYP": qm.correction = "D3" logger.warning("The dispersion correction is set to {}".format( qm.correction)) # Update basis sets # TODO: this is silent and not documented stuff if args.charge < 0 and qm.solvent == "vacuum": if qm.basis == "6-31G*": qm.basis = "6-31+G*" if qm.basis == "6-311G**": qm.basis = "6-311++G**" if qm.basis == "cc-pVDZ": qm.basis = "aug-cc-pVDZ" logger.warning("Basis sets are changed to {}".format(qm.basis)) return qm
def setUp(self): self.skipTest("No Slurm tests") if "TRAVIS" in os.environ: self.skipTest("No Psi4 Slurm tests on Travis") # For Slurm, the test directory has to be on a shared filesystem self.testDir = os.getcwd() self.qm = Psi4() self.qm.queue = SlurmQueue() self.qm.queue.partition = "normalGPU" # TODO use CPU partition when available self.qm.queue.jobname = "Psi4_test" super().setUp()
def setUp(self): self.qm = Psi4() super().setUp()