Skip to content

Commit

Permalink
Merge branch 'master' into td_constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
loriab authored Jan 14, 2025
2 parents 0e465c8 + 3a01eb2 commit 882d495
Show file tree
Hide file tree
Showing 15 changed files with 270 additions and 35 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ jobs:
runs-on: ubuntu-latest
pytest: ""

- conda-env: aimnet2
python-version: 3.11
label: AIMNET2
runs-on: ubuntu-latest
pytest: ""

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

Expand All @@ -113,15 +119,13 @@ jobs:
fetch-depth: 0

- name: Create Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: devtools/conda-envs/${{ matrix.cfg.conda-env }}.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
show-channel-urls: true
miniforge-variant: Mambaforge
use-mamba: true
add-pip-as-python-dependency: true
# note: conda-forge chnl req'd for Mambaforge, but we'll spec in file, not here `channels: conda-forge,...`
# note: any activate/deactivate use the conda cmd. other cmds use mamba cmd.
Expand Down Expand Up @@ -157,14 +161,15 @@ jobs:
- name: Environment Information
run: |
mamba info
mamba list
conda info
conda list
- name: Install QCEngine
run: |
python -m pip install . --no-deps
- name: QCEngineRecords
if: "(matrix.cfg.label != 'Psi4-1.6')"
run: |
qcengine info
export QCER_VER=`python -c "import qcengine.testing; print(qcengine.testing.QCENGINE_RECORDS_COMMIT)"`
Expand Down Expand Up @@ -199,21 +204,19 @@ jobs:
- uses: actions/checkout@v3

- name: Create Environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
environment-file: devtools/conda-envs/${{ matrix.cfg.conda-env }}.yaml
python-version: ${{ matrix.cfg.python-version }}
auto-activate-base: false
miniforge-variant: Mambaforge
use-mamba: true
add-pip-as-python-dependency: true
channels: conda-forge

- name: Environment Information
run: |
mamba info
mamba list --show-channel-urls
conda info
conda list --show-channel-urls
- name: Build Documentation
run: |
Expand Down
19 changes: 19 additions & 0 deletions devtools/conda-envs/aimnet2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: test
channels:
- conda-forge
dependencies:

# Core
- python
- pip
- pyyaml
- py-cpuinfo
- psutil
- qcelemental >=0.12.0
- pydantic>=1.0.0

# Testing
- pytest
- pytest-cov
- codecov
- pyaimnet2
5 changes: 3 additions & 2 deletions devtools/conda-envs/mace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ dependencies:
- pydantic>=1.0.0

# mace deps
- pymace
- pymace=0.3.6
- numpy<2.0 # until conda package imposes

# Testing
- pytest
- pytest-cov
- codecov
- codecov
2 changes: 1 addition & 1 deletion devtools/conda-envs/opt-disp-cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- psi4
- psi4=1.9.1
- rdkit
- mopac

Expand Down
1 change: 1 addition & 0 deletions devtools/conda-envs/psi-cf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ channels:
- conda-forge/label/libint_dev
dependencies:
- psi4=1.8
- numpy<2

# Core
- python
Expand Down
1 change: 1 addition & 0 deletions devtools/conda-envs/psi-nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- psi4=1.6
- blas=*=mkl # not needed but an example of disuading solver from openblas and old psi
- numpy=1

# Core
- python
Expand Down
39 changes: 38 additions & 1 deletion docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Changelog
=========

.. vX.Y.0 / 2023-MM-DD (Unreleased)
.. vX.Y.0 / 2025-MM-DD (Unreleased)
.. --------------------
..
.. Breaking Changes
Expand All @@ -28,6 +28,43 @@ Changelog
.. - UNSOLVED (:issue:`397`) extras failed
v0.31.0 / 2025-MM-DD (Unreleased)
--------------------

Breaking Changes
++++++++++++++++

New Features
++++++++++++

Enhancements
++++++++++++
- (:pr:`463`) Maint - Pin to QCElemental <0.70 since we now know QCSchema v2 release schedule.
- (:pr:`463`) MACE - New v0.3.9 release yields a pytorch error, so recommend pymace=0.3.6 .

Bug Fixes
+++++++++
- (:pr:`451`, :issue:`450`) Psi4 - Fixes bug in Psi4 detection when command `python` not available. @susilehtola, @topazus

Misc.
+++++
- (:pr:`457`) Docs - Fix auto-numbering on a documentation page. @mikemhenry


v0.30.0 / 2024-06-25
--------------------

New Features
++++++++++++
- (:pr:`441`) MACE - Added harness for MACE-OFF23 and local MACE models. @jthorton
- (:pr:`443`) AIMNET2 - Added harness for AIMNET2 NN ML models. @jthorton

Misc.
+++++
- (:pr:`445`) CI - fix some test regex issues.
- (:pr:`449`) Maint - bump the QCElemental compatibility range.


v0.29.0 / 2023-10-31
--------------------

Expand Down
36 changes: 18 additions & 18 deletions docs/source/dev_program_harness.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@ harness may be created.

This guide is a coarse path through adding a new program harness.

1. Open up communication with the QCEngine maintainers. Post an issue
#. Open up communication with the QCEngine maintainers. Post an issue
to GitHub and join the Slack channel (link off GH README) so you can
get advice.

1. Copy a similar harness. Choose a program that your code behaves
#. Copy a similar harness. Choose a program that your code behaves
roughly like (mostly consider parsed vs. API access) and copy that
harness, renaming it as your own and commenting out all but the
structure. Search for the (copied) harness name to register it.

1. Fill in the ``_defaults`` section with program name and characteristics.
#. Fill in the ``_defaults`` section with program name and characteristics.

1. Fill in the ``def found`` function using ``which`` and
#. Fill in the ``def found`` function using ``which`` and
``which_import`` from QCElemental. See NWChem and OpenMM for examples
of handling additional dependencies.

1. If your code's version can be extracted short of parsing an output
#. If your code's version can be extracted short of parsing an output
file, fill in ``def get_version`` next. After this, ``> qcengine info``
should show your code (provided it's in path).

1. To get a string output of QCSchema Molecule in your code's format,
#. To get a string output of QCSchema Molecule in your code's format,
you may need to add a ``dtype`` at ``qcelemental/molparse/to_string.py``.

1. If your code's of the common translate-QCSchema-to-input, run,
#. If your code's of the common translate-QCSchema-to-input, run,
translate-output-to-QCSchema variety, next work on the ``def execute``
function. This is fairly simple because it calls the powerful
qcengine.util.execute to handle scratch, timeout, file writing and
Expand All @@ -46,50 +46,50 @@ This guide is a coarse path through adding a new program harness.
of any scratch files to return for processing. Once ready, fill in
``def get_version`` if not done above.

1. Now fill in the short ``def compute`` entirely and ``def build_input``
#. Now fill in the short ``def compute`` entirely and ``def build_input``
and ``def parse_output`` skeletally. Set up a simple molecule-and-model
``AtomicInput`` dictionary and run it with ``qcng.compute(atomicinput,
"yourcode")`` to get something to iterate on.

1. Fill in ``def build_input`` to form your code's usual input format
#. Fill in ``def build_input`` to form your code's usual input format
from the fields of ``AtomicInput``.

1. Fill in ``def parse_output`` to take results and put them
#. Fill in ``def parse_output`` to take results and put them
into ``AtomicResult``. Most important is the ``return_result``
field. ``AtomicResultProperties`` can be populated when
convenient. ``WavefunctionProperties`` is great but save for a later
pass.

1. At this point your harness can correctly run one or more QCSchema
#. At this point your harness can correctly run one or more QCSchema
inputs of your devising. Time to put it through paces. Register your
code in ``_programs`` in ``testing.py``. Most tests will then need a
``@using("yourcode")`` decorator so that they don't run (and fail the
test suite) when your code isn't available.

1. Add basic tests to qcengine/tests/test_harness_canonical.py
#. Add basic tests to qcengine/tests/test_harness_canonical.py
* def test_compute_energy(program, model, keywords):
* def test_compute_gradient(program, model, keywords):
* def test_compute_energy_qcsk_basis(program, model, keywords):

1. Add basic failure tests to qcengine/tests/test_harness_canonical.py
#. Add basic failure tests to qcengine/tests/test_harness_canonical.py
* def test_compute_bad_models(program, model):

1. Add tests for the runtime config and to qcengine/programs/tests/test_canonical_config.py
#. Add tests for the runtime config and to qcengine/programs/tests/test_canonical_config.py

1. For QM codes, consider adding lines to the
#. For QM codes, consider adding lines to the
qcengine/programs/tests/test_standard_suite.py to check energies,
gradients, and Hessians against other codes.

1. For codes that can produce a Hartree--Fock, add lines to the
#. For codes that can produce a Hartree--Fock, add lines to the
qcengine/program/tests/test_alignment.py to check molecular and
properties orientation handling.

1. If your code is available as a visible binary (e.g., pip, conda,
#. If your code is available as a visible binary (e.g., pip, conda,
docker download with no or trivial build), create a testing lane by
adding to ``devtools/conda-envs/`` and ``.github/workflows/CI.yml``.
This will check your code for every PR. We're looking into private
testing for codes that aren't available.

1. Throughout, talk with the maintainers with questions. Error handling,
#. Throughout, talk with the maintainers with questions. Error handling,
especially, is intricate.

Loading

0 comments on commit 882d495

Please sign in to comment.