diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index dfbfc0920..385fa546c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -142,11 +142,11 @@ jobs: # pytest: "" # DOWNLOAD problem Mar 2026 - #- conda-env: mace - # python-version: "3.10" - # label: MACE - # runs-on: ubuntu-latest - # pytest: "" + - conda-env: mace + python-version: "3.13" + label: MACE + runs-on: ubuntu-latest + pytest: "" - conda-env: aimnet2 python-version: 3.11 @@ -205,7 +205,7 @@ jobs: run: | # conda remove qcelemental --force # python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@next2026' --no-deps - conda install "conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3" + conda install "conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc4" # 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 @@ -254,7 +254,7 @@ jobs: python -c "import qcelemental as q;print(q.__file__, q.__version__)" python -c "import qcengine as q;print(q.__file__, q.__version__)" git describe - git log --oneline + # git log --oneline - name: Special Config - Windows Psi4 if: "(((matrix.cfg.label == 'optimization-dispersion') || (matrix.cfg.label == 'Psi4-1.8')) && (matrix.cfg.runs-on == 'windows-latest'))" @@ -286,12 +286,12 @@ jobs: - name: PyTest run: | # export MKL_CBWR=AVX - pytest -rws -v ${{ matrix.cfg.pytest }} --cov=qcengine --color=yes --cov-report=xml qcengine/ + pytest -rws -v ${{ matrix.cfg.pytest }} --cov=qcengine --durations=20 --durations-min=40 --strict-markers --color=yes --cov-report=xml qcengine/ - name: PyTest - Task_Config run: | rm -f qcengine.yaml - pytest -rws -v -k "test_config" --cov=qcengine --color=yes --cov-report=xml qcengine/ + pytest -rws -v -k "test_config" --cov=qcengine --strict-markers --color=yes --cov-report=xml qcengine/ - name: CodeCov uses: codecov/codecov-action@v4 diff --git a/devtools/conda-envs/adcc.yaml b/devtools/conda-envs/adcc.yaml index 432ec0aa5..77da9417d 100644 --- a/devtools/conda-envs/adcc.yaml +++ b/devtools/conda-envs/adcc.yaml @@ -6,12 +6,14 @@ channels: dependencies: - adcc>=0.15.7 - psi4>=1.8.1 + - libint=2.9.0=*_4 # Core - python - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental>=0.50.0rc4 + - qcmanybody>=0.7.0 - pydantic=2 - pydantic-settings - msgpack-python diff --git a/devtools/conda-envs/aimnet2.yaml b/devtools/conda-envs/aimnet2.yaml index fcd1514f2..6f1036b53 100644 --- a/devtools/conda-envs/aimnet2.yaml +++ b/devtools/conda-envs/aimnet2.yaml @@ -9,7 +9,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2.0.0 - pydantic-settings diff --git a/devtools/conda-envs/mace.yaml b/devtools/conda-envs/mace.yaml index d58c12e73..f31d00a46 100644 --- a/devtools/conda-envs/mace.yaml +++ b/devtools/conda-envs/mace.yaml @@ -7,7 +7,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2.0.0 - pydantic-settings diff --git a/devtools/conda-envs/mrchem.yaml b/devtools/conda-envs/mrchem.yaml index 0c302fe84..ab9913e18 100644 --- a/devtools/conda-envs/mrchem.yaml +++ b/devtools/conda-envs/mrchem.yaml @@ -12,7 +12,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic=2 - pydantic-settings - setuptools <82.0 # for berny diff --git a/devtools/conda-envs/nwchem-cf.yaml b/devtools/conda-envs/nwchem-cf.yaml index 83689ae7a..1944827a1 100644 --- a/devtools/conda-envs/nwchem-cf.yaml +++ b/devtools/conda-envs/nwchem-cf.yaml @@ -9,7 +9,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2.0.0 - networkx>=2.4.0 - qcmanybody diff --git a/devtools/conda-envs/nwchem.yaml b/devtools/conda-envs/nwchem.yaml index 11c54f58a..ca05cee33 100644 --- a/devtools/conda-envs/nwchem.yaml +++ b/devtools/conda-envs/nwchem.yaml @@ -7,7 +7,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2.0.0 - networkx>=2.4.0 - pydantic-settings diff --git a/devtools/conda-envs/openmm.yaml b/devtools/conda-envs/openmm.yaml index bff19d770..b5fc4569b 100644 --- a/devtools/conda-envs/openmm.yaml +++ b/devtools/conda-envs/openmm.yaml @@ -18,7 +18,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic >=2 - pydantic-settings # - pint <0.22 # needed for a while see #416 diff --git a/devtools/conda-envs/opt-disp-cf.yaml b/devtools/conda-envs/opt-disp-cf.yaml index d0e7c14ee..5a5ab1f85 100644 --- a/devtools/conda-envs/opt-disp-cf.yaml +++ b/devtools/conda-envs/opt-disp-cf.yaml @@ -7,6 +7,7 @@ dependencies: - rdkit # - rdkit<=2025.03.4 # Windows+psi4 error with 03.5 # sometimes fine, sometimes flaky even w/exactly same packages in env - mopac + - libint=2.9.0=*_4 # old (1.10=*_2) psi4 to release qcmb constraint to use new qcnb (0.7) with new qcel (rc4) # Mixed Tests - dftd3-python @@ -15,7 +16,7 @@ dependencies: - geometric=1.0 - optking - pymdi - - qcmanybody + - qcmanybody>=0.7.0 - pyberny - setuptools <82.0 # for berny @@ -24,7 +25,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental>=0.50.0rc4 - pydantic=2 - pydantic-settings - msgpack-python diff --git a/devtools/conda-envs/opt-disp.yaml b/devtools/conda-envs/opt-disp.yaml index ef315987c..8e01f782e 100644 --- a/devtools/conda-envs/opt-disp.yaml +++ b/devtools/conda-envs/opt-disp.yaml @@ -27,7 +27,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - msgpack-python # Testing diff --git a/devtools/conda-envs/psi-cf.yaml b/devtools/conda-envs/psi-cf.yaml index 6ef2c6de2..61b70a9ca 100644 --- a/devtools/conda-envs/psi-cf.yaml +++ b/devtools/conda-envs/psi-cf.yaml @@ -9,7 +9,7 @@ dependencies: - numpy<2 - libgcc<14.3 # until psi4 package itself conveys this - pydantic-settings - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental # Core - python diff --git a/devtools/conda-envs/psi-nightly.yaml b/devtools/conda-envs/psi-nightly.yaml index 28a6bc563..66ad57539 100644 --- a/devtools/conda-envs/psi-nightly.yaml +++ b/devtools/conda-envs/psi-nightly.yaml @@ -13,7 +13,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2.0.0 - pydantic-settings - msgpack-python diff --git a/devtools/conda-envs/torchani.yaml b/devtools/conda-envs/torchani.yaml index 5d608478b..c381bfe14 100644 --- a/devtools/conda-envs/torchani.yaml +++ b/devtools/conda-envs/torchani.yaml @@ -10,7 +10,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic>=2 - pydantic-settings diff --git a/devtools/conda-envs/xtb.yaml b/devtools/conda-envs/xtb.yaml index 0fc81c133..4653bc468 100644 --- a/devtools/conda-envs/xtb.yaml +++ b/devtools/conda-envs/xtb.yaml @@ -10,7 +10,7 @@ dependencies: - pyyaml - py-cpuinfo - psutil - - conda-forge/label/qcelemental_dev::qcelemental=0.50.0rc3 + - conda-forge/label/qcelemental_dev::qcelemental - pydantic >=2 - pydantic-settings diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index dea64527f..95bcddf99 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -32,6 +32,34 @@ Changelog .. - UNSOLVED (:issue:`397`) extras failed +.. _`sec:cl0500rc3`: + +v0.50.0rc3 / 2026-04-02 (Prerelease) +------------------------------------ + +:docs:`v0.50.0rc3` for current. :docs:`v0.34.1` for QCSchema v1. + +New Features +++++++++++++ +- (:pr:`499`) Testing - Program names are now pytest markers, so `pytest -m openmm` + thoroughly collects all tests involving that program. Note that the nearly + retired harnesses for Grimme programs have markers "classic-dftd3" and "classic-gcp". + +Enhancements +++++++++++++ +- (:pr:`499`) QCElemental - Update encoding=json to mode=json in serialization + calls to match QCElemental v0.50.0rc4 changes. +- (:pr:`499`) DFTD3, DFTD4 - Allow running in QCSchema v2 mode for WIP upstream versions. + Note that QCEngine-added input extras appear in `AtomicResult.input_data.specification.extras`, + formerly `AtomicResult.extras`, even routing through older (pre-v1.3, v4.1) programs. +- (:pr:`499`) GCP, MP2D - Update model_copy and casting of energy for qcel rc3 and Pydantic v2. + +Bug Fixes ++++++++++ +- (:pr:`499`) Psi4 - Fix Psi4 detected but not registered error arising from parsing + of version and paths being obscured by QCSchema/Pydantic Warnings. + + .. _`sec:cl0500rc2`: v0.50.0rc2 / 2026-03-13 (Prerelease) diff --git a/pyproject.toml b/pyproject.toml index 007cd4d15..a5736dc1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ dependencies = [ "pyyaml", "py-cpuinfo", "psutil", - "qcelemental>=0.50.0rc3,<0.70.0", + "qcelemental>=0.50.0rc4,<0.70.0", "pydantic >=2.11; python_version <'3.14'", "pydantic >=2.12; python_version >='3.14'", "pydantic-settings", @@ -105,4 +105,41 @@ markers = [ "long", """slow: marks tests as slow (deselect with '-m "not slow"')""", "smoke", + 'addon: "tests require external non-required software"', + + "adcc: tests using adcc software; skip if unavailable", + "aimnet2: tests using AIMNET2 software; skip if unavailable", + "berny: tests using pyberny software; skip if unavailable", + "cfour: tests using Cfour software; skip if unavailable", + "classic-dftd3: tests using DFTD3 executable software; skip if unavailable", + "classic-dftd3_321: tests using DFTD3 classic executable >=v3.2.1 software; skip if unavailable", + "s-dftd3: tests using modern simple-dftd3 software; skip if unavailable", + "dftd4: tests using DFTD4 software; skip if unavailable", + "dftd4_350: tests using DFTD4 >=3.5.0 software; skip if unavailable", + "gamess: tests using GAMESS-US software; skip if unavailable", + "mctc-gcp: tests using modern mctc-gcp software; skip if unavailable", + "classic-gcp: tests using GCP executable software; skip if unavailable", + "geometric: tests using geomeTRIC software; skip if unavailable", + "mace: tests using MACE software; skip if unavailable", + "mdi: tests using MDI software; skip if unavailable", + "molpro: tests using Molpro software; skip if unavailable", + "mopac: tests using Mopac software; skip if unavailable", + "mp2d: tests using MP2D software; skip if unavailable", + "mrchem: tests using MR-Chem software; skip if unavailable", + "nwchem: tests using NWChem Classic software; skip if unavailable", + "openmm: tests using OpenMM software; skip if unavailable", + "optking: tests using OptKing software; skip if unavailable", + "optking_v2: tests using OptKing QCSchema-v2-compatible software; skip if unavailable", + "psi4: tests using Psi4 software; skip if unavailable", + "qcdb: tests using QCDB software; skip if unavailable", + "qchem: tests using Q-Chem software; skip if unavailable", + "qcmanybody: tests using QCManyBody software; skip if unavailable", + "qcore: tests using Qcore (ret.) software; skip if unavailable", + "rdkit: tests using RDKIT software; skip if unavailable", + "terachem: tests using TeraChem software; skip if unavailable", + "terachem_pbs: tests using TeraChem through PBS software; skip if unavailable", + "torchani: tests using Torch-ANI software; skip if unavailable", + "torsiondrive: tests using TorsionDrive software; skip if unavailable", + "turbomole: tests using Turbomole software; skip if unavailable", + "xtb: tests using xTB software; skip if unavailable", ] diff --git a/qcengine/programs/adcc.py b/qcengine/programs/adcc.py index 20d4a6e0a..08c735c18 100644 --- a/qcengine/programs/adcc.py +++ b/qcengine/programs/adcc.py @@ -115,7 +115,7 @@ def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicRe except Exception as e: raise UnknownError(str(e)) - input_data = input_model.model_dump(encoding="json") + input_data = input_model.model_dump(mode="json") output_data = {"input_data": input_data, "extras": {}, "molecule": mol} output_data["success"] = compute_success diff --git a/qcengine/programs/dftd3.py b/qcengine/programs/dftd3.py index 4f2827732..447fedabc 100644 --- a/qcengine/programs/dftd3.py +++ b/qcengine/programs/dftd3.py @@ -277,7 +277,7 @@ def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") -> # jobrec["molecule"]["real"] = list(jobrec["molecule"]["real"]) retres = calcinfo[f"CURRENT {input_model.specification.driver.upper()}"] - if isinstance(retres, Decimal): + if isinstance(retres, (str, Decimal)): retres = float(retres) elif isinstance(retres, np.ndarray): retres = retres.ravel().tolist() diff --git a/qcengine/programs/dftd_ng.py b/qcengine/programs/dftd_ng.py index 97f1be391..467b92169 100644 --- a/qcengine/programs/dftd_ng.py +++ b/qcengine/programs/dftd_ng.py @@ -104,20 +104,40 @@ def compute(self, input_model: AtomicInput, config: TaskConfig) -> AtomicResult: level_hint = "d4" input_data["specification"]["keywords"]["level_hint"] = level_hint - # dftd4 speaks qcsk.v1 - input_model_v1 = qcelemental.models.v2.AtomicInput(**input_data).convert_v(1) + if parse_version(self.get_version()) < parse_version("4.1.0"): + # dftd4 speaks qcsk.v1 + input_model_v1 = qcelemental.models.v2.AtomicInput(**input_data).convert_v(1) - # Run the Harness - output_v1 = run_qcschema(input_model_v1) + # Run the Harness + output_v1 = run_qcschema(input_model_v1) - # d4 qcschema interface stores error in Result model - if not output_v1.success: - return FailedOperation(input_data=input_data, error=output_v1.error.model_dump()) + # d4 qcschema interface stores error in Result model + if not output_v1.success: + return FailedOperation(input_data=input_data, error=output_v1.error.model_dump()) - output = output_v1.convert_v(2, external_input_data=input_model) + # Unclear whether external_input_data should be input_model (user input in v2) or input_data + # (user input + processing above with tweaks and hints). Former seems cleaner (and works) + # but places "extras.info" differently in pre-/post-1.3.0 routes, so using latter. + output = output_v1.convert_v(2, external_input_data=input_data) - if "info" in output.extras: - qcvkey = output.extras["info"]["fctldash"].upper() + else: + # dftd4 >4.1 speaks qcsk.v1 or qcsk.v2 + input_model_v2 = qcelemental.models.v2.AtomicInput(**input_data) + + # Run the Harness + output_v2 = run_qcschema(input_model_v2) + + # d4 qcschema interface stores error in Result model + # TODO + if not output_v2.success: + # return FailedOperation(input_data=input_data, error=output_v2.error.model_dump()) + return output_v2 + + output = output_v2 + + if "info" in output.input_data.specification.extras: + # formerly output.extras["info"] + qcvkey = output.input_data.specification.extras["info"]["fctldash"].upper() calcinfo = {} energy = output.properties.return_energy @@ -279,20 +299,40 @@ def compute(self, input_model: AtomicInput, config: TaskConfig) -> AtomicResult: input_data["specification"]["keywords"]["params_tweaks"] = {**planinfo["dashparams"], "s9": 0.0} input_data["specification"]["keywords"]["level_hint"] = level_hint - # sdftd3 speaks qcsk.v1 - input_model_v1 = qcelemental.models.v2.AtomicInput(**input_data).convert_v(1) + if parse_version(self.get_version()) < parse_version("1.3.0"): + # sdftd3 speaks qcsk.v1 + input_model_v1 = qcelemental.models.v2.AtomicInput(**input_data).convert_v(1) + + # Run the Harness + output_v1 = run_qcschema(input_model_v1) + + # d3 qcschema interface stores error in Result model + if not output_v1.success: + return FailedOperation(input_data=input_data, error=output_v1.error.model_dump()) + + # Unclear whether external_input_data should be input_model (user input in v2) or input_data + # (user input + processing above with tweaks and hints). Former seems cleaner (and works) + # but places "extras.info" differently in pre-/post-1.3.0 routes, so using latter. + output = output_v1.convert_v(2, external_input_data=input_data) + + else: + # sdftd3 >1.3.0??? speaks qcsk.v1 or qcsk.v2 + input_model_v2 = qcelemental.models.v2.AtomicInput(**input_data) - # Run the Harness - output_v1 = run_qcschema(input_model_v1) + # Run the Harness + output_v2 = run_qcschema(input_model_v2) - # d3 qcschema interface stores error in Result model - if not output_v1.success: - return FailedOperation(input_data=input_data, error=output_v1.error.model_dump()) + # d3 qcschema interface stores error in Result model + # TODO + if not output_v2.success: + # return FailedOperation(input_data=input_data, error=output_v2.error.model_dump()) + return output_v2 - output = output_v1.convert_v(2, external_input_data=input_model) + output = output_v2 - if "info" in output.extras: - qcvkey = output.extras["info"]["fctldash"].upper() + if "info" in output.input_data.specification.extras: + # formerly output.extras["info"] + qcvkey = output.input_data.specification.extras["info"]["fctldash"].upper() calcinfo = {} energy = output.properties.return_energy diff --git a/qcengine/programs/gcp.py b/qcengine/programs/gcp.py index de6172ea5..819c97f83 100644 --- a/qcengine/programs/gcp.py +++ b/qcengine/programs/gcp.py @@ -198,7 +198,7 @@ def build_input( "outfiles": ["gcp_gradient"], "scratch_messy": config.scratch_messy, "scratch_directory": config.scratch_directory, - "input_result": input_model.copy(deep=True), + "input_result": input_model.model_copy(deep=True), "blocking_files": [os.path.join(pathlib.Path.home(), ".gcppar." + socket.gethostname())], } @@ -260,7 +260,7 @@ def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") -> calcinfo = {k.upper(): str(v) if isinstance(v, Decimal) else v for k, v in calcinfo.items()} retres = calcinfo[f"CURRENT {input_model.specification.driver.upper()}"] - if isinstance(retres, Decimal): + if isinstance(retres, (str, Decimal)): retres = float(retres) elif isinstance(retres, np.ndarray): retres = retres.ravel().tolist() diff --git a/qcengine/programs/mp2d.py b/qcengine/programs/mp2d.py index 8e22d566f..1e31dec95 100644 --- a/qcengine/programs/mp2d.py +++ b/qcengine/programs/mp2d.py @@ -142,7 +142,7 @@ def build_input( "outfiles": ["mp2d_gradient"], "scratch_messy": config.scratch_messy, "scratch_directory": config.scratch_directory, - "input_result": input_model.copy(deep=True), + "input_result": input_model.model_copy(deep=True), } def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") -> "AtomicResult": @@ -209,7 +209,7 @@ def parse_output(self, outfiles: Dict[str, str], input_model: "AtomicInput") -> # jobrec["molecule"]["real"] = list(jobrec["molecule"]["real"]) retres = calcinfo[f"CURRENT {input_model.specification.driver.upper()}"] - if isinstance(retres, Decimal): + if isinstance(retres, (str, Decimal)): retres = float(retres) elif isinstance(retres, np.ndarray): retres = retres.ravel().tolist() diff --git a/qcengine/programs/psi4.py b/qcengine/programs/psi4.py index f06700f29..cd0010961 100644 --- a/qcengine/programs/psi4.py +++ b/qcengine/programs/psi4.py @@ -75,6 +75,8 @@ def found(raise_error: bool = False) -> bool: with popen([sys.executable, "-c", "import psi4; print(psi4.executable)"]) as exc: exc["proc"].wait(timeout=30) so, se, rc = exc["stdout"].strip(), exc["stderr"], exc["proc"].returncode + if "active but incompatible with Python 3.14+" in se: + se = None error_msg = f" In particular, psi4 module found but unable to load psi4 command into PATH. stdout: {so}, stderr: {se}" # yes, everthing up to here could be got from `import psi4; psiexe = psi4.executable`. but, we try not to # load programs/modules in the `def found` fns. @@ -170,7 +172,7 @@ def compute(self, input_model: "AtomicInput", config: "TaskConfig") -> "AtomicRe if pversion < parse_version("1.4a2.dev160"): # Setup the job - input_data = input_model.model_dump(encoding="json") + input_data = input_model.model_dump(mode="json") input_data["nthreads"] = config.ncores input_data["memory"] = int(config.memory * 1024 * 1024 * 1024 * 0.95) # Memory in bytes input_data["success"] = False diff --git a/qcengine/programs/tests/test_adcc.py b/qcengine/programs/tests/test_adcc.py index c3fe7d74d..a320dbca9 100644 --- a/qcengine/programs/tests/test_adcc.py +++ b/qcengine/programs/tests/test_adcc.py @@ -5,7 +5,7 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing @pytest.fixture @@ -17,7 +17,7 @@ def h2o_data(): """ -@using("adcc") +@uusing("adcc") def test_run(h2o_data, schema_versions, request): models, retver, _ = schema_versions h2o = models.Molecule.from_data(h2o_data) diff --git a/qcengine/programs/tests/test_alignment.py b/qcengine/programs/tests/test_alignment.py index e8e49ff9a..0a1872dba 100644 --- a/qcengine/programs/tests/test_alignment.py +++ b/qcengine/programs/tests/test_alignment.py @@ -84,12 +84,12 @@ def clsd_open_pmols(schema_versions): pytest.param({"call": "cfour", "reference": "rhf", "fcae": "ae", "keywords": {"scf_conv": 12}, }, id="hf rhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {"scf__thresh": 1.e-6}, }, id="hf rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4_derqcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4")), 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, "scf__thresh": 1.e-6}, }, 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_derqcsk")), + pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4")), # yapf: enable ], ) diff --git a/qcengine/programs/tests/test_canonical_config.py b/qcengine/programs/tests/test_canonical_config.py index 1fcc46577..cd93252c2 100644 --- a/qcengine/programs/tests/test_canonical_config.py +++ b/qcengine/programs/tests/test_canonical_config.py @@ -10,22 +10,22 @@ import pytest import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, has_program, schema_versions +from qcengine.testing import checkver_and_convert, from_v2, has_program, schema_versions, using _canonical_methods = [ # needs attn ("adcc", {"method": "adc2", "basis": "6-31G"}, {"n_triplets": 3}), - ("cfour", {"method": "hf", "basis": "6-31G"}, {}), - ("dftd3", {"method": "b3lyp-d3"}, {}), - ("gamess", {"method": "hf", "basis": "n31"}, {"basis__NGAUSS": 6}), - ("gcp", {"method": "hf3c"}, {}), - ("mctc-gcp", {"method": "dft/sv"}, {}), + pytest.param("cfour", {"method": "hf", "basis": "6-31G"}, {}, marks=using("cfour")), + pytest.param("dftd3", {"method": "b3lyp-d3"}, {}, marks=using("classic-dftd3")), + pytest.param("gamess", {"method": "hf", "basis": "n31"}, {"basis__NGAUSS": 6}, marks=using("gamess")), + pytest.param("gcp", {"method": "hf3c"}, {}, marks=using("classic-gcp")), + pytest.param("mctc-gcp", {"method": "dft/sv"}, {}, marks=using("mctc-gcp")), # needs attn ("molpro", {"method": "hf", "basis": "6-31G"}, {}), # needs attn ("mopac", {"method": "PM6"}, {}), - ("mp2d", {"method": "MP2-DMP2"}, {}), + pytest.param("mp2d", {"method": "MP2-DMP2"}, {}, marks=using("mp2d")), # needs attn ("mrchem", {"method": "blyp"}, {"world_prec": 1.0e-3}), - ("nwchem", {"method": "hf", "basis": "6-31G"}, {}), + pytest.param("nwchem", {"method": "hf", "basis": "6-31G"}, {}, marks=using("nwchem")), # needs attn ("openmm", {"method": "openff-1.0.0", "basis": "smirnoff"}, {}), - ("psi4", {"method": "hf", "basis": "6-31G"}, {"gradient_write": True}), + pytest.param("psi4", {"method": "hf", "basis": "6-31G"}, {"gradient_write": True}, marks=using("psi4")), # needs attn ("qchem", {"method": "hf", "basis": "6-31G"}, {}), # needs attn ("qcore", {"method": "pbe", "basis": "6-31G"}, {}), # needs attn ("rdkit", {"method": "UFF"}, {}), @@ -83,9 +83,6 @@ def test_local_options_memory_gib(program, model, keywords, memory_trickery, sch """ models, retver, _ = schema_versions - if not has_program(program): - pytest.skip(f"Program '{program}' not found.") - harness = qcng.get_program(program) molecule = _get_molecule(program, model["method"], models.Molecule) @@ -161,9 +158,6 @@ def test_local_options_scratch(program, model, keywords, schema_versions, reques """ models, retver, _ = schema_versions - if not has_program(program): - pytest.skip(f"Program '{program}' not found.") - harness = qcng.get_program(program) molecule = _get_molecule(program, model["method"], models.Molecule) @@ -254,9 +248,6 @@ def test_local_options_ncores(program, model, keywords, ncores, schema_versions, """ models, retver, _ = schema_versions - if not has_program(program): - pytest.skip(f"Program '{program}' not found.") - harness = qcng.get_program(program) molecule = _get_molecule(program, model["method"], models.Molecule) diff --git a/qcengine/programs/tests/test_canonical_fields.py b/qcengine/programs/tests/test_canonical_fields.py index 7b185aaed..c0cce230d 100644 --- a/qcengine/programs/tests/test_canonical_fields.py +++ b/qcengine/programs/tests/test_canonical_fields.py @@ -27,9 +27,6 @@ def test_protocol_native(program, model, keywords, native, schema_versions, requ """ models, retver, _ = schema_versions - if not has_program(program): - pytest.skip(f"Program '{program}' not found.") - harness = qcng.get_program(program) molecule = _get_molecule(program, model["method"], models.Molecule) diff --git a/qcengine/programs/tests/test_dftd3_mp2d.py b/qcengine/programs/tests/test_dftd3_mp2d.py index 17a1be7f7..9f10abed8 100644 --- a/qcengine/programs/tests/test_dftd3_mp2d.py +++ b/qcengine/programs/tests/test_dftd3_mp2d.py @@ -8,10 +8,10 @@ import qcengine as qcng from qcengine.programs import empirical_dispersion_resources -from qcengine.testing import checkver_and_convert, from_v2, is_program_new_enough, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, is_program_new_enough, schema_versions, using, uusing -@using("dftd3") +@uusing("classic-dftd3") @pytest.mark.parametrize("method", ["b3lyp-d3", "b3lyp-d3m", "b3lyp-d3bj", "b3lyp-d3mbj"]) def test_dftd3_task(method, schema_versions, request): models, retver, _ = schema_versions @@ -48,7 +48,7 @@ def test_dftd3_task(method, schema_versions, request): assert ret["success"] is True -@using("dftd3") +@uusing("classic-dftd3") def test_dftd3_error(schema_versions, request): models, retver, _ = schema_versions @@ -1378,8 +1378,6 @@ def test_dftd3_error(schema_versions, request): def eneyne_ne_qcdbmols(): - if not is_program_new_enough("psi4", "1.4a1.dev55"): - pytest.skip("Psi4 requires at least Psi4 v1.3rc2") from psi4.driver import qcdb eneyne = qcdb.Molecule(seneyne) @@ -1398,8 +1396,6 @@ def eneyne_ne_qcdbmols(): def eneyne_ne_psi4mols(): - if not is_program_new_enough("psi4", "1.4a1.dev55"): - pytest.skip("Psi4 requires at least Psi4 v1.3rc2") import psi4 eneyne = psi4.core.Molecule.from_string(seneyne) @@ -1556,7 +1552,7 @@ def test_dftd3__from_arrays__supplement(): assert compare_recursive(ans, res, tnm() + " idempotent", atol=1.0e-4) -@using("dftd3") +@uusing("classic-dftd3") def test_3(schema_versions, request): models, retver, _ = schema_versions @@ -1592,7 +1588,7 @@ def test_3(schema_versions, request): assert compare("B3LYP-D3(BJ)", _compute_key(res["extras"]["local_keywords"]), "key") -@using("dftd3") +@uusing("classic-dftd3") @pytest.mark.parametrize( "subjects", [ @@ -1619,11 +1615,11 @@ def test_3(schema_versions, request): # below two xfail until dftd3 that's only 2-body is out of psi4 proper pytest.param( {"first": "atmgr", "second": "atmgr", "parent": "eneyne", "subject": "gAmB", "lbl": "ATM"}, - marks=[using("dftd3_321")], + marks=[*using("classic-dftd3_321")], ), pytest.param( {"first": "pbe-atmgr", "second": None, "parent": "ne", "subject": "atom", "lbl": "ATM"}, - marks=[using("dftd3_321")], + marks=[*using("classic-dftd3_321")], ), ], ) @@ -1638,7 +1634,7 @@ def test_molecule__run_dftd3__23body(inp, subjects, request): assert compare_values(gexpected, G, atol=1.0e-7) -@using("qcdb") +@uusing("qcdb") def test_qcdb__energy_d3(): import qcdb @@ -1672,7 +1668,7 @@ def test_qcdb__energy_d3(): ) -@using("mp2d") +@uusing("mp2d") @pytest.mark.parametrize( "subjects", [ @@ -1764,14 +1760,14 @@ def test_mp2d__run_mp2d__2body(inp, subjects, schema_versions, request): "program, inp", # fmt: off [ - pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "d3-b3lyp-d"}, "keywords": {}}, "lbl": "B3LYP-D2"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "mA", "qcsk": {"model": {"method": "d3-b3lyp-d3bj"}, "keywords": {}}, "lbl": "B3LYP-D3(BJ)"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "mB", "qcsk": {"model": { "method": "d3-PBE-D3zero"}, "keywords": {}}, "lbl": "PBE-D3"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "gAmB", "qcsk": { "model": { "method": "d3-PBE-D3zero"}, "keywords": {}}, "lbl": "PBE-D3"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "mAgB", "qcsk": { "model": { "method": "d3-PBE-D2"}, "keywords": {}}, "lbl": "PBE-D2"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "ne", "subject": "atom", "qcsk": { "model": { "method": "d3-b3lyp-d3bj"}, "keywords": {}}, "lbl": "B3LYP-D3(BJ)"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "d3-SAPT0-D3M(BJ)"}, "keywords": {}}, "lbl": "SAPT0-D3M(BJ)"}, marks=using("dftd3")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "mA", "qcsk": { "model": { "method": "d3-SAPT0-D3M"}, "keywords": {}}, "lbl": "SAPT0-D3M"}, marks=using("dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "d3-b3lyp-d"}, "keywords": {}}, "lbl": "B3LYP-D2"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "mA", "qcsk": {"model": {"method": "d3-b3lyp-d3bj"}, "keywords": {}}, "lbl": "B3LYP-D3(BJ)"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "mB", "qcsk": {"model": { "method": "d3-PBE-D3zero"}, "keywords": {}}, "lbl": "PBE-D3"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "gAmB", "qcsk": { "model": { "method": "d3-PBE-D3zero"}, "keywords": {}}, "lbl": "PBE-D3"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "mAgB", "qcsk": { "model": { "method": "d3-PBE-D2"}, "keywords": {}}, "lbl": "PBE-D2"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "ne", "subject": "atom", "qcsk": { "model": { "method": "d3-b3lyp-d3bj"}, "keywords": {}}, "lbl": "B3LYP-D3(BJ)"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "d3-SAPT0-D3M(BJ)"}, "keywords": {}}, "lbl": "SAPT0-D3M(BJ)"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"parent": "eneyne", "subject": "mA", "qcsk": { "model": { "method": "d3-SAPT0-D3M"}, "keywords": {}}, "lbl": "SAPT0-D3M"}, marks=using("classic-dftd3")), pytest.param("s-dftd3", {"parent": "eneyne", "subject": "mA", "qcsk": {"model": {"method": "d3-b3lyp-d3bj"}, "keywords": {"apply_qcengine_aliases": True, "level_hint": "d3bj"}}, "lbl": "B3LYP-D3(BJ)"}, marks=using("s-dftd3")), pytest.param("s-dftd3", {"parent": "eneyne", "subject": "mB", "qcsk": {"model": { "method": "d3-PBE-D3zero"}, "keywords": {"apply_qcengine_aliases": True, "level_hint": "d3zero"}}, "lbl": "PBE-D3"}, marks=using("s-dftd3")), @@ -1787,9 +1783,9 @@ def test_mp2d__run_mp2d__2body(inp, subjects, schema_versions, request): pytest.param("dftd4", {"parent": "eneyne", "subject": "mB", "qcsk": { "model": { "method": "d4-PBE-D4"}, "keywords": {}}, "lbl": "PBE-D4(BJ,EEQ)ATM"}, marks=using("dftd4")), pytest.param("dftd4", {"parent": "eneyne", "subject": "mAgB", "qcsk": { "model": { "method": "d4-PBE-D4"}, "keywords": {}}, "lbl": "PBE-D4(BJ,EEQ)ATM"}, marks=using("dftd4")), - pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("dftd3")), # params only - pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "b3lyp-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("dftd3")), # method reinforcing params - pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "pbe-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("dftd3")), # method contradicting params (D3: params win) + pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("classic-dftd3")), # params only + pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "b3lyp-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("classic-dftd3")), # method reinforcing params + pytest.param("dftd3", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "pbe-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "B3LYP-D3"}, marks=using("classic-dftd3")), # method contradicting params (D3: params win) pytest.param("dftd4", {"parent": "eneyne", "subject": "mAgB", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d4", "params_tweaks": _d4_b3lyp_2body}}, "lbl": "B3LYP-D4(BJ)-2BODY"}, marks=using("dftd4")), # params only pytest.param("dftd4", {"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d4", "params_tweaks": _d4_b3lyp}}, "lbl": "B3LYP-D4(BJ,EEQ)ATM"}, marks=using("dftd4")), # params only @@ -1867,8 +1863,8 @@ def test_dftd3__run_dftd3__2body(inp, program, subjects, schema_versions, reques "inp", # fmt: off [ - pytest.param({"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "PBE-D3"}, marks=using("dftd3")), # wrong ref lbl - pytest.param({"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "pbe-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "PBE-D3"}, marks=using("dftd3")), # method contradicting params (D3: params win -> fail) + pytest.param({"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "PBE-D3"}, marks=using("classic-dftd3")), # wrong ref lbl + pytest.param({"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": "pbe-d3"}, "keywords": {"level_hint": "d3", "params_tweaks": _d3_b3lyp}}, "lbl": "PBE-D3"}, marks=using("classic-dftd3")), # method contradicting params (D3: params win -> fail) pytest.param({"parent": "eneyne", "subject": "dimer", "qcsk": {"model": {"method": ""}, "keywords": {"level_hint": "d4", "params_tweaks": _d4_b3lyp}}, "lbl": "PBE-D4(BJ,EEQ)ATM"}, marks=using("dftd4")), # wrong ref lbl # LAB Nov 2022 - dftd4 from different channels (psi4, c-f) producing contrary behavior. TODO @@ -1911,7 +1907,7 @@ def test_dftd3__run_dftd3__2body_error(inp, subjects, schema_versions, request): assert compare_values(expected, jrec["properties"]["return_energy"], atol=1.0e-7) -@using("dftd3_321") +@uusing("classic-dftd3_321") @pytest.mark.parametrize( "subjects", [ @@ -1999,7 +1995,9 @@ def test_dftd3__run_dftd3__3body(inp, subjects, schema_versions, request): @pytest.mark.parametrize( "inp, extrakw, program", [ - pytest.param({"parent": "eneyne", "subject": "dimer", "lbl": "SAPT0-D3M"}, {}, "dftd3", marks=using("dftd3")), + pytest.param( + {"parent": "eneyne", "subject": "dimer", "lbl": "SAPT0-D3M"}, {}, "dftd3", marks=using("classic-dftd3") + ), pytest.param( {"parent": "eneyne", "subject": "dimer", "lbl": "SAPT0-D3M"}, {"apply_qcengine_aliases": True, "level_hint": "d3m"}, @@ -2060,7 +2058,7 @@ def test_sapt_pairwise(inp, program, extrakw, subjects, schema_versions, request @pytest.mark.parametrize( "program", [ - pytest.param("gcp", marks=using("gcp")), + pytest.param("gcp", marks=using("classic-gcp")), pytest.param("mctc-gcp", marks=using("mctc-gcp")), ], ) diff --git a/qcengine/programs/tests/test_dftd4.py b/qcengine/programs/tests/test_dftd4.py index 068f90c04..22304c7fb 100644 --- a/qcengine/programs/tests/test_dftd4.py +++ b/qcengine/programs/tests/test_dftd4.py @@ -10,10 +10,10 @@ import qcelemental as qcel import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing -@using("dftd4") +@uusing("dftd4") def test_dftd4_task_b97m_m01(schema_versions, request): models, retver, _ = schema_versions @@ -45,7 +45,7 @@ def test_dftd4_task_b97m_m01(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("dftd4") +@uusing("dftd4") def test_dftd4_task_tpss_m02(schema_versions, request): models, retver, _ = schema_versions @@ -118,7 +118,7 @@ def test_dftd4_task_tpss_m02(schema_versions, request): assert "will I pass" in atomic_result.extras.get("mymsg", "no key!"), "input extras roundtrip fail" -@using("dftd4") +@uusing("dftd4") def test_dftd4_task_r2scan_m03(schema_versions, request): models, retver, _ = schema_versions @@ -171,7 +171,7 @@ def test_dftd4_task_r2scan_m03(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("dftd4") +@uusing("dftd4") def test_dftd4_task_unknown_method(schema_versions, request): models, retver, models_out = schema_versions @@ -204,7 +204,7 @@ def test_dftd4_task_unknown_method(schema_versions, request): assert atomic_result.error == error -@using("dftd4") +@uusing("dftd4") def test_dftd4_task_cold_fusion(schema_versions, request): models, retver, models_out = schema_versions diff --git a/qcengine/programs/tests/test_molpro.py b/qcengine/programs/tests/test_molpro.py index dd398ca49..6bef69533 100644 --- a/qcengine/programs/tests/test_molpro.py +++ b/qcengine/programs/tests/test_molpro.py @@ -3,7 +3,7 @@ from qcelemental.testing import compare_recursive import qcengine as qcng -from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, using +from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, uusing molpro_info = qcengine_records("molpro") @@ -27,7 +27,7 @@ def test_molpro_output_parser(test_case): output_ref.pop("schema_version", None) # TODO add `skip` to compare_recursive - check = compare_recursive(output_ref, output, forgive={"stdout"}) + check = compare_recursive(output_ref, output, forgive={"stdout", "protocols"}) assert check, check @@ -46,7 +46,7 @@ def test_molpro_input_formatter(test_case): assert input_file.keys() >= {"commands", "infiles"} -@using("molpro") +@uusing("molpro") @pytest.mark.parametrize("test_case", molpro_info.list_test_cases()) def test_molpro_executor(test_case, schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_mrchem.py b/qcengine/programs/tests/test_mrchem.py index e255e6002..38c3fbcd9 100644 --- a/qcengine/programs/tests/test_mrchem.py +++ b/qcengine/programs/tests/test_mrchem.py @@ -5,7 +5,7 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing @pytest.fixture @@ -29,7 +29,7 @@ def fh(schema_versions): ) -@using("mrchem") +@uusing("mrchem") def test_energy(h2o, schema_versions, request): models, retver, _ = schema_versions @@ -82,7 +82,7 @@ def test_energy(h2o, schema_versions, request): assert compare_values([-3.766420e-07, 0.0, 0.720473], res["properties"]["scf_dipole_moment"], atol=1e-3) -@using("mrchem") +@uusing("mrchem") def test_dipole(h2o, schema_versions, request): models, retver, _ = schema_versions @@ -135,7 +135,7 @@ def test_dipole(h2o, schema_versions, request): assert compare_values([-3.766420e-07, 0.0, 0.720473], res["properties"]["scf_dipole_moment"], atol=1e-3) -@using("mrchem") +@uusing("mrchem") def test_gradient(fh, schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_nwchem.py b/qcengine/programs/tests/test_nwchem.py index 2016cb4b8..fad41d47f 100644 --- a/qcengine/programs/tests/test_nwchem.py +++ b/qcengine/programs/tests/test_nwchem.py @@ -5,7 +5,7 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing # Molecule where autoz fails _auto_z_problem = xyz = """C 15.204188380000 -3.519180270000 -10.798726560000 @@ -60,7 +60,7 @@ def nh2_data(): """ -@using("nwchem") +@uusing("nwchem") def test_b3lyp(nh2_data, schema_versions, request): models, retver, _ = schema_versions nh2 = models.Molecule.from_data(nh2_data) @@ -96,7 +96,7 @@ def test_b3lyp(nh2_data, schema_versions, request): assert res["properties"]["calcinfo_nbasis"] == 13 -@using("nwchem") +@uusing("nwchem") def test_hess(nh2_data, schema_versions, request): models, retver, _ = schema_versions nh2 = models.Molecule.from_data(nh2_data) @@ -128,7 +128,7 @@ def test_hess(nh2_data, schema_versions, request): assert np.isclose(np.linalg.det(res.return_result), np.linalg.det(res_shifted.return_result)) -@using("nwchem") +@uusing("nwchem") def test_gradient(nh2_data, schema_versions, request): models, retver, _ = schema_versions nh2 = models.Molecule.from_data(nh2_data) @@ -193,7 +193,7 @@ def h20_data(): """ -@using("nwchem") +@uusing("nwchem") def test_dipole(h20_data, schema_versions, request): models, retver, _ = schema_versions h20 = models.Molecule.from_data(h20_data) @@ -256,7 +256,7 @@ def h20v2_data(): """ -@using("nwchem") +@uusing("nwchem") def test_homo_lumo(h20v2_data, schema_versions, request): models, retver, _ = schema_versions h20v2 = models.Molecule.from_data(h20v2_data) @@ -308,7 +308,7 @@ def test_homo_lumo(h20v2_data, schema_versions, request): assert compare_values(0.08207131, float(res["extras"]["qcvars"]["LUMO"][0]), atol=1e-5) -@using("nwchem") +@uusing("nwchem") def test_geometry_bug(schema_versions, request): """Make sure that the harvester does not crash if NWChem's autosym moves atoms too far""" models, retver, _ = schema_versions @@ -336,7 +336,7 @@ def test_geometry_bug(schema_versions, request): atres = checkver_and_convert(atres, request.node.name, "post") -@using("nwchem") +@uusing("nwchem") def test_autoz_error(schema_versions, request): """Test ability to turn off autoz""" models, retver, _ = schema_versions @@ -392,7 +392,7 @@ def test_autoz_error(schema_versions, request): assert "Error when generating redundant atomic coordinates" not in result.error.error_message -@using("nwchem") +@uusing("nwchem") def test_autoz_error_correction(schema_versions, request): """See if error correction for autoz works""" models, retver, _ = schema_versions @@ -437,7 +437,7 @@ def test_autoz_error_correction(schema_versions, request): ["ccsd", "ccsd__maxiter", 4, False], ], ) -@using("nwchem") +@uusing("nwchem") def test_conv_threshold(h20v2_data, method, keyword, init_iters, use_tce, schema_versions, request): models, retver, _ = schema_versions h20v2 = models.Molecule.from_data(h20v2_data) @@ -476,7 +476,7 @@ def test_conv_threshold(h20v2_data, method, keyword, init_iters, use_tce, schema assert result.extras["observed_errors"]["convergence_failed"]["keyword_updates"] == {keyword: init_iters * 4} -@using("nwchem") +@uusing("nwchem") def test_restart(nh2_data, tmpdir, schema_versions, request): # Create a molecule that takes 5-8 steps for NWChem to relax it, # but only run the relaxation for 4 steps diff --git a/qcengine/programs/tests/test_programs.py b/qcengine/programs/tests/test_programs.py index f90af56a5..42b4170d0 100644 --- a/qcengine/programs/tests/test_programs.py +++ b/qcengine/programs/tests/test_programs.py @@ -8,7 +8,7 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, failure_engine, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, failure_engine, from_v2, schema_versions, uusing def test_missing_key(schema_versions, request): @@ -28,7 +28,7 @@ def test_missing_key_raises(schema_versions, request): ret = qcng.compute({"hello": "hi"}, "bleh", raise_error=True) -@using("psi4") +@uusing("psi4") def test_psi4_task(schema_versions, request): models, retver, _ = schema_versions @@ -66,8 +66,8 @@ def test_psi4_task(schema_versions, request): assert ret.success is True -@using("psi4") -@using("gcp") +@uusing("psi4") +@uusing("classic-gcp") def test_psi4_hf3c_task(schema_versions, request): models, retver, _ = schema_versions @@ -100,7 +100,7 @@ def test_psi4_hf3c_task(schema_versions, request): assert not ret.model.basis -@using("psi4_runqcsk") +@uusing("psi4") def test_psi4_interactive_task(schema_versions, request): models, retver, _ = schema_versions @@ -133,7 +133,7 @@ def test_psi4_interactive_task(schema_versions, request): assert is_psiapi_evaluated -@using("psi4_runqcsk") +@uusing("psi4") def test_psi4_wavefunction_task(schema_versions, request): models, retver, _ = schema_versions @@ -164,7 +164,7 @@ def test_psi4_wavefunction_task(schema_versions, request): assert ret.wavefunction.scf_orbitals_a.shape == (7, 7) -@using("psi4") +@uusing("psi4") def test_psi4_internal_failure(schema_versions, request): models, retver, _ = schema_versions @@ -197,7 +197,7 @@ def test_psi4_internal_failure(schema_versions, request): assert "reference is only" in str(exc.value) -@using("psi4") +@uusing("psi4") def test_psi4_ref_switch(schema_versions, request): models, retver, _ = schema_versions @@ -231,7 +231,7 @@ def test_psi4_ref_switch(schema_versions, request): assert ret.properties.calcinfo_nbeta == 1 -@using("rdkit") +@uusing("rdkit") @pytest.mark.parametrize("method", ["UFF", "MMFF94", "MMFF94s"]) def test_rdkit_task(method, schema_versions, request): models, retver, _ = schema_versions @@ -256,7 +256,7 @@ def test_rdkit_task(method, schema_versions, request): assert ret.success is True -@using("rdkit") +@uusing("rdkit") def test_rdkit_connectivity_error(schema_versions, request): models, retver, _ = schema_versions @@ -285,7 +285,7 @@ def test_rdkit_connectivity_error(schema_versions, request): qcng.compute(input_data, "rdkit", raise_error=True, return_version=retver) -@using("torchani") +@uusing("torchani") def test_torchani_task(schema_versions, request): models, retver, _ = schema_versions @@ -313,7 +313,7 @@ def test_torchani_task(schema_versions, request): assert ret.driver == "gradient" -@using("mopac") +@uusing("mopac") def test_mopac_task(schema_versions, request): _, retver, _ = schema_versions @@ -451,7 +451,7 @@ def test_random_failure_with_success(failure_engine, schema_versions, request): assert ret.extras["ncalls"] == 2 -@using("openmm") +@uusing("openmm") def test_openmm_task_smirnoff(schema_versions, request): models, retver, _ = schema_versions @@ -492,7 +492,7 @@ def test_openmm_task_smirnoff(schema_versions, request): @pytest.mark.skip("`basis` must be explicitly specified at this time") -@using("openmm") +@uusing("openmm") def test_openmm_task_url_basis(schema_versions, request): models, retver, _ = schema_versions @@ -540,7 +540,7 @@ def test_openmm_task_url_basis(schema_versions, request): assert ret.success is True -@using("openmm") +@uusing("openmm") def test_openmm_cmiles_gradient(schema_versions, request): models, retver, _ = schema_versions @@ -568,7 +568,7 @@ def test_openmm_cmiles_gradient(schema_versions, request): assert ret.success is True -@using("openmm") +@uusing("openmm") def test_openmm_cmiles_gradient_nomatch(schema_versions, request): models, retver, _ = schema_versions @@ -605,7 +605,7 @@ def test_openmm_cmiles_gradient_nomatch(schema_versions, request): ) -@using("openmm") +@uusing("openmm") @pytest.mark.parametrize( "gaff_settings", [ @@ -655,7 +655,7 @@ def test_openmm_gaff_keywords(gaff_settings, schema_versions, request): assert ret.return_result == pytest.approx(expected_result, rel=1e-6) -@using("mace") +@uusing("mace") def test_mace_energy(schema_versions, request): """ Test calculating the energy with mace @@ -677,7 +677,7 @@ def test_mace_energy(schema_versions, request): assert pytest.approx(result.return_result) == -76.47683956098838 -@using("mace") +@uusing("mace") def test_mace_gradient(schema_versions, request): """ Test calculating the gradient with mace @@ -708,7 +708,7 @@ def test_mace_gradient(schema_versions, request): assert pytest.approx(result.return_result) == expected_result -@using("aimnet2") +@uusing("aimnet2") @pytest.mark.parametrize( "model, expected_energy", [ @@ -739,7 +739,7 @@ def test_aimnet2_energy(model, expected_energy, schema_versions, request): assert "ensemble_forces_std" in result.extras["aimnet2"] -@using("aimnet2") +@uusing("aimnet2") def test_aimnet2_gradient(schema_versions, request): """Test computing the gradient of water using one aimnet2 model.""" models, retver, _ = schema_versions @@ -775,7 +775,7 @@ def test_aimnet2_gradient(schema_versions, request): assert "charges" in result.extras["aimnet2"] -@using("psi4") +@uusing("psi4") def test_psi4_properties_driver(schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_qchem.py b/qcengine/programs/tests/test_qchem.py index 74440b051..44c2a42dc 100644 --- a/qcengine/programs/tests/test_qchem.py +++ b/qcengine/programs/tests/test_qchem.py @@ -4,7 +4,7 @@ from qcelemental.testing import compare_recursive, compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, using +from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, uusing qchem_info = qcengine_records("qchem") qchem_logonly_info = qcengine_records("qchem_logonly") @@ -18,6 +18,7 @@ "root.extras", "root.molecule.extras", "root.schema_version", # TODO temp until rearrangement befuddles + "root.protocols", ] @@ -77,7 +78,7 @@ def test_qchem_input_formatter_template(test_case): assert input_file.keys() >= {"commands", "infiles"} -@using("qchem") +@uusing("qchem") @pytest.mark.parametrize("test_case", qchem_info.list_test_cases()) def test_qchem_executor(test_case, schema_versions, request): models, retver, _ = schema_versions @@ -100,7 +101,7 @@ def test_qchem_executor(test_case, schema_versions, request): assert compare_recursive(output_ref.return_result, result.return_result, atol=atol) -@using("qchem") +@uusing("qchem") def test_qchem_orientation(schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_qcore.py b/qcengine/programs/tests/test_qcore.py index e3e40220d..ccb0f8a59 100644 --- a/qcengine/programs/tests/test_qcore.py +++ b/qcengine/programs/tests/test_qcore.py @@ -4,10 +4,10 @@ from qcelemental.testing import compare_recursive, compare_values import qcengine as qcng -from qcengine.testing import checkver_and_convert, schema_versions, using +from qcengine.testing import checkver_and_convert, schema_versions, uusing -@using("qcore") +@uusing("qcore") @pytest.mark.parametrize( "method, energy, gradient_norm", [ @@ -35,7 +35,7 @@ def test_qcore_methods(method, energy, gradient_norm, schema_versions, request): assert atomic_result.wavefunction is None -@using("qcore") +@uusing("qcore") def test_qcore_wavefunction(schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_sdftd3.py b/qcengine/programs/tests/test_sdftd3.py index 657e30df1..066148be8 100644 --- a/qcengine/programs/tests/test_sdftd3.py +++ b/qcengine/programs/tests/test_sdftd3.py @@ -5,15 +5,17 @@ to test as much different interactions as possible. """ +import pprint + import numpy as np import pytest import qcelemental as qcel import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing -@using("s-dftd3") +@uusing("s-dftd3") def test_dftd3_task_b97m_m01(schema_versions, request): models, retver, _ = schema_versions @@ -42,7 +44,7 @@ def test_dftd3_task_b97m_m01(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("s-dftd3") +@uusing("s-dftd3") @pytest.mark.parametrize( "inp", [ @@ -87,7 +89,7 @@ def test_dftd3_task_pbe_m02(inp, schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("s-dftd3") +@uusing("s-dftd3") def test_dftd3_task_tpss_m02(schema_versions, request): models, retver, _ = schema_versions @@ -153,7 +155,7 @@ def test_dftd3_task_tpss_m02(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("s-dftd3") +@uusing("s-dftd3") def test_dftd3_task_r2scan_m03(schema_versions, request): models, retver, _ = schema_versions @@ -206,7 +208,7 @@ def test_dftd3_task_r2scan_m03(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("s-dftd3") +@uusing("s-dftd3") def test_dftd3_task_unknown_method(schema_versions, request): models, retver, models_out = schema_versions @@ -241,7 +243,7 @@ def test_dftd3_task_unknown_method(schema_versions, request): assert atomic_result.error == error -@using("s-dftd3") +@uusing("s-dftd3") def test_dftd3_task_cold_fusion(schema_versions, request): models, retver, models_out = schema_versions @@ -288,6 +290,6 @@ def test_dftd3_task_cold_fusion(schema_versions, request): atomic_result = qcng.compute(atomic_input, "s-dftd3", return_version=retver) atomic_result = checkver_and_convert(atomic_result, request.node.name, "post", vercheck=False) - print(atomic_result.error) + pprint.pprint(atomic_result.error.model_dump()) assert not atomic_result.success assert atomic_result.error == error diff --git a/qcengine/programs/tests/test_standard_suite.py b/qcengine/programs/tests/test_standard_suite.py index 7e6e039ac..b44ce608a 100644 --- a/qcengine/programs/tests/test_standard_suite.py +++ b/qcengine/programs/tests/test_standard_suite.py @@ -145,17 +145,17 @@ def _trans_key(qc, bas, key): pytest.param({"call": "cfour", "reference": "rhf", "fcae": "ae", "keywords": {"scf_conv": 12}, }, id="hf rhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4")), 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, "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": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4")), 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, "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")), + pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_type": "pk"}, }, id="hf rohf ae: psi4", marks=using("psi4")), # yapf: enable ], ) @@ -200,17 +200,17 @@ def test_hf_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reques pytest.param({"call": "cfour", "reference": "rhf", "fcae": "ae", "keywords": {"scf_conv": 12}, }, id="hf rhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {"scf__thresh": 1.e-6}, }, id="hf rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4_derqcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4")), 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, "scf__thresh": 1.e-6}, }, 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_derqcsk")), + pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4")), 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, "scf__thresh": 1.e-6}, }, 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_derqcsk")), + pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_type": "pk"}, }, id="hf rohf ae: psi4", marks=using("psi4")), # yapf: enable ], ) @@ -254,17 +254,17 @@ def test_hf_gradient_module(inp, dertype, basis, subjects, clsd_open_pmols, requ pytest.param({"call": "cfour", "reference": "rhf", "fcae": "ae", "keywords": {"scf_conv": 12}, }, id="hf rhf ae: cfour", marks=using("cfour")), pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="hf rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4_derqcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"scf_type": "pk"}, }, id="hf rhf ae: psi4", marks=using("psi4")), 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": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4_derqcsk")), + pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "scf_type": "pk"}, }, id="hf uhf ae: psi4", marks=using("psi4")), 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", "scf__dirscf": True}, }, id="hf rohf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"scf__rohf": True, "scf__thresh": 1.e-7}, }, id="hf rohf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_type": "pk"}, "error": {2: _q6 }}, id="hf rohf ae: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_type": "pk"}, "error": {2: _q6 }}, id="hf rohf ae: psi4", marks=using("psi4")), # yapf: enable ], ) @@ -308,7 +308,7 @@ def test_hf_hessian_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {"mp2__nacore": 0}, }, id="mp2 rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__thresh": 1.e-6}, "error": {"cc-pvdz": _q45}}, id="mp2 rhf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="mp2 rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"mp2_type": "conv"}, }, id="mp2 rhf ae: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {"mp2_type": "conv"}, }, id="mp2 rhf ae: psi4", marks=using("psi4")), pytest.param({"call": "qchem", "reference": "rhf", "fcae": "ae", "keywords": {"N_FROZEN_CORE": 0}, }, id="mp2 rhf ae: qchem", marks=using("qchem")), pytest.param({"call": "cfour", "reference": "rhf", "fcae": "fc", "keywords": {"dropmo": 1, "scf_conv": 12}, }, id="mp2 rhf fc: cfour", marks=using("cfour")), @@ -318,19 +318,19 @@ def test_hf_hessian_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "fc", "keywords": {"mp2__freeze__core": 1}, }, id="mp2 rhf fc: nwchem", marks=using("nwchem")), #pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "fc", "keywords": {"mp2__freeze__core__atomic": True}, }, id="mp2 rhf fc: nwchem", marks=using("nwchem")), # uses qcdb alias pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "fc", "keywords": {"mp2__freeze__atomic": {"O": 1}}, }, id="mp2 rhf fc: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "fc", "keywords": {"freeze_core": True, "mp2_type": "conv"}, }, id="mp2 rhf fc: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "fc", "keywords": {"freeze_core": True, "mp2_type": "conv"}, }, id="mp2 rhf fc: psi4", marks=using("psi4")), 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, "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": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf", "mp2_type": "conv"}, }, id="mp2 uhf ae: psi4", marks=using("psi4")), 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, "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": "psi4", "reference": "uhf", "fcae": "fc", "keywords": {"reference": "uhf", "freeze_core": True, "mp2_type": "conv"}, }, id="mp2 uhf fc: psi4", marks=using("psi4")), pytest.param({"call": "qchem", "reference": "uhf", "fcae": "fc", "keywords": {"N_frozen_CORE": "fC"}, }, id="mp2 uhf fc: qchem", marks=using("qchem")), pytest.param({"call": "cfour", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "scf_conv": 12}, }, id="mp2 rohf ae: cfour", marks=using("cfour")), @@ -338,13 +338,13 @@ def test_hf_hessian_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"qc_module": "tce", "scf__rohf": True, "scf__thresh": 1.e-8, "tce__thresh": 1.e-8, "tce__freeze": 0, "scf__tol2e": 1.e-10}, "wrong": {0: _w1 }}, id="mp2 rohf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rohf", "fcae": "ae", "keywords": {"scf__rohf": True}, "error": {0: _q1 }}, id="mp2 rohf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "mp2_type": "conv"}, }, id="mp2 rohf ae: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "keywords": {"reference": "rohf", "mp2_type": "conv"}, }, id="mp2 rohf ae: psi4", marks=using("psi4")), 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, "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")), + 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")), # yapf: enable ], ) @@ -391,7 +391,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "gamess", "reference": "rhf", "fcae": "ae", "keywords": {"ccinp__ncore": 0}, }, id="ccsd rhf ae: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {"qc_module": "tce"}, "error": {"cc-pvdz": _q45}}, id="ccsd rhf ae: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="ccsd rhf ae: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="ccsd rhf ae: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "ae", "keywords": {}, }, id="ccsd rhf ae: psi4", marks=using("psi4")), pytest.param({"call": "cfour", "reference": "rhf", "fcae": "fc", "keywords": {"dropmo": [1], "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "vcc", "print": 2}, }, id="ccsd rhf fc: cfour-vcc", marks=using("cfour")), pytest.param({"call": "cfour", "reference": "rhf", "fcae": "fc", "keywords": {"dropmo": [1], "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "ecc"}, }, id="ccsd rhf fc: cfour-ecc", marks=using("cfour")), @@ -400,7 +400,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque pytest.param({"call": "gamess", "reference": "rhf", "fcae": "fc", "keywords": {}, }, id="ccsd rhf fc: gamess", marks=using("gamess")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "fc", "keywords": {"qc_module": "tce", "tce__freeze": 1 }, "error": {"cc-pvdz": _q45}}, id="ccsd rhf fc: nwchem-tce", marks=using("nwchem")), pytest.param({"call": "nwchem", "reference": "rhf", "fcae": "fc", "keywords": {"ccsd__freeze": 1}, }, id="ccsd rhf fc: nwchem", marks=using("nwchem")), - pytest.param({"call": "psi4", "reference": "rhf", "fcae": "fc", "keywords": {"freeze_core": True}, }, id="ccsd rhf fc: psi4", marks=using("psi4_mp2qcsk")), + pytest.param({"call": "psi4", "reference": "rhf", "fcae": "fc", "keywords": {"freeze_core": True}, }, id="ccsd rhf fc: psi4", marks=using("psi4")), # "cfour_occupation": [[3, 1, 1, 0], [3, 0, 1, 0]] pytest.param({"call": "cfour", "reference": "uhf", "fcae": "ae", "keywords": {"REFerence": "UHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "vcc", "print": 2}, }, id="ccsd uhf ae: cfour-vcc", marks=using("cfour")), @@ -409,7 +409,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque 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, "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")), + pytest.param({"call": "psi4", "reference": "uhf", "fcae": "ae", "keywords": {"reference": "uhf"}, }, id="ccsd uhf ae: psi4", marks=using("psi4")), pytest.param({"call": "cfour", "reference": "uhf", "fcae": "fc", "keywords": {"dropmo": [1], "REFerence": "UHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "vcc", "print": 2}, }, id="ccsd uhf fc: cfour-vcc", marks=using("cfour")), 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")), @@ -417,7 +417,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque 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, "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")), + pytest.param({"call": "psi4", "reference": "uhf", "fcae": "fc", "keywords": {"freeze_core": True, "reference": "uhf"}, }, id="ccsd uhf fc: psi4", marks=using("psi4")), pytest.param({"call": "cfour", "reference": "rohf", "fcae": "ae", "keywords": {"REFerence": "roHF", "SCF_CONV": 12, "CC_CONV": 12, "cc_program": "vcc", "print": 2}, }, id="ccsd rohf ae: cfour-vcc", marks=using("cfour")), 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")), @@ -425,7 +425,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque 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, "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) + pytest.param({"call": "psi4", "reference": "rohf", "fcae": "ae", "sdsc": "sd", "keywords": {"reference": "rohf", "qc_module": "ccenergy"}, }, id="ccsd rohf ae: psi4", marks=using("psi4")), # TODO another way for ccenergy? (fc, too) 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": "vcc", "print": 2}, }, id="ccsd rohf fc: cfour-vcc", marks=using("cfour")), 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")), @@ -433,7 +433,7 @@ def test_mp2_energy_module(inp, dertype, basis, subjects, clsd_open_pmols, reque 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, "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")), + 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")), # yapf: enable ], ) diff --git a/qcengine/programs/tests/test_terachem.py b/qcengine/programs/tests/test_terachem.py index cb49759f2..1ff6d9553 100644 --- a/qcengine/programs/tests/test_terachem.py +++ b/qcengine/programs/tests/test_terachem.py @@ -3,7 +3,7 @@ from qcelemental.testing import compare_recursive import qcengine as qcng -from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, using +from qcengine.testing import checkver_and_convert, qcengine_records, schema_versions, uusing # Prep globals terachem_info = qcengine_records("terachem") @@ -22,7 +22,9 @@ def test_terachem_output_parser(test_case): output_ref = qcel.models.v1.AtomicResult.parse_raw(data["output.json"]).dict() # Forgiving molecule since it is now sparse - assert compare_recursive(output_ref, output, forgive={"stdout", "provenance", "molecule", "schema_version"}) + assert compare_recursive( + output_ref, output, forgive={"stdout", "provenance", "molecule", "schema_version", "protocols"} + ) @pytest.mark.parametrize("test_case", terachem_info.list_test_cases()) @@ -39,7 +41,7 @@ def test_terachem_input_formatter(test_case): assert input_file.keys() >= {"commands", "infiles"} -@using("terachem") +@uusing("terachem") @pytest.mark.parametrize("test_case", terachem_info.list_test_cases()) def test_terachem_executor(test_case, schema_versions, request): models, retver, _ = schema_versions diff --git a/qcengine/programs/tests/test_turbomole.py b/qcengine/programs/tests/test_turbomole.py index 40e89b49e..ac8667b8b 100644 --- a/qcengine/programs/tests/test_turbomole.py +++ b/qcengine/programs/tests/test_turbomole.py @@ -5,7 +5,7 @@ import qcengine as qcng from qcengine.programs.turbomole.harvester import parse_hessian -from qcengine.testing import checkver_and_convert, schema_versions, using +from qcengine.testing import checkver_and_convert, schema_versions, using, uusing @pytest.fixture @@ -41,7 +41,7 @@ def h2o_ricc2_def2svp_data(): "hf", {"scf_conv": 4, "scf_iters": 1}, -75.95536954370, - marks=[using("turbomole"), pytest.mark.xfail(raises=AssertionError, strict=True)], + marks=[*using("turbomole"), pytest.mark.xfail(raises=AssertionError, strict=True)], ), ], ) @@ -94,7 +94,7 @@ def test_turbomole_gradient(method, keywords, ref_norm, h2o_data, schema_version assert compare_values(ref_norm, grad_norm) -@using("turbomole") +@uusing("turbomole") def test_turbomole_ri_dsp(h2o_data, schema_versions, request): models, retver, _ = schema_versions h2o = models.Molecule.from_data(h2o_data) @@ -129,7 +129,7 @@ def assert_hessian(H, ref_eigvals, ref_size): assert H.shape == (ref_size, ref_size) -@using("turbomole") +@uusing("turbomole") @pytest.mark.parametrize( "method, keywords, ref_eigvals", [ @@ -165,7 +165,7 @@ def test_turbomole_hessian(method, keywords, ref_eigvals, h2o_data, schema_versi assert_hessian(H, ref_eigvals, size) -@using("turbomole") +@uusing("turbomole") @pytest.mark.parametrize( "method, keywords, ref_eigvals", [ diff --git a/qcengine/programs/tests/test_xtb.py b/qcengine/programs/tests/test_xtb.py index 9819c64b1..25e801431 100644 --- a/qcengine/programs/tests/test_xtb.py +++ b/qcengine/programs/tests/test_xtb.py @@ -11,10 +11,10 @@ from qcelemental.testing import compare_recursive import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn1xtb_m01(schema_versions, request): models, retver, _ = schema_versions thr = 1.0e-7 @@ -63,7 +63,7 @@ def test_xtb_task_gfn1xtb_m01(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn1xtb_m02(schema_versions, request): models, retver, _ = schema_versions @@ -121,7 +121,7 @@ def test_xtb_task_gfn1xtb_m02(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn1xtb_m03(schema_versions, request): models, retver, _ = schema_versions @@ -177,7 +177,7 @@ def test_xtb_task_gfn1xtb_m03(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn1xtb_m04(schema_versions, request): models, retver, _ = schema_versions @@ -232,7 +232,7 @@ def test_xtb_task_gfn1xtb_m04(schema_versions, request): assert "mayer_indices" in atomic_result.return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn1xtb_m05(schema_versions, request): models, retver, _ = schema_versions @@ -264,7 +264,7 @@ def test_xtb_task_gfn1xtb_m05(schema_versions, request): assert "xtb" in atomic_result.extras -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn2xtb_m01(schema_versions, request): models, retver, _ = schema_versions @@ -314,7 +314,7 @@ def test_xtb_task_gfn2xtb_m01(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn2xtb_m02(schema_versions, request): models, retver, _ = schema_versions @@ -372,7 +372,7 @@ def test_xtb_task_gfn2xtb_m02(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn2xtb_m03(schema_versions, request): models, retver, _ = schema_versions @@ -428,7 +428,7 @@ def test_xtb_task_gfn2xtb_m03(schema_versions, request): assert pytest.approx(atomic_result.return_result, abs=thr) == return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn2xtb_m04(schema_versions, request): models, retver, _ = schema_versions @@ -483,7 +483,7 @@ def test_xtb_task_gfn2xtb_m04(schema_versions, request): assert "mayer_indices" in atomic_result.return_result -@using("xtb") +@uusing("xtb") def test_xtb_task_gfn2xtb_m05(schema_versions, request): models, retver, _ = schema_versions @@ -515,7 +515,7 @@ def test_xtb_task_gfn2xtb_m05(schema_versions, request): assert "xtb" in atomic_result.extras -@using("xtb") +@uusing("xtb") def test_xtb_task_unknown_method(schema_versions, request): models, retver, models_out = schema_versions @@ -543,7 +543,7 @@ def test_xtb_task_unknown_method(schema_versions, request): assert atomic_result.error == error -@using("xtb") +@uusing("xtb") def test_xtb_task_unsupported_driver(schema_versions, request): models, retver, models_out = schema_versions @@ -573,7 +573,7 @@ def test_xtb_task_unsupported_driver(schema_versions, request): assert atomic_result.error == error -@using("xtb") +@uusing("xtb") def test_xtb_task_cold_fusion(schema_versions, request): models, retver, models_out = schema_versions diff --git a/qcengine/testing.py b/qcengine/testing.py index 3835ca798..e5a25e2dd 100644 --- a/qcengine/testing.py +++ b/qcengine/testing.py @@ -3,7 +3,7 @@ """ import sys -from typing import List +from typing import List, Tuple import numpy as np import pytest @@ -170,15 +170,15 @@ def get_job(self): _programs = { "adcc": is_program_new_enough("adcc", "0.15.7"), "cfour": which("xcfour", return_bool=True), - "dftd3": which("dftd3", return_bool=True), - "dftd3_321": is_program_new_enough("dftd3", "3.2.1"), + "dftd3": which("dftd3", return_bool=True), # mark is classic-dftd3 + "dftd3_321": is_program_new_enough("dftd3", "3.2.1"), # mark is classic-dftd3_321 "dftd4": which_import("dftd4", return_bool=True), "dftd4_350": is_program_new_enough("dftd4", "3.5.0"), "s-dftd3": which_import("dftd3", return_bool=True), "qcore": is_program_new_enough("qcore", "0.8.9"), "gamess": which("rungms", return_bool=True), "mctc-gcp": is_program_new_enough("mctc-gcp", "2.3.0"), - "gcp": which("gcp", return_bool=True), + "gcp": which("gcp", return_bool=True), # mark is classic-gcp "geometric": which_import("geometric", return_bool=True), "berny": which_import("berny", return_bool=True), "mdi": is_mdi_new_enough("1.2"), @@ -188,9 +188,10 @@ def get_job(self): "nwchem": which("nwchem", return_bool=True), "optking": which_import("optking", return_bool=True), "psi4": is_program_new_enough("psi4", "1.2"), - "psi4_runqcsk": is_program_new_enough("psi4", "1.4a2.dev160"), - "psi4_mp2qcsk": is_program_new_enough("psi4", "1.4a2.dev580"), - "psi4_derqcsk": is_program_new_enough("psi4", "1.5a1.dev117"), + # below retired as pre-2022 + # "psi4_runqcsk": is_program_new_enough("psi4", "1.4a2.dev160"), + # "psi4_mp2qcsk": is_program_new_enough("psi4", "1.4a2.dev580"), + # "psi4_derqcsk": is_program_new_enough("psi4", "1.5a1.dev117"), "qcdb": which_import("qcdb", return_bool=True), "qchem": is_program_new_enough("qchem", "5.1"), "qcmanybody": which_import("qcmanybody", return_bool=True), @@ -210,7 +211,13 @@ def get_job(self): def has_program(name): - if name in _programs: + if name == "classic-dftd3": + return _programs["dftd3"] + elif name == "classic-dftd3_321": + return _programs["dftd3_321"] + elif name == "classic-gcp": + return _programs["gcp"] + elif name in _programs: return _programs[name] else: raise KeyError(f"Program {name} not registered with QCEngine testing.") @@ -219,14 +226,49 @@ def has_program(name): _using_cache = {} -def using(program): +def _using(program: str) -> None: if program not in _using_cache: import_message = f"Not detecting module {program}. Install package if necessary to enable tests." skip = pytest.mark.skipif(has_program(program) is False, reason=import_message) - _using_cache[program] = skip + general = pytest.mark.addon + particular = getattr(pytest.mark, program) - return _using_cache[program] + all_marks = (skip, general, particular) + _using_cache[program] = [_compose_decos(all_marks), all_marks] + + +def _compose_decos(decos): + # thanks, https://stackoverflow.com/a/45517876 + def composition(func): + for deco in reversed(decos): + func = deco(func) + return func + + return composition + + +def uusing(program: str): + """Apply 3 marks: skipif program not detected, label "addon", and label program. + This is the decorator form for whole test functions. For example: + + @uusing("psi4") + @uusing("dftd4") + def test_psi4_disp(): + + """ + _using(program) + return _using_cache[program][0] + + +def using(program: str) -> Tuple[pytest.MarkDecorator, ...]: + """Apply 3 marks: skipif program not detected, label "addon", and label program. + This is the inline form for parameterizations: `marks=using("nwchem")`. + In combo, do `marks=[*using("nwchem"), pytest.mark.quick]` + + """ + _using(program) + return _using_cache[program][1] @pytest.fixture(scope="function", params=[None, "as_v1", "as_v2", "to_v1", "to_v2"]) diff --git a/qcengine/tests/test_cli.py b/qcengine/tests/test_cli.py index 31f78957f..1975a355f 100644 --- a/qcengine/tests/test_cli.py +++ b/qcengine/tests/test_cli.py @@ -7,7 +7,7 @@ import pytest from qcengine import cli, get_molecule, util -from qcengine.testing import checkver_and_convert, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, uusing def run_qcengine_cli(args: List[str], stdin: str = None) -> str: @@ -59,7 +59,7 @@ def test_info(): assert output in default_output -@using("psi4") +@uusing("psi4") def test_run_psi4(tmp_path, schema_versions, request): """Tests qcengine run with psi4 and JSON input""" models, retver, _ = schema_versions @@ -101,8 +101,8 @@ def check_result(stdout): check_result(run_qcengine_cli(args, stdin=inp.model_dump_json())) -@using("geometric") -@using("psi4") +@uusing("geometric") +@uusing("psi4") def test_run_procedure(tmp_path, schema_versions, request): """Tests qcengine run-procedure with geometric, psi4, and JSON input""" models, retver, _ = schema_versions diff --git a/qcengine/tests/test_harness_canonical.py b/qcengine/tests/test_harness_canonical.py index 997258749..851da8c9a 100644 --- a/qcengine/tests/test_harness_canonical.py +++ b/qcengine/tests/test_harness_canonical.py @@ -12,50 +12,50 @@ from qcelemental.tests.test_model_results import center_data import qcengine as qcng -from qcengine.testing import checkver_and_convert, from_v2, has_program, schema_versions, schema_versions2, using +from qcengine.testing import checkver_and_convert, from_v2, schema_versions, schema_versions2, using, uusing qcsk_bs = {"name": "custom_basis", "center_data": center_data, "atom_map": ["bs_sto3g_h", "bs_sto3g_h"]} _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"}, {}), - ("terachem_pbs", {"method": "b3lyp", "basis": "6-31G"}, {}), - ("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.0e-3}), - ("cfour", {"method": "hf", "basis": "6-31G"}, {}), - ("gamess", {"method": "hf", "basis": "n31"}, {"basis__NGAUSS": 6}), - ("mctc-gcp", {"method": "dft/sv"}, {}), - ("mace", {"method": "small"}, {}), - ("aimnet2", {"method": "b973c"}, {}), - ("s-dftd3", {"method": "b3lyp-d3"}, {}), - ("dftd4", {"method": "b3lyp-d4"}, {}), + pytest.param("dftd3", {"method": "b3lyp-d3"}, {}, marks=using("classic-dftd3")), + pytest.param("qcore", {"method": "pbe", "basis": "6-31G"}, {}, marks=using("qcore")), + pytest.param("molpro", {"method": "hf", "basis": "6-31G"}, {}, marks=using("molpro")), + pytest.param("mopac", {"method": "PM6"}, {}, marks=using("mopac")), + pytest.param("mp2d", {"method": "MP2-DMP2"}, {}, marks=using("mp2d")), + pytest.param("nwchem", {"method": "hf", "basis": "6-31G"}, {}, marks=using("nwchem")), + pytest.param("openmm", {"method": "openff-1.0.0", "basis": "smirnoff"}, {}, marks=using("openmm")), + pytest.param("psi4", {"method": "hf", "basis": "6-31G"}, {}, marks=using("psi4")), + pytest.param("qchem", {"method": "hf", "basis": "6-31G"}, {}, marks=using("qchem")), + pytest.param("rdkit", {"method": "UFF"}, {}, marks=using("rdkit")), + pytest.param("terachem_pbs", {"method": "b3lyp", "basis": "6-31G"}, {}, marks=using("terachem_pbs")), + pytest.param("torchani", {"method": "ANI1x"}, {}, marks=using("torchani")), + pytest.param("turbomole", {"method": "pbe", "basis": "6-31G"}, {}, marks=using("turbomole")), + pytest.param("xtb", {"method": "GFN2-xTB"}, {}, marks=using("xtb")), + pytest.param("adcc", {"method": "adc2", "basis": "6-31G"}, {"n_triplets": 3}, marks=using("adcc")), + pytest.param("gcp", {"method": "hf3c"}, {}, marks=using("classic-gcp")), + pytest.param("mrchem", {"method": "blyp"}, {"world_prec": 1.0e-3}, marks=using("mrchem")), + pytest.param("cfour", {"method": "hf", "basis": "6-31G"}, {}, marks=using("cfour")), + pytest.param("gamess", {"method": "hf", "basis": "n31"}, {"basis__NGAUSS": 6}, marks=using("gamess")), + pytest.param("mctc-gcp", {"method": "dft/sv"}, {}, marks=using("mctc-gcp")), + pytest.param("mace", {"method": "small"}, {}, marks=using("mace")), + pytest.param("aimnet2", {"method": "b973c"}, {}, marks=using("aimnet2")), + pytest.param("s-dftd3", {"method": "b3lyp-d3"}, {}, marks=using("s-dftd3")), + pytest.param("dftd4", {"method": "b3lyp-d4"}, {}, marks=using("dftd4")), # add as programs available - # ("terachem", {"method": "bad"}), + # pytest.param("terachem", {"method": "bad"}, marks=using("")), ] _canonical_methods_qcsk_basis = [ - ("adcc", {"method": "adc2", "basis": qcsk_bs}, {"n_triplets": 3}), - ("cfour", {"method": "hf", "basis": qcsk_bs}, {}), - ("gamess", {"method": "hf", "basis": qcsk_bs}, {}), - ("molpro", {"method": "hf", "basis": qcsk_bs}, {}), - ("nwchem", {"method": "hf", "basis": qcsk_bs}, {}), - ("openmm", {"method": "openff-1.0.0", "basis": qcsk_bs}, {}), - pytest.param("psi4", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("psi4_mp2qcsk")), - ("qchem", {"method": "hf", "basis": qcsk_bs}, {}), - ("qcore", {"method": "pbe", "basis": qcsk_bs}, {}), - ("turbomole", {"method": "pbe", "basis": qcsk_bs}, {}), + pytest.param("adcc", {"method": "adc2", "basis": qcsk_bs}, {"n_triplets": 3}, marks=using("adcc")), + pytest.param("cfour", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("cfour")), + pytest.param("gamess", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("gamess")), + pytest.param("molpro", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("molpro")), + pytest.param("nwchem", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("nwchem")), + pytest.param("openmm", {"method": "openff-1.0.0", "basis": qcsk_bs}, {}, marks=using("openmm")), + pytest.param("psi4", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("psi4")), + pytest.param("qchem", {"method": "hf", "basis": qcsk_bs}, {}, marks=using("qchem")), + pytest.param("qcore", {"method": "pbe", "basis": qcsk_bs}, {}, marks=using("qcore")), + pytest.param("turbomole", {"method": "pbe", "basis": qcsk_bs}, {}, marks=using("turbomole")), ] @@ -71,9 +71,6 @@ def _get_molecule(program, molcls): def test_compute_energy(program, model, keywords, schema_versions, request): models, retver, _ = schema_versions - if not has_program(program): - pytest.skip(f"Program '{program}' not found.") - molecule = _get_molecule(program, models.Molecule) if from_v2(request.node.name): @@ -102,9 +99,6 @@ def test_compute_energy(program, model, keywords, schema_versions, request): def test_compute_gradient(program, model, keywords, schema_versions, request): models, retver, _ = schema_versions - if not has_program(program): - pytest.skip("Program '{}' not found.".format(program)) - molecule = _get_molecule(program, models.Molecule) if from_v2(request.node.name): @@ -152,9 +146,6 @@ def test_compute_gradient(program, model, keywords, schema_versions, request): def test_compute_energy_qcsk_basis(program, model, keywords, schema_versions, request): models, retver, _ = schema_versions - if not has_program(program): - pytest.skip("Program '{}' not found.".format(program)) - molecule = _get_molecule(program, models.Molecule) if from_v2(request.node.name): inp = models.AtomicInput( @@ -174,26 +165,26 @@ def test_compute_energy_qcsk_basis(program, model, keywords, schema_versions, re @pytest.mark.parametrize( "program, model", [ - ("cfour", {"method": "bad"}), - ("dftd3", {"method": "bad"}), - ("dftd3", {"method": "b3lyp-d3", "driver": "hessian"}), - ("qcore", {"method": "bad"}), - ("gamess", {"method": "bad"}), - ("mopac", {"method": "bad"}), - ("mp2d", {"method": "bad"}), - ("nwchem", {"method": "bad"}), - ("openmm", {"method": "bad"}), - ("psi4", {"method": "bad"}), - ("qchem", {"method": "bad"}), - ("rdkit", {"method": "bad"}), - ("terachem_pbs", {"method": "bad"}), - ("torchani", {"method": "bad"}), - ("turbomole", {"method": "bad"}), - ("adcc", {"method": "bad"}), - ("gcp", {"method": "bad"}), - ("mrchem", {"method": "bad"}), - ("mctc-gcp", {"method": "bad"}), - ("mace", {"method": "bad"}) + pytest.param("cfour", {"method": "bad"}, marks=using("cfour")), + pytest.param("dftd3", {"method": "bad"}, marks=using("classic-dftd3")), + pytest.param("dftd3", {"method": "b3lyp-d3", "driver": "hessian"}, marks=using("classic-dftd3")), + pytest.param("qcore", {"method": "bad"}, marks=using("qcore")), + pytest.param("gamess", {"method": "bad"}, marks=using("gamess")), + pytest.param("mopac", {"method": "bad"}, marks=using("mopac")), + pytest.param("mp2d", {"method": "bad"}, marks=using("mp2d")), + pytest.param("nwchem", {"method": "bad"}, marks=using("nwchem")), + pytest.param("openmm", {"method": "bad"}, marks=using("openmm")), + pytest.param("psi4", {"method": "bad"}, marks=using("psi4")), + pytest.param("qchem", {"method": "bad"}, marks=using("qchem")), + pytest.param("rdkit", {"method": "bad"}, marks=using("rdkit")), + pytest.param("terachem_pbs", {"method": "bad"}, marks=using("terachem_pbs")), + pytest.param("torchani", {"method": "bad"}, marks=using("torchani")), + pytest.param("turbomole", {"method": "bad"}, marks=using("turbomole")), + pytest.param("adcc", {"method": "bad"}, marks=using("adcc")), + pytest.param("gcp", {"method": "bad"}, marks=using("classic-gcp")), + pytest.param("mrchem", {"method": "bad"}, marks=using("mrchem")), + pytest.param("mctc-gcp", {"method": "bad"}, marks=using("mctc-gcp")), + pytest.param("mace", {"method": "bad"}, marks=using("mace")) # add as programs available # ("molpro", {"method": "bad"}), # ("terachem", {"method": "bad"}), @@ -206,9 +197,6 @@ def test_compute_energy_qcsk_basis(program, model, keywords, schema_versions, re def test_compute_bad_models(program, model, schema_versions, request, raiserr, retdict, inpdict): models, retver, _ = schema_versions - if not has_program(program): - pytest.skip("Program '{}' not found.".format(program)) - amodel = copy.deepcopy(model) adriver = amodel.pop("driver", "energy") if from_v2(request.node.name): @@ -258,7 +246,7 @@ def test_compute_bad_models(program, model, schema_versions, request, raiserr, r assert ret_method == model["method"], "input not copied over" -@using("nwchem") +@uusing("nwchem") @pytest.mark.parametrize("envshim", [True, False]) @pytest.mark.parametrize("model", ["Atomic"]) @pytest.mark.parametrize( @@ -366,7 +354,7 @@ def test_compute_output_table(goodcalc, input_data, return_version, return_dict, @pytest.mark.parametrize( "program, model", [ - ("psi4", {"method": "hf", "driver": "eighth"}), + pytest.param("psi4", {"method": "hf", "driver": "eighth"}, marks=using("psi4")), ], ) @pytest.mark.parametrize("raiserr", [False, True]) @@ -374,9 +362,6 @@ def test_compute_output_table(goodcalc, input_data, return_version, return_dict, def test_compute_badder_models(program, model, schema_versions2, request, raiserr, retdict): models, retver, _ = schema_versions2 - if not has_program(program): - pytest.skip("Program '{}' not found.".format(program)) - amodel = copy.deepcopy(model) adriver = amodel.pop("driver", "energy") if from_v2(request.node.name): @@ -418,15 +403,13 @@ def test_compute_badder_models(program, model, schema_versions2, request, raiser assert ret.input_data["driver"] == "eighth", "input not copied over" +@uusing("psi4") def test_psi4_restarts(monkeypatch, schema_versions, request): """ Make sure that a random error is raised which can be restarted if psi4 fails with no error message """ models, retver, _ = schema_versions - if not has_program("psi4"): - pytest.skip("Program psi4 not found.") - # create the psi4 task if from_v2(request.node.name): inp = models.AtomicInput( diff --git a/qcengine/tests/test_mdi.py b/qcengine/tests/test_mdi.py index a32ae4090..6f7b15d6d 100644 --- a/qcengine/tests/test_mdi.py +++ b/qcengine/tests/test_mdi.py @@ -7,11 +7,11 @@ from qcelemental.testing import compare_values import qcengine as qcng -from qcengine.testing import using +from qcengine.testing import uusing -@using("psi4") -@using("mdi") +@uusing("psi4") +@uusing("mdi") def test_mdi_water(): json_data = { "molecule": qcng.get_molecule("water"), diff --git a/qcengine/tests/test_procedures.py b/qcengine/tests/test_procedures.py index 7a9c25e4f..0e3b4bea9 100644 --- a/qcengine/tests/test_procedures.py +++ b/qcengine/tests/test_procedures.py @@ -9,7 +9,7 @@ import qcelemental as qcel import qcengine as qcng -from qcengine.testing import checkver_and_convert, failure_engine, from_v2, schema_versions, using +from qcengine.testing import checkver_and_convert, failure_engine, from_v2, schema_versions, using, uusing @pytest.fixture(scope="function") @@ -30,7 +30,7 @@ def input_data(request): } -@using("psi4") +@uusing("psi4") @pytest.mark.parametrize("ncores", [1, 4]) @pytest.mark.parametrize( "optimizer", @@ -127,7 +127,7 @@ def test_geometric_psi4(input_data, optimizer, ncores, schema_versions, request) assert "myopttag" in ret.extras, ret.extras.keys() -@using("psi4") +@uusing("psi4") @pytest.mark.parametrize( "optimizer", [ @@ -295,8 +295,8 @@ def test_optimizer_protocols(optimizer, gradprog, gradmodel, input_data, schema_ assert len(trajs_tgt) > 2 -@using("psi4") -@using("berny") +@uusing("psi4") +@uusing("berny") def test_berny_failed_gradient_computation(input_data, schema_versions, request): models, retver, _ = schema_versions @@ -321,8 +321,8 @@ def test_berny_failed_gradient_computation(input_data, schema_versions, request) assert ret.error.error_type == qcng.exceptions.InputError.error_type -@using("geometric") -@using("rdkit") +@uusing("geometric") +@uusing("rdkit") def test_geometric_rdkit_error(input_data, schema_versions, request): models, retver, _ = schema_versions @@ -350,7 +350,7 @@ def test_geometric_rdkit_error(input_data, schema_versions, request): assert isinstance(ret, (qcel.models.v1.FailedOperation, qcel.models.v2.FailedOperation)) -@using("rdkit") +@uusing("rdkit") @pytest.mark.parametrize( "optimizer", [ @@ -407,7 +407,7 @@ def test_optimization_protocols(optimizer, input_data, schema_versions, request) assert ret.final_molecule.get_hash() == trajs_tgt[1].molecule.get_hash() -@using("geometric") +@uusing("geometric") def test_geometric_retries(failure_engine, input_data, schema_versions, request): import geometric @@ -464,7 +464,7 @@ def test_geometric_retries(failure_engine, input_data, schema_versions, request) assert len(ret.input_data["trajectory"]) == 2 -@using("geometric") +@uusing("geometric") @pytest.mark.parametrize( "program, model, bench", [ @@ -560,7 +560,7 @@ def test_geometric_generic(input_data, program, model, bench, schema_versions, r # the _secret_tags shows up in Res.extras, not in Res.input_data.extras b/c geometric running v1 internally -@using("nwchem") +@uusing("nwchem") @pytest.mark.parametrize("linopt", [0, 1]) def test_nwchem_relax(linopt, schema_versions, request): models, retver, _ = schema_versions @@ -600,7 +600,7 @@ def test_nwchem_relax(linopt, schema_versions, request): assert pytest.approx(ret.final_molecule.measure([0, 1]), 1.0e-4) == 1.3459150737 -@using("nwchem") +@uusing("nwchem") def test_nwchem_restart(tmpdir, schema_versions, request): models, retver, _ = schema_versions @@ -642,8 +642,8 @@ def test_nwchem_restart(tmpdir, schema_versions, request): assert new_ret.success -@using("rdkit") -@using("torsiondrive") +@uusing("rdkit") +@uusing("torsiondrive") @pytest.mark.parametrize("scan_ptcl", ["none", "all", "lowest"]) def test_torsiondrive_generic(schema_versions, request, scan_ptcl): models, retver, _ = schema_versions @@ -735,8 +735,8 @@ def test_torsiondrive_generic(schema_versions, request, scan_ptcl): assert ret.stdout == "All optimizations converged at lowest energy. Job Finished!\n" -@using("mace") -@using("torsiondrive") +@uusing("mace") +@uusing("torsiondrive") def test_torsiondrive_extra_constraints(schema_versions, request): models, retver, _ = schema_versions @@ -827,7 +827,7 @@ def test_torsiondrive_extra_constraints(schema_versions, request): assert "All optimizations converged at lowest energy. Job Finished!\n" in ret.stdout -@using("mrchem") +@uusing("mrchem") @pytest.mark.parametrize( "optimizer", [ diff --git a/qcengine/tests/test_qcmanybody.py b/qcengine/tests/test_qcmanybody.py index 51ec6b863..0d6dfc81f 100644 --- a/qcengine/tests/test_qcmanybody.py +++ b/qcengine/tests/test_qcmanybody.py @@ -7,7 +7,7 @@ import qcengine as qcng from qcengine.testing import checkver_and_convert, from_v2 from qcengine.testing import schema_versions as schema_versionsALL5 -from qcengine.testing import schema_versions0, using +from qcengine.testing import schema_versions0, using, uusing try: import qcmanybody as qcmb @@ -35,7 +35,7 @@ def he_tetramer(schema_versions, request): ) -@using("qcmanybody") +@uusing("qcmanybody") @pytest.mark.parametrize( "program,basis,keywords", [ @@ -164,7 +164,7 @@ def test_nbody_he4_single( assert an_atres.stdout is None, f"[l] atomic protocol did not take" -@using("qcmanybody") +@uusing("qcmanybody") @pytest.mark.parametrize( "qcprog", [ @@ -247,7 +247,7 @@ def test_bsse_ene_tu6_cp_ne2(schema_versions, request, qcprog): assert compare(2, ret.properties.calcinfo_natom, label="nat") -@using("qcmanybody") +@uusing("qcmanybody") def test_mbe_error(schema_versions, request): models, retver, _ = schema_versions @@ -295,8 +295,8 @@ def test_mbe_error(schema_versions, request): assert "Program cms is not registered to QCEngine" in ret.error.error_message -@using("psi4") -@using("qcmanybody") +@uusing("psi4") +@uusing("qcmanybody") @pytest.mark.parametrize( "optimizer,bsse_type,sio", [ @@ -447,7 +447,7 @@ def test_bsse_opt_hf_trimer(schema_versions, request, optimizer, bsse_type, sio) assert ret_last_subres['["(auto)", [1, 2, 3], [1, 2, 3]]'].stdout is None, f"atomic protocol did not take" -@using("qcmanybody") +@uusing("qcmanybody") @pytest.mark.parametrize("schver", [2]) # GeneralizedOptimization retired (this was the v1 precursor) @pytest.mark.parametrize("bsse_type", ["mbe", "ssfc"]) # aka nocp, cp @pytest.mark.parametrize( @@ -535,7 +535,7 @@ def test_bsse_opt_lif_dimer(optimizer, opt_keywords, bsse_type, qcprog, qc_keywo ret = qcng.compute_procedure(opt_data, optimizer, raise_error=True, return_version=schver) # printing will show up if job fails - pprint.pprint(ret.dict(), width=200) + pprint.pprint(ret.model_dump(), width=200) assert ret.success