Skip to content

enable many-body optimizations through v2 #288

enable many-body optimizations through v2

enable many-body optimizations through v2 #288

Workflow file for this run

name: CI
on:
push:
tags:
- 'v[0-9]*.[0-9]*.[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*a[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*b[0-9]*'
- 'v[0-9]*.[0-9]*.[0-9]*rc[0-9]*'
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "9 16 * * 1"
jobs:
build:
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- label: Py-min
python-version: "3.10"
runs-on: ubuntu-latest
pytest: "-m 'not addon'"
- label: Py-max
python-version: "3.13"
runs-on: ubuntu-latest
pytest: "-k '(not (he4 and (3b or 4b) and not sio)) or supersys'"
- label: Py-314
python-version: "3.14"
runs-on: ubuntu-latest
pytest: "-k '(not (he4 and (3b or 4b) and not sio)) or supersys'"
- label: Demo
python-version: "3.11"
runs-on: ubuntu-latest
pytest: "-k 'examples or (121-nwchem_psi4 and 4b)'"
- label: QCSk-next
python-version: "3.12"
runs-on: ubuntu-latest
pytest: "-k '((not (he4 and (3b or 4b) and not sio)) or supersys) and not vmfc'"
name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }} • ${{ matrix.cfg.runs-on }}"
runs-on: ${{ matrix.cfg.runs-on }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Write a Conda Env File
run: |
cat > export.yaml <<EOF
name: test
channels:
- conda-forge
- conda-forge/label/qcelemental_dev
- conda-forge/label/qcengine_dev
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcelemental >=0.50.0rc2
- qcengine >=0.50rc1 # TODO temp
- pydantic
# Testing
- pytest
- zstandard
- pytest-cov
- codecov
# Testing CMS
#- dummy1
#- dummy2
#- dummy3
#- nwchem # lands on different he4 soln
EOF
if [[ "${{ matrix.cfg.label }}" == "Py-min" ]]; then
:
#sed -i "s;pydantic;pydantic=1;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Py-max" ]]; then
sed -i "s;#- dummy1;- psi4;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Demo" ]]; then
:
sed -i "s;#- dummy1;- psi4=1.9.1;g" export.yaml
sed -i "s;#- dummy3;- libint=2.9.0=*_4;g" export.yaml
sed -i "s;#- dummy2;- nwchem;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "QCSk-next" ]]; then
sed -i "s;pydantic;pydantic=2;g" export.yaml
sed -i "s;#- dummy1;- psi4;g" export.yaml
sed -i "s;#- dummy2;- pydantic-settings;g" export.yaml
fi
if [[ "${{ matrix.cfg.label }}" == "Py-314" ]]; then
sed -i "s;#- nwchem;- nwchem;g" export.yaml
sed -i "s;#- dummy1;- msgpack-python;g" export.yaml
sed -i "s;#- dummy2;- networkx;g" export.yaml
fi
# model sed for L/W
# sed -i "s;;;g" export.yaml
# model sed for M
# sed -E -i.bak "s;;;g" export.yaml
cat export.yaml
- name: Create Environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: export.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
show-channel-urls: true
add-pip-as-python-dependency: true
channels: conda-forge
conda-remove-defaults: true
- 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
- name: Special Config - QCEngine Dep
if: false
#if: "(startsWith(matrix.cfg.label, 'Psi4')) || (matrix.cfg.label == 'ADCC') || (matrix.cfg.label == 'optimization-dispersion')"
run: |
conda remove qcengine --force
- name: Special Config - QCSchema Next Deps
if: "(startsWith(matrix.cfg.label, 'QCSk-next'))"
run: |
conda remove qcelemental qcengine --force
python -m pip install 'git+https://github.com/MolSSI/QCElemental.git@next2026' --no-deps
python -m pip install 'git+https://github.com/MolSSI/QCEngine.git@next2026' --no-deps
- name: Environment Information
run: |
conda info
conda list
- name: Install QCManyBody
run: |
pip install -e .
# python -m pip install . --no-deps # gives no codecov beyond tests
- name: Configure QCEngine
if: "(matrix.cfg.label != 'Py-min')"
run: |
cat > qcengine.yaml <<EOF
all:
hostname_pattern: "*"
memory: 2
ncores: 2
EOF
cat qcengine.yaml
qcengine info
- name: PyTest
run: |
pytest -rws -v ${{ matrix.cfg.pytest }} \
--cov=qcmanybody --cov-report=xml \
--color=yes --durations 50 --durations-min 20
- name: CodeCov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: loriab/QCManyBody
release_docs:
needs: [build]
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
cfg:
- label: Sphinx
python-version: "3.10"
runs-on: ubuntu-latest
name: "🐍 ${{ matrix.cfg.python-version }} • ${{ matrix.cfg.label }}"
runs-on: ${{ matrix.cfg.runs-on }}
steps:
- uses: actions/checkout@v4
- name: Write a Conda Env File
run: |
cat > export.yaml <<EOF
name: test
channels:
- conda-forge
- conda-forge/label/qcelemental_dev
- conda-forge/label/qcengine_dev
dependencies:
# Build
- setuptools
- setuptools-scm
# Core
- python
- qcelemental >=0.50.0rc2
# Docs
- numpydoc
- docutils
- sphinx >=7.0.0
- sphinxcontrib-napoleon
- sphinx-rtd-theme
- autodoc-pydantic >=2
- sphinx-automodapi
- sphinx-autodoc-typehints
- pydantic >=2
EOF
cat export.yaml
- name: Create Environment
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: export.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
show-channel-urls: true
add-pip-as-python-dependency: true
channels: conda-forge
conda-remove-defaults: true
- name: Environment Information
run: |
conda info
conda list --show-channel-urls
- name: Build Documentation
run: |
python -m pip install . --no-deps
QCMANYBODY_MAX_NBODY=5 sphinx-build docs/ build/docs
- name: Compute docs deploy target
id: target
shell: bash
run: |
set -euo pipefail
echo GITHUB_REF_TYPE ${GITHUB_REF_TYPE}
echo GITHUB_REF_NAME ${GITHUB_REF_NAME}
echo GITHUB_REF ${GITHUB_REF}
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
echo "target_folder=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
echo "version_label=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then
echo "target_folder=dev" >> "$GITHUB_OUTPUT"
echo "version_label=dev" >> "$GITHUB_OUTPUT"
else
echo "target_folder=" >> "$GITHUB_OUTPUT"
echo "version_label=" >> "$GITHUB_OUTPUT"
fi
echo GITHUB_OUTPUT ${GITHUB_OUTPUT}
- name: GitHub Pages Deploy
uses: JamesIves/github-pages-deploy-action@v4
if: github.event_name == 'push' && github.repository == 'MolSSI/QCManyBody' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
with:
branch: gh-pages
folder: build/docs/
target-folder: ${{ steps.target.outputs.target_folder }}
clean: false
- name: Update versions.json
if: github.event_name == 'push' && github.repository == 'MolSSI/QCManyBody' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_LABEL: ${{ steps.target.outputs.version_label }}
TARGET_FOLDER: ${{ steps.target.outputs.target_folder }}
run: |
set -euo pipefail
rm -rf _ghp
git clone --depth 1 --branch gh-pages "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" _ghp
cd _ghp
# Create versions.json if it doesn't exist yet
if [[ ! -f versions.json ]]; then
cat > versions.json <<'JSON'
[
{"label": "dev", "path": "dev/"},
{"label": "v0.5.1", "path": "v0.5.1"},
{"label": "v0.5.2", "path": "v0.5.2/"}
]
JSON
fi
python - <<'PY'
import json, pathlib, os
p = pathlib.Path("versions.json")
data = json.loads(p.read_text())
pinned = [
{"label": "dev", "path": "dev/"},
{"label": "v0.5.1", "path": "v0.5.1/"},
{"label": "v0.5.2", "path": "v0.5.2/"},
]
lbl = os.environ.get("VERSION_LABEL", "")
tgt = os.environ.get("TARGET_FOLDER", "")
if lbl and lbl not in ("dev",) and tgt:
pinned.insert(1, {"label": lbl, "path": tgt.rstrip("/") + "/"})
p.write_text(json.dumps(pinned, indent=2) + "\n")
PY
if ! git diff --quiet; then
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add versions.json
git commit -m "docs: update versions.json (${GITHUB_REF})"
git push origin gh-pages
fi