Skip to content

Commit

Permalink
CI for py312 (#433)
Browse files Browse the repository at this point in the history
* fix?

* experiment

* round

* qcer

* more sutff

* next

* asdf

* alt

* probe

* fix

* rework

* spell

* progress

* more

* deeper

* explciit call

* abc

* prog

* execute

* ef

* gh

* fix h

* ij

* l

* m

* b1c1

* b1

* full tests

* no hes2

* fixup

* last win

* escape

* again

* more

* asdf

* nwc

* suff

* more

* log

* new p4 packages

* remove lane
  • Loading branch information
loriab authored Oct 30, 2023
1 parent 3f91816 commit 1e771c6
Show file tree
Hide file tree
Showing 14 changed files with 158 additions and 48 deletions.
55 changes: 41 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,56 +21,84 @@ jobs:
cfg:
- conda-env: psi
python-version: 3.7
label: Psi4-release
label: Psi4-1.5
runs-on: ubuntu-latest
pytest: ""

- conda-env: psi-nightly
python-version: "3.10"
label: Psi4-nightly
label: Psi4-1.6
runs-on: ubuntu-latest
pytest: ""

- conda-env: psi-cf
python-version: "3.12"
label: Psi4-1.8
runs-on: windows-latest
pytest: "-k 'not (hes2 or qchem)'"

- conda-env: torchani
python-version: 3.8
label: ANI
runs-on: ubuntu-latest
pytest: ""

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

- conda-env: xtb
python-version: "3.10"
label: xTB
runs-on: ubuntu-latest
pytest: ""

- conda-env: qcore
python-version: 3.7
label: QCore
runs-on: ubuntu-latest
pytest: ""

- conda-env: nwchem
python-version: 3.8
label: NWChem
label: NWChem70
runs-on: ubuntu-20.04
pytest: ""
# formerly NWChem v6.6 with python-version: 3.6 & runs-on: ubuntu-16.04 but ubuntu env retired by GH Sep 2021

- conda-env: nwchem-cf
python-version: 3.12
label: NWChem
runs-on: ubuntu-latest
pytest: ""

- conda-env: mrchem
python-version: 3.8
label: MRChem
runs-on: ubuntu-latest
pytest: ""

- conda-env: adcc
python-version: 3.8
label: ADCC
runs-on: ubuntu-latest
pytest: ""

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

- conda-env: opt-disp-cf
python-version: 3.11
label: optimization-dispersion
runs-on: windows-latest
pytest: "-k 'not (hes2 or qchem)'"

name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }}" # • ${{ matrix.cfg.runs-on }}"
name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }} • ${{ matrix.cfg.runs-on }}"
runs-on: ${{ matrix.cfg.runs-on }}

steps:
Expand All @@ -93,7 +121,7 @@ jobs:
# note: any activate/deactivate use the conda cmd. other cmds use mamba cmd.

