Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfour basis fixes #465

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading