Skip to content

Commit

Permalink
cfour basis fixes (#465)
Browse files Browse the repository at this point in the history
* cfour basis fixes

* link check

* lint

* try releasing openmm and pint pin

* modern openmm
  • Loading branch information
loriab authored Jan 14, 2025
1 parent 3a01eb2 commit 7521e59
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ jobs:
runs-on: ubuntu-latest
pytest: ""

- conda-env: openmm
python-version: 3.12
label: OpenMM
runs-on: ubuntu-latest
pytest: ""

- conda-env: xtb
python-version: "3.10"
label: xTB
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -e '.[lint]'
- name: Print code formatting with black (hints here if next step errors)
run: black qcengine --diff .

- name: Lint
shell: bash
run: black qcengine --check
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/openmm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- psutil
- qcelemental >=0.11.1
- pydantic >=1.8.2
- pint <0.22
# - pint <0.22 # needed for a while see #416

# Testing
- pytest
Expand Down
2 changes: 2 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Enhancements
++++++++++++
- (:pr:`463`) Maint - Pin to QCElemental <0.70 since we now know QCSchema v2 release schedule.
- (:pr:`463`) MACE - New v0.3.9 release yields a pytorch error, so recommend pymace=0.3.6 .
- (:pr:`464`, :issue:`447`) CFOUR - Allow CC-PVDZ alias basis specification. Also fix the PwCVXZ
basis keyword. @philipmnel

Bug Fixes
+++++++++
Expand Down
16 changes: 16 additions & 0 deletions qcengine/programs/cfour/keywords.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,22 @@ def format_keyword(keyword: str, val: Any) -> Tuple[str, str]:
]:
text = str(val.lower())

# Transform the basis sets that *must* be mixedcase

# * manual: (keyword is cc-pVXZ or PVXZ, where X = D, T, Q, 5, and 6, respectively)
elif keyword in ["CFOUR_BASIS", "BASIS"] and val.upper() in [
"CC-PVDZ",
"CC-PVTZ",
"CC-PVQZ",
"CC-PV5Z",
"CC-PV6Z",
]:
text = val[:4].lower() + val[4:].upper()

# manual: (keyword is PwCVXZ, where X = D, T, and Q, respectively)
elif keyword in ["CFOUR_BASIS", "BASIS"] and val.upper() in ["PWCVDZ", "PWCVTZ", "PWCVQZ"]:
text = "Pw" + val[3:].upper()

# Transform the methods that *must* be mixed case
elif keyword in ["CFOUR_CALC_LEVEL", "CALC_LEVEL"] and val.upper() == "CCSDT-1B":
text = "CCSDT-1b"
Expand Down
2 changes: 1 addition & 1 deletion qcengine/programs/tests/test_dftd3_mp2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_dftd3_error():
input_data["driver"] = "properties"
ret = qcng.compute(input_data, "dftd3", raise_error=True)

assert "Driver properties not implemented" in str(exc.value)
assert "properties not implemented" in str(exc.value)

# Test extension
with pytest.raises(qcng.exceptions.InputError) as exc:
Expand Down
4 changes: 4 additions & 0 deletions qcengine/programs/tests/test_standard_suite_hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def nh2():
@pytest.mark.parametrize(
"program,basis,keywords",
[
pytest.param("cfour", "cC-pvdZ", {"scf_conv": 12}, marks=using("cfour")), # test basis handling, not results
pytest.param("cfour", "aug-pvdz", {"scf_conv": 12}, marks=using("cfour")),
pytest.param("cfour", "aug-pvdz", {}, marks=using("cfour")),
pytest.param(
Expand Down Expand Up @@ -66,6 +67,9 @@ def test_sp_hf_rhf(program, basis, keywords, h2o):
assert "provenance" in res
assert res["success"] is True

if basis == "cC-pvdZ":
return

# aug-cc-pvdz
scf_tot = -76.0413815332

Expand Down

0 comments on commit 7521e59

Please sign in to comment.