Skip to content

Commit

Permalink
allow args in minimal tests. add opt-disp lane
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab committed Feb 14, 2021
1 parent 6564080 commit fad214f
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 40 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- conda-env: psi
Expand Down Expand Up @@ -61,6 +62,11 @@ jobs:
label: ADCC
runs-on: ubuntu-latest

- conda-env: opt-disp-psi
python-version: 3.8
label: optimization-dispersion
runs-on: ubuntu-latest

# - conda-env:
# python-version:
# label:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2017-2020, The Molecular Sciences Software Institute
Copyright (c) 2017-2021, The Molecular Sciences Software Institute
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
34 changes: 34 additions & 0 deletions devtools/conda-envs/opt-disp-psi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test
channels:
- psi4/label/dev
- conda-forge
dependencies:
- psi4
- blas=*=mkl # not needed but an example of disuading solver from openblas and old psi
- intel-openmp!=2019.5

# Mixed Tests
- dftd3 3.2.1
- mp2d >=1.1
- gcp
- geometric
- optking
- pymdi

# Core
- python
- pyyaml
- py-cpuinfo
- psutil
- qcelemental >=0.13.0
- pydantic>=1.0.0
- msgpack-python

# Testing
- pytest
- pytest-cov
- codecov

- pip
- pip:
- pyberny
11 changes: 0 additions & 11 deletions devtools/conda-envs/psi-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@ channels:
dependencies:
- psi4
- blas=*=mkl # not needed but an example of disuading solver from openblas and old psi
- intel-openmp!=2019.5

# Mixed Tests
- dftd3 3.2.1
- mp2d >=1.1
- gcp
- blas=*=mkl # not needed but an example of disuading solver from openblas and old psi
- intel-openmp!=2019.5

# Core
Expand All @@ -27,7 +20,3 @@ dependencies:
- pytest
- pytest-cov
- codecov

- pip
- pip:
- pyberny
3 changes: 0 additions & 3 deletions qcengine/programs/adcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicRe
model = input_model.model
conv_tol = input_model.keywords.get("conv_tol", 1e-6)

need_one_of_states = {"n_spin_flip", "n_triplets", "n_states", "n_singlets"}
if not (need_one_of_states & set(input_model.keywords)):
input_model.keywords["n_states"] = 1

if input_model.driver not in ["energy", "properties"]:
raise InputError(f"Driver {input_model.driver} not implemented for ADCC.")
Expand Down
3 changes: 0 additions & 3 deletions qcengine/programs/mopac.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ def get_version(self) -> str:
return "2016"

def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicResult":
"""
Runs Psi4 in API mode
"""
self.found(raise_error=True)

exec_command = self.build_input(input_model, config)
Expand Down
44 changes: 22 additions & 22 deletions qcengine/tests/test_harness_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@
from qcengine.testing import has_program

_canonical_methods = [
("dftd3", {"method": "b3lyp-d3"}),
("qcore", {"method": "pbe", "basis": "6-31G"}),
("molpro", {"method": "hf", "basis": "6-31G"}),
("mopac", {"method": "PM6"}),
("mp2d", {"method": "MP2-DMP2"}),
("nwchem", {"method": "hf", "basis": "6-31G"}),
("openmm", {"method": "openff-1.0.0", "basis": "smirnoff"}),
("psi4", {"method": "hf", "basis": "6-31G"}),
("qchem", {"method": "hf", "basis": "6-31G"}),
("rdkit", {"method": "UFF"}),
("torchani", {"method": "ANI1x"}),
("turbomole", {"method": "pbe", "basis": "6-31G"}),
("xtb", {"method": "GFN2-xTB"}),
("adcc", {"method": "adc2", "basis": "6-31G"}),
("gcp", {"method": "hf3c"}),
("mrchem", {"method": "blyp"}),
("dftd3", {"method": "b3lyp-d3"}, {}),
("qcore", {"method": "pbe", "basis": "6-31G"}, {}),
("molpro", {"method": "hf", "basis": "6-31G"}, {}),
("mopac", {"method": "PM6"}, {}),
("mp2d", {"method": "MP2-DMP2"}, {}),
("nwchem", {"method": "hf", "basis": "6-31G"}, {}),
("openmm", {"method": "openff-1.0.0", "basis": "smirnoff"}, {}),
("psi4", {"method": "hf", "basis": "6-31G"}, {}),
("qchem", {"method": "hf", "basis": "6-31G"}, {}),
("rdkit", {"method": "UFF"}, {}),
("torchani", {"method": "ANI1x"}, {}),
("turbomole", {"method": "pbe", "basis": "6-31G"}, {}),
("xtb", {"method": "GFN2-xTB"}, {}),
("adcc", {"method": "adc2", "basis": "6-31G"}, {"n_triplets": 3}),
("gcp", {"method": "hf3c"}, {}),
("mrchem", {"method": "blyp"}, {"world_prec": 1.e-3}),
]


Expand All @@ -37,28 +37,28 @@ def _get_molecule(program):
return qcng.get_molecule("hydrogen")


@pytest.mark.parametrize("program, model", _canonical_methods)
def test_compute_energy(program, model):
@pytest.mark.parametrize("program, model, keywords", _canonical_methods)
def test_compute_energy(program, model, keywords):
if not has_program(program):
pytest.skip("Program '{}' not found.".format(program))

molecule = _get_molecule(program)

inp = AtomicInput(molecule=molecule, driver="energy", model=model)
inp = AtomicInput(molecule=molecule, driver="energy", model=model, keywords=keywords)
ret = qcng.compute(inp, program, raise_error=True)

assert ret.success is True
assert isinstance(ret.return_result, float)


@pytest.mark.parametrize("program, model", _canonical_methods)
def test_compute_gradient(program, model):
@pytest.mark.parametrize("program, model, keywords", _canonical_methods)
def test_compute_gradient(program, model, keywords):
if not has_program(program):
pytest.skip("Program '{}' not found.".format(program))

molecule = _get_molecule(program)

inp = AtomicInput(molecule=molecule, driver="gradient", model=model, extras={"mytag": "something"})
inp = AtomicInput(molecule=molecule, driver="gradient", model=model, extras={"mytag": "something"}, keywords=keywords)
if program in ["adcc"]:
with pytest.raises(qcng.exceptions.InputError) as e:
ret = qcng.compute(inp, program, raise_error=True)
Expand Down

0 comments on commit fad214f

Please sign in to comment.