- name: Special Config - NWChem
if: "(matrix.cfg.label == 'NWChem')"
if: "(matrix.cfg.label == 'NWChem70')"
run: |
sudo apt-get -y install nwchem
Expand All @@ -102,23 +130,22 @@ jobs:
run: |
qcore --accept-license
# note: psi4 on c-f pins to a single qcel and qcng, so this may be handy for solve-and-replace
#- name: Special Config - QCElemental Dep
# if: (matrix.cfg.label == 'ADCC')
# run: |
# conda remove qcelemental --force
# python -m pip install qcelemental>=0.26.0 --no-deps
- name: Special Config - QCElemental Dep
if: false
run: |
conda remove qcelemental --force
python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@loriab-patch-2' --no-deps
# note: conda remove --force, not mamba remove --force b/c https://github.com/mamba-org/mamba/issues/412
# alt. is micromamba but not yet ready for setup-miniconda https://github.com/conda-incubator/setup-miniconda/issues/75
- name: Special Config - QCEngine Dep
if: "(matrix.cfg.label == 'Psi4-nightly') || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')"
if: "(startsWith(matrix.cfg.label, 'Psi4')) || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')"
run: |
conda remove qcengine --force
# QCEngine CI and Psi4 are circularly dependent, so a hack is in order
- name: Special Config - Faux Pydantic Upgrade
if: "(matrix.cfg.label == 'Psi4-nightly') || (matrix.cfg.label == 'optimization-dispersion')"
if: "((matrix.cfg.label == 'Psi4-1.6') || (matrix.cfg.label == 'optimization-dispersion')) && (runner.os != 'Windows')"
run: |
sed -i s/from\ pydantic\ /from\ pydantic.v1\ /g ${CONDA_PREFIX}/lib/python${{ matrix.cfg.python-version }}/site-packages/psi4/driver/*py
Expand All @@ -140,7 +167,7 @@ jobs:
- name: PyTest
run: |
pytest -rws -v --cov=qcengine --color=yes --cov-report=xml qcengine/
pytest -rws -v ${{ matrix.cfg.pytest }} --cov=qcengine --color=yes --cov-report=xml qcengine/
- name: CodeCov
uses: codecov/codecov-action@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
python-version: ["3.10"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Python Setup
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: "${{ matrix.python-version }}"

- name: Create Environment
shell: bash
Expand Down
19 changes: 19 additions & 0 deletions devtools/conda-envs/nwchem-cf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
channels:
- conda-forge
dependencies:
- nwchem

# Core
- python
- pyyaml
- py-cpuinfo
- psutil
- qcelemental >=0.24.0
- pydantic>=1.0.0
- networkx>=2.4.0

# Testing
- pytest
- pytest-cov
- codecov
35 changes: 35 additions & 0 deletions devtools/conda-envs/opt-disp-cf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: test
channels:
- conda-forge/label/libint_dev
- conda-forge
- nodefaults
dependencies:
- psi4
- rdkit
- mopac

# Mixed Tests
- dftd3-python
- dftd4-python
- gcp-correction
- geometric
- optking
- pymdi

# Core
- python
- pyyaml
- py-cpuinfo
- psutil
- qcelemental >=0.26.0
- pydantic=1.10.13
- msgpack-python

# Testing
- pytest
- pytest-cov
- codecov

- pip
- pip:
- pyberny
18 changes: 18 additions & 0 deletions devtools/conda-envs/psi-cf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: test
channels:
- conda-forge
- conda-forge/label/libint_dev
dependencies:
- psi4=1.8

# Core
- python
- pyyaml
- py-cpuinfo
- psutil
- msgpack-python

# Testing
- pytest
- pytest-cov
- codecov
2 changes: 1 addition & 1 deletion devtools/conda-envs/psi-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- psi4/label/dev
- conda-forge
dependencies:
- psi4
- psi4=1.6
- blas=*=mkl # not needed but an example of disuading solver from openblas and old psi

# Core
Expand Down
14 changes: 10 additions & 4 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ Changelog
.. WIP (Unmerged)
.. ++++++++++++++
.. - UNMERGED (:pr:`421`) GAMESS - error handling and memory @taylor-a-barnes
.. - UNMERGED (:pr:`405`, :issue:`415`, :pr:`417`) Config - change default `jobs_per_node` from 2 to more expected 1 so a single job fills the node. Alter CPU count formula to return physical cores on Hyerthreading machines, affecting default `ncores`. The net effect (both changes) for default cores running on Hyperthreading machines is unchanged. @cvsik, @loriab
.. - UNSOLVED (:issue:`397`) extras failed
v0.28.2 / 2023-MM-DD (Unreleased)
v0.29.0 / 2023-MM-DD (Unreleased)
--------------------

Breaking Changes
Expand All @@ -43,14 +42,21 @@ Enhancements

Bug Fixes
+++++++++
- (:pr:`427`) Config - Once again, expand environment variables (now more flexibly) and newly expand ``~``
passed into TaskConfig. Particularly relevant for scratch setting. @yueyericardo
- (:pr:`428`) MDI - Ensure that molecule orientation remains fixed for MDI. @taylor-a-barnes
- (:pr:`405`, :issue:`415`, :pr:`417`) Config - change default ``jobs_per_node`` from 2 to more expected 1
so a single job fills the node. Alter CPU count formula to return physical cores on Hyerthreading
machines, affecting default ``ncores``. The net effect (both changes) for default cores running on
Hyperthreading machines is unchanged. @cvsik, @loriab
UNMERGED - (:pr:`433`) Turbomole, Q-Chem - Use raw strings when needed to avoid py312 warnings.

Misc.
+++++
UNMERGED - (:pr:`433`) CI - Check py312 and some Windows lanes.

MUST (Unmerged)
+++++++++++++++
- UNMERGED (:pr:`427`) Config - Once again, expand environment variables (now more flexibly) and newly expand ``~``
passed into TaskConfig. Particularly relevant for scratch setting.


v0.28.1 / 2023-08-18
Expand Down
2 changes: 1 addition & 1 deletion qcengine/programs/qchem.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ def _parse_logfile_common(self, outtext: str, input_dict: Dict[str, Any]):

properties["calcinfo_natom"] = len(input_dict["molecule"]["symbols"])

mobj = re.search(r"\n\s*(\d+)\s+" + NUMBER + "\s+" + NUMBER + r"\s+Convergence criterion met\s*\n", outtext)
mobj = re.search(r"\n\s*(\d+)\s+" + NUMBER + r"\s+" + NUMBER + r"\s+Convergence criterion met\s*\n", outtext)
if mobj:
properties["scf_iterations"] = int(mobj.group(1))

Expand Down
4 changes: 4 additions & 0 deletions qcengine/programs/tests/test_canonical_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import pprint
import re
import sys
import tempfile
from pathlib import Path

Expand Down Expand Up @@ -182,6 +183,9 @@ def test_local_options_scratch(program, model, keywords):
"nwchem": "E. Apra", # freebie
"psi4": rf"Scratch directory: {scratch_directory}/tmp\w+_psi_scratch/",
}
if sys.platform.startswith("win"):
# too hard to regex Windows paths that need escape chars
stdout_ref["psi4"] = f"Scratch directory: "

# a scratch file (preferrably output) expected after job if scratch not cleaned up
scratch_sample = {
Expand Down
Loading

0 comments on commit 1e771c6

Please sign in to comment.