Exemplo n.º 1
0
def test_gaussian_version():
    """
    Try and check the gaussian version this will raise an error if not installed.
    """
    g = GaussianHarness()
    if g.found():
        assert g.get_version() in ["g09", "g16"]
    else:
        with pytest.raises(ModuleNotFoundError):
            _ = g.get_version()
Exemplo n.º 2
0
def test_full_run(driver, tmpdir):
    """
    For the given driver try a full execution if the user has gaussian installed.
    """
    if not GaussianHarness.found():
        pytest.skip("Gaussian 09/16 not available test skipped.")

    with tmpdir.as_cwd():
        # build the input
        mol = Ligand.from_file(file_name=get_data("acetone.pdb"))
        # build the atomic model
        qc_spec = qcel.models.common_models.Model(method="wB97XD",
                                                  basis="6-311++G(d,p)")
        # build a job for a specific driver
        qc_task = qcel.models.AtomicInput(molecule=mol.to_qcschema(),
                                          driver=driver,
                                          model=qc_spec)
        g = GaussianHarness()
        # run locally with 2 cores and 2 GB memory
        result = g.compute(
            input_data=qc_task,
            config=qcng.config.TaskConfig(**{
                "memory": 2,
                "ncores": 2,
                "nnodes": 1,
                "retries": 1
            }),
        )

        outfiles = {}
        with open(get_data("gaussian.log")) as log:
            outfiles["gaussian.log"] = log.read()
        with open(get_data("gaussian.fchk")) as fchk:
            outfiles["lig.fchk"] = fchk.read()
        ref_result = g.parse_output(outfiles=outfiles, input_model=qc_task)

        assert np.allclose(ref_result.return_result, result.return_result)