diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index bc69efa06..25b331cf5 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,56 +21,84 @@ jobs: cfg: - conda-env: psi python-version: 3.7 - label: Psi4-release + label: Psi4-1.5 runs-on: ubuntu-latest + pytest: "" - conda-env: psi-nightly python-version: "3.10" - label: Psi4-nightly + label: Psi4-1.6 runs-on: ubuntu-latest + pytest: "" + + - conda-env: psi-cf + python-version: "3.12" + label: Psi4-1.8 + runs-on: windows-latest + pytest: "-k 'not (hes2 or qchem)'" - conda-env: torchani python-version: 3.8 label: ANI runs-on: ubuntu-latest + pytest: "" - conda-env: openmm python-version: 3.8 label: OpenMM runs-on: ubuntu-latest + pytest: "" - conda-env: xtb python-version: "3.10" label: xTB runs-on: ubuntu-latest + pytest: "" - conda-env: qcore python-version: 3.7 label: QCore runs-on: ubuntu-latest + pytest: "" - conda-env: nwchem python-version: 3.8 - label: NWChem + label: NWChem70 runs-on: ubuntu-20.04 + pytest: "" # formerly NWChem v6.6 with python-version: 3.6 & runs-on: ubuntu-16.04 but ubuntu env retired by GH Sep 2021 + - conda-env: nwchem-cf + python-version: 3.12 + label: NWChem + runs-on: ubuntu-latest + pytest: "" + - conda-env: mrchem python-version: 3.8 label: MRChem runs-on: ubuntu-latest + pytest: "" - conda-env: adcc python-version: 3.8 label: ADCC runs-on: ubuntu-latest + pytest: "" - conda-env: opt-disp python-version: 3.8 label: optimization-dispersion runs-on: ubuntu-latest + pytest: "" + + - conda-env: opt-disp-cf + python-version: 3.11 + label: optimization-dispersion + runs-on: windows-latest + pytest: "-k 'not (hes2 or qchem)'" - name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }}" # • ${{ matrix.cfg.runs-on }}" + name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }} • ${{ matrix.cfg.runs-on }}" runs-on: ${{ matrix.cfg.runs-on }} steps: @@ -93,7 +121,7 @@ jobs: # note: any activate/deactivate use the conda cmd. other cmds use mamba cmd. - name: Special Config - NWChem - if: "(matrix.cfg.label == 'NWChem')" + if: "(matrix.cfg.label == 'NWChem70')" run: | sudo apt-get -y install nwchem @@ -102,23 +130,22 @@ jobs: run: | qcore --accept-license - # note: psi4 on c-f pins to a single qcel and qcng, so this may be handy for solve-and-replace - #- name: Special Config - QCElemental Dep - # if: (matrix.cfg.label == 'ADCC') - # run: | - # conda remove qcelemental --force - # python -m pip install qcelemental>=0.26.0 --no-deps + - name: Special Config - QCElemental Dep + if: false + run: | + conda remove qcelemental --force + python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@loriab-patch-2' --no-deps # note: conda remove --force, not mamba remove --force b/c https://github.com/mamba-org/mamba/issues/412 # alt. is micromamba but not yet ready for setup-miniconda https://github.com/conda-incubator/setup-miniconda/issues/75 - name: Special Config - QCEngine Dep - if: "(matrix.cfg.label == 'Psi4-nightly') || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')" + if: "(startsWith(matrix.cfg.label, 'Psi4')) || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')" run: | conda remove qcengine --force # QCEngine CI and Psi4 are circularly dependent, so a hack is in order - name: Special Config - Faux Pydantic Upgrade - if: "(matrix.cfg.label == 'Psi4-nightly') || (matrix.cfg.label == 'optimization-dispersion')" + if: "((matrix.cfg.label == 'Psi4-1.6') || (matrix.cfg.label == 'optimization-dispersion')) && (runner.os != 'Windows')" run: | sed -i s/from\ pydantic\ /from\ pydantic.v1\ /g ${CONDA_PREFIX}/lib/python${{ matrix.cfg.python-version }}/site-packages/psi4/driver/*py @@ -140,7 +167,7 @@ jobs: - name: PyTest run: | - pytest -rws -v --cov=qcengine --color=yes --cov-report=xml qcengine/ + pytest -rws -v ${{ matrix.cfg.pytest }} --cov=qcengine --color=yes --cov-report=xml qcengine/ - name: CodeCov uses: codecov/codecov-action@v3 diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml index 489ca4461..a6579f3cd 100644 --- a/.github/workflows/Lint.yml +++ b/.github/workflows/Lint.yml @@ -13,15 +13,15 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: ["3.10"] steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Python Setup - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: "${{ matrix.python-version }}" - name: Create Environment shell: bash diff --git a/devtools/conda-envs/nwchem-cf.yaml b/devtools/conda-envs/nwchem-cf.yaml new file mode 100644 index 000000000..8f4683fcc --- /dev/null +++ b/devtools/conda-envs/nwchem-cf.yaml @@ -0,0 +1,19 @@ +name: test +channels: + - conda-forge +dependencies: + - nwchem + + # Core + - python + - pyyaml + - py-cpuinfo + - psutil + - qcelemental >=0.24.0 + - pydantic>=1.0.0 + - networkx>=2.4.0 + + # Testing + - pytest + - pytest-cov + - codecov diff --git a/devtools/conda-envs/opt-disp-cf.yaml b/devtools/conda-envs/opt-disp-cf.yaml new file mode 100644 index 000000000..ff0fb1e09 --- /dev/null +++ b/devtools/conda-envs/opt-disp-cf.yaml @@ -0,0 +1,35 @@ +name: test +channels: + - conda-forge/label/libint_dev + - conda-forge + - nodefaults +dependencies: + - psi4 + - rdkit + - mopac + + # Mixed Tests + - dftd3-python + - dftd4-python + - gcp-correction + - geometric + - optking + - pymdi + + # Core + - python + - pyyaml + - py-cpuinfo + - psutil + - qcelemental >=0.26.0 + - pydantic=1.10.13 + - msgpack-python + + # Testing + - pytest + - pytest-cov + - codecov + + - pip + - pip: + - pyberny diff --git a/devtools/conda-envs/psi-cf.yaml b/devtools/conda-envs/psi-cf.yaml new file mode 100644 index 000000000..e28e200ad --- /dev/null +++ b/devtools/conda-envs/psi-cf.yaml @@ -0,0 +1,18 @@ +name: test +channels: + - conda-forge + - conda-forge/label/libint_dev +dependencies: + - psi4=1.8 + + # Core + - python + - pyyaml + - py-cpuinfo + - psutil + - msgpack-python + + # Testing + - pytest + - pytest-cov + - codecov diff --git a/devtools/conda-envs/psi-nightly.yaml b/devtools/conda-envs/psi-nightly.yaml index b175ec049..04d408993 100644 --- a/devtools/conda-envs/psi-nightly.yaml +++ b/devtools/conda-envs/psi-nightly.yaml @@ -3,7 +3,7 @@ channels: - psi4/label/dev - conda-forge dependencies: - - psi4 + - psi4=1.6 - blas=*=mkl # not needed but an example of disuading solver from openblas and old psi # Core diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 70833c1c2..0b25fcee7 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -25,11 +25,10 @@ Changelog .. WIP (Unmerged) .. ++++++++++++++ .. - UNMERGED (:pr:`421`) GAMESS - error handling and memory @taylor-a-barnes -.. - UNMERGED (:pr:`405`, :issue:`415`, :pr:`417`) Config - change default `jobs_per_node` from 2 to more expected 1 so a single job fills the node. Alter CPU count formula to return physical cores on Hyerthreading machines, affecting default `ncores`. The net effect (both changes) for default cores running on Hyperthreading machines is unchanged. @cvsik, @loriab .. - UNSOLVED (:issue:`397`) extras failed -v0.28.2 / 2023-MM-DD (Unreleased) +v0.29.0 / 2023-MM-DD (Unreleased) -------------------- Breaking Changes @@ -43,14 +42,21 @@ Enhancements Bug Fixes +++++++++ +- (:pr:`427`) Config - Once again, expand environment variables (now more flexibly) and newly expand ``~`` + passed into TaskConfig. Particularly relevant for scratch setting. @yueyericardo +- (:pr:`428`) MDI - Ensure that molecule orientation remains fixed for MDI. @taylor-a-barnes +- (:pr:`405`, :issue:`415`, :pr:`417`) Config - change default ``jobs_per_node`` from 2 to more expected 1 + so a single job fills the node. Alter CPU count formula to return physical cores on Hyerthreading + machines, affecting default ``ncores``. The net effect (both changes) for default cores running on + Hyperthreading machines is unchanged. @cvsik, @loriab +UNMERGED - (:pr:`433`) Turbomole, Q-Chem - Use raw strings when needed to avoid py312 warnings. Misc. +++++ +UNMERGED - (:pr:`433`) CI - Check py312 and some Windows lanes. MUST (Unmerged) +++++++++++++++ -- UNMERGED (:pr:`427`) Config - Once again, expand environment variables (now more flexibly) and newly expand ``~`` - passed into TaskConfig. Particularly relevant for scratch setting. v0.28.1 / 2023-08-18 diff --git a/qcengine/programs/qchem.py b/qcengine/programs/qchem.py index 79a03bdc8..0a743e115 100644 --- a/qcengine/programs/qchem.py +++ b/qcengine/programs/qchem.py @@ -358,7 +358,7 @@ def _parse_logfile_common(self, outtext: str, input_dict: Dict[str, Any]): properties["calcinfo_natom"] = len(input_dict["molecule"]["symbols"]) - mobj = re.search(r"\n\s*(\d+)\s+" + NUMBER + "\s+" + NUMBER + r"\s+Convergence criterion met\s*\n", outtext) + mobj = re.search(r"\n\s*(\d+)\s+" + NUMBER + r"\s+" + NUMBER + r"\s+Convergence criterion met\s*\n", outtext) if mobj: properties["scf_iterations"] = int(mobj.group(1)) diff --git a/qcengine/programs/tests/test_canonical_config.py b/qcengine/programs/tests/test_canonical_config.py index 192a4ea7b..72023850a 100644 --- a/qcengine/programs/tests/test_canonical_config.py +++ b/qcengine/programs/tests/test_canonical_config.py @@ -3,6 +3,7 @@ """ import pprint import re +import sys import tempfile from pathlib import Path @@ -182,6 +183,9 @@ def test_local_options_scratch(program, model, keywords): "nwchem": "E. Apra", # freebie "psi4": rf"Scratch directory: {scratch_directory}/tmp\w+_psi_scratch/", } + if sys.platform.startswith("win"): + # too hard to regex Windows paths that need escape chars + stdout_ref["psi4"] = f"Scratch directory: " # a scratch file (preferrably output) expected after job if scratch not cleaned up scratch_sample = { diff --git a/qcengine/programs/tests/test_standard_suite.py b/qcengine/programs/tests/test_standard_suite.py index ba9a00bb5..e2d3dae16 100644 --- a/qcengine/programs/tests/test_standard_suite.py +++ b/qcengine/programs/tests/test_standard_suite.py @@ -148,12 +148,12 @@ def _trans_key(qc, bas, key): pytest.param({"call": "cfour", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_conv": 12}, }, id="hf uhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "uhf", "fcae": "ae", "keywords": {"contrl__scftyp": "uhf"}, }, id="hf uhf ae: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"scf__uhf": True}, }, id="hf uhf ae: nwchem", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"scf__uhf": True, "scf__thresh": 1.0e-8}, }, id="hf uhf ae: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4_mp2qcsk")), pytest.param({"call": "cfour", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_conv": 12}, }, id="hf rohf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rohf", "fcae": "ae", "keywords": {"contrl__scftyp": "rohf"}, }, id="hf rohf ae: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"scf__rohf": True}, }, id="hf rohf ae: nwchem", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"scf__rohf": True, "scf__thresh": 1.0e-8}, }, id="hf rohf ae: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_type": "pk"}, }, id="hf rohf ae: psi4", marks=using("psi4_mp2qcsk")), # yapf: enable ], @@ -312,13 +312,13 @@ def test_hf_hessian_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_conv": 12}, }, id="mp2 uhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "uhf", "fcae": "ae", "keywords": {"contrl__scftyp": "uhf", "mp2__nacore": 0}, }, id="mp2 uhf ae: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__uhf": True}, }, id="mp2 uhf ae: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__uhf": True, "scf__thresh": 1.0e-8}, }, id="mp2 uhf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"scf__uhf": True}, }, id="mp2 uhf ae: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "mp2_type": "conv"}, }, id="mp2 uhf ae: psi4", marks=using("psi4_mp2qcsk")), pytest.param({"call": "cfour", "reference": "uhf", "fcae": "fc", "keywords": {"reference": "uhf", "dropmo": 1, "scf_conv": 12}, }, id="mp2 uhf fc: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "uhf", "fcae": "fc", "keywords": {"contrl__scftyp": "uhf"}, }, id="mp2 uhf fc: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"qc_module": "tce", "tce__freeze": 1, "scf__uhf": True}, }, id="mp2 uhf fc: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"qc_module": "tce", "tce__freeze": 1, "scf__uhf": True, "scf__thresh": 1.0e-8},}, id="mp2 uhf fc: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"scf__uhf": True, "mp2__freeze": 1}, }, id="mp2 uhf fc: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "uhf", "fcae": "fc", "keywords": {"reference": "uhf", "freeze_core": True, "mp2_type": "conv"}, }, id="mp2 uhf fc: psi4", marks=using("psi4_mp2qcsk")), pytest.param({"call": "qchem", "reference": "uhf", "fcae": "fc", "keywords": {"N_frozen_CORE": "fC"}, }, id="mp2 uhf fc: qchem", marks=using("qchem")), @@ -332,7 +332,7 @@ def test_hf_hessian_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "rohf", "fcae": "fc", "keywords": {"reference": "rohf", "dropmo": 1, "scf_conv": 12}, }, id="mp2 rohf fc: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rohf", "fcae": "fc", "keywords": {"contrl__scftyp": "rohf", "mp2__ospt": "RMP"}, }, id="mp2 rohf fc: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "keywords": {"qc_module": "tce", "tce__freeze": 1, "scf__rohf": True}, "wrong": {0: _w1 }}, id="mp2 rohf fc: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "keywords": {"qc_module": "tce", "tce__freeze": 1, "scf__rohf": True, "scf__thresh": 1.0e-8},"wrong": {0: _w1 }}, id="mp2 rohf fc: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "keywords": {"scf__rohf": True, "mp2__freeze": 1}, "error": {0: _q1 }}, id="mp2 rohf fc: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "rohf", "fcae": "fc", "keywords": {"reference": "rohf", "freeze_core": True, "mp2_type": "conv"}, }, id="mp2 rohf fc: psi4", marks=using("psi4_mp2qcsk")), # yapf: enable @@ -394,7 +394,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "uhf", "fcae": "ae", "keywords": {"REFerence": "UHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "ecc"}, }, id="ccsd uhf ae: cfour-ecc", marks=using("cfour")), # pytest.param({"call": "cfour", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf"}, }, id="ccsd uhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "uhf", "fcae": "ae", "keywords": {"contrl__scftyp": "uhf", "ccinp__ncore": 0}, "error": {0: _q2 }}, id="ccsd uhf ae: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__uhf": True}, }, id="ccsd uhf ae: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__uhf": True, "scf__thresh": 1.0e-8}, }, id="ccsd uhf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "ae", "keywords": {"scf__uhf": True}, "error": {0: _q3 }}, id="ccsd uhf ae: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf"}, }, id="ccsd uhf ae: psi4", marks=using("psi4_mp2qcsk")), @@ -402,7 +402,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "uhf", "fcae": "fc", "keywords": {"dropmo": [1], "REFerence": "UHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "ecc"}, }, id="ccsd uhf fc: cfour-ecc", marks=using("cfour")), # pytest.param({"call": "cfour", "reference": "uhf", "fcae": "fc", "keywords": {"dropmo": 1, "reference": "uhf"}, }, id="ccsd uhf fc: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "uhf", "fcae": "fc", "keywords": {"contrl__scftyp": "uhf"}, "error": {0: _q2 }}, id="ccsd uhf fc: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"tce__freeze": 1, "qc_module": "tce", "scf__uhf": True}, }, id="ccsd uhf fc: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"tce__freeze": 1, "qc_module": "tce", "scf__uhf": True, "scf__thresh": 1.0e-8}, }, id="ccsd uhf fc: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "uhf", "fcae": "fc", "keywords": {"ccsd__freeze": 1, "scf__uhf": True}, "error": {0: _q3 }}, id="ccsd uhf fc: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "uhf", "fcae": "fc", "keywords": {"freeze_core": True, "reference": "uhf"}, }, id="ccsd uhf fc: psi4", marks=using("psi4_mp2qcsk")), @@ -410,7 +410,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "rohf", "fcae": "ae", "keywords": {"REFerence": "roHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "ecc"}, }, id="ccsd rohf ae: cfour-ecc", marks=using("cfour")), # pytest.param({"call": "cfour", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf"}, }, id="ccsd rohf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rohf", "fcae": "ae", "keywords": {"contrl__scftyp": "rohf", "ccinp__ncore": 0, "ccinp__maxcc": 50}, }, id="ccsd rohf ae: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__rohf": True}, }, id="ccsd rohf ae: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__rohf": True, "scf__thresh": 1.0e-8}, }, id="ccsd rohf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"scf__rohf": True}, "error": {0: _q3 }}, id="ccsd rohf ae: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "sdsc": "sd", "keywords": {"reference": "rohf", "qc_module": "ccenergy"}, }, id="ccsd rohf ae: psi4", marks=using("psi4_mp2qcsk")), # TODO another way for ccenergy? (fc, too) @@ -418,7 +418,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "cfour", "reference": "rohf", "fcae": "fc", "sdsc": "sd", "keywords": {"dropmo": [1], "REFerence": "roHF", "SCF_CONV": 12, "CC_CONV": 12, "orbitals": 0, "cc_program": "ecc"}, }, id="ccsd rohf fc: cfour-ecc", marks=using("cfour")), # pytest.param({"call": "cfour", "reference": "rohf", "fcae": "fc", "sdsc": "sd", "keywords": {"dropmo": 1, "reference": "rohf", "orbitals": 0}, }, id="ccsd rohf fc: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rohf", "fcae": "fc", "keywords": {"contrl__scftyp": "rohf", "ccinp__iconv": 9, "scf__conv": 9}, "wrong": {0: _w2 }}, id="ccsd rohf fc: gamess", marks=using("gamess")), - pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "sdsc": "sd", "keywords": {"tce__freeze": 1, "qc_module": "tce", "scf__rohf": True}, }, id="ccsd rohf fc: nwchem-tce", marks=using("nwchem")), + pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "sdsc": "sd", "keywords": {"tce__freeze": 1, "qc_module": "tce", "scf__rohf": True, "scf__thresh": 1.0e-8}, }, id="ccsd rohf fc: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "fc", "keywords": {"ccsd__freeze": 1, "scf__rohf": True}, "error": {0: _q3 }}, id="ccsd rohf fc: nwchem", marks=using("nwchem")), pytest.param({"call": "psi4", "reference": "rohf", "fcae": "fc", "sdsc": "sd", "keywords": {"e_convergence": 8, "r_convergence": 7, "freeze_core": True, "reference": "rohf", "qc_module": "ccenergy"}, }, id="ccsd rohf fc: psi4", marks=using("psi4_mp2qcsk")), # yapf: enable diff --git a/qcengine/programs/turbomole/harvester.py b/qcengine/programs/turbomole/harvester.py index 19a22b9a3..0637a78c8 100644 --- a/qcengine/programs/turbomole/harvester.py +++ b/qcengine/programs/turbomole/harvester.py @@ -8,7 +8,7 @@ def parse_decimal(regex, text, method="search"): - with_float = re.compile(regex + "([\d\-\.]+)") + with_float = re.compile(regex + r"([\d\-\.]+)") matches = getattr(with_float, method)(text) if method == "search": @@ -21,7 +21,7 @@ def parse_reference_energy(stdout: str): energy_dict = PreservingDict() # Total energy from dscf or ridft - total_energy_re = re.compile("total energy\s+=\s+([\d\-\.]+)") + total_energy_re = re.compile(r"total energy\s+=\s+([\d\-\.]+)") mobj = total_energy_re.search(stdout) total_energy = Decimal(mobj[1]) @@ -46,9 +46,9 @@ def parse_ricc2(stdout: str): # As CC2 starts from a MP2 guess that is also reported there may be # multiple matches for the following regex. Thats why we capture all # matches with 'findall'. - matches = parse_decimal("Final (.+?) energy\s+:\s+", stdout, "findall") + matches = parse_decimal(r"Final (.+?) energy\s+:\s+", stdout, "findall") if len(matches) == 0: - matches = parse_decimal("E(MP2)\s+:\s+", stdout, "search") + matches = parse_decimal(r"E(MP2)\s+:\s+", stdout, "search") ricc2_dict["CURRENT ENERGY"] = matches[-1][1] @@ -57,11 +57,11 @@ def parse_ricc2(stdout: str): def parse_gradient(gradient): grad_re = re.compile( - "\$grad.+" - "cycle =\s+(?P\d+)\s+" - "(?P.+?) energy =\s+(?P[\d\.\-]+)\s+" - "\|dE/dxyz\| =\s+(?P[\d\.]+)" - "(?P.+)\$end", + r"\$grad.+" + r"cycle =\s+(?P\d+)\s+" + r"(?P.+?) energy =\s+(?P[\d\.\-]+)\s+" + r"\|dE/dxyz\| =\s+(?P[\d\.]+)" + r"(?P.+)\$end", re.DOTALL, ) mobj = grad_re.match(gradient) diff --git a/qcengine/programs/turbomole/runner.py b/qcengine/programs/turbomole/runner.py index 8c56e73a6..43e2139e2 100644 --- a/qcengine/programs/turbomole/runner.py +++ b/qcengine/programs/turbomole/runner.py @@ -51,7 +51,7 @@ def get_version(self) -> str: tmpdir = Path(tmpdir) stdout = execute_define("\n", cwd=tmpdir) # Tested with V7.3 and V7.4.0 - version_re = re.compile("TURBOMOLE (?:rev\. )?(V.+?)\s+") + version_re = re.compile(r"TURBOMOLE (?:rev\. )?(V.+?)\s+") mobj = version_re.search(stdout) version = mobj[1] self.version_cache[which_prog] = safe_version(version) @@ -77,7 +77,7 @@ def sub_control(self, control, pattern, repl, **kwargs): return control_subbed def append_control(self, control, to_append): - return self.sub_control(control, "\$end", f"{to_append}\n$end") + return self.sub_control(control, r"\$end", f"{to_append}\n$end") def build_input( self, input_model: "AtomicInput", config: "TaskConfig", template: Optional[str] = None @@ -164,7 +164,7 @@ def build_input( ricore = mem_mb * ri_fraction ri_per_core = int(ricore / config.ncores) # Update $ricore entry in the control file - control = self.sub_control(control, "\$ricore\s+(\d+)", f"$ricore {ri_per_core} MiB per_core") + control = self.sub_control(control, r"\$ricore\s+(\d+)", f"$ricore {ri_per_core} MiB per_core") # Calculate remaining memory maxcor = mem_mb - ricore assert maxcor > 0, "Not enough memory for maxcor! Need {-maxcor} MB more!" @@ -172,7 +172,7 @@ def build_input( # maxcore per_core per_core = int(maxcor / config.ncores) # Update $maxcor entry in the control file - control = self.sub_control(control, "\$maxcor\s+(\d+)\s+MiB\s+per_core", f"$maxcor {per_core} MiB per_core") + control = self.sub_control(control, r"\$maxcor\s+(\d+)\s+MiB\s+per_core", f"$maxcor {per_core} MiB per_core") ############################ # DETERMINE SHELL COMMANDS # diff --git a/qcengine/testing.py b/qcengine/testing.py index 3f7ff1ff7..d16755855 100644 --- a/qcengine/testing.py +++ b/qcengine/testing.py @@ -12,7 +12,7 @@ import qcengine as qcng -QCENGINE_RECORDS_COMMIT = "0e2fdb4" +QCENGINE_RECORDS_COMMIT = "19b843b" def _check_qcenginerecords(return_data=False): diff --git a/setup.py b/setup.py index 92965b94c..d5a268c10 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ cmdclass=versioneer.get_cmdclass(), packages=setuptools.find_packages(), setup_requires=[] + pytest_runner, - install_requires=["pyyaml", "py-cpuinfo", "psutil", "qcelemental>=0.24.0,<0.27.0", "pydantic>=1.8.2"], + install_requires=["pyyaml", "py-cpuinfo", "psutil", "qcelemental>=0.24.0,<0.28.0", "pydantic>=1.8.2"], entry_points={"console_scripts": ["qcengine=qcengine.cli:main"]}, extras_require={ "docs": [ @@ -52,6 +52,7 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ], zip_safe=False, long_description=long_description,