Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DNM] Try adding fast psi4 integration test #236

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: [3.8]
openeye: [true, false]
os: [ubuntu-latest]
#os: [ubuntu-latest, macOS-latest]
python-version: ["3.10"]
openeye: [true]
integration: [true]

env:
Expand All @@ -35,8 +36,9 @@ jobs:
uses: mamba-org/provision-with-micromamba@main
with:
environment-file: devtools/conda-envs/test-env.yaml
extra-specs: |
python=${{ matrix.python-version }}
channel-priority: "flexible"
#extra-specs: |
# python=${{ matrix.python-version }}

- name: Install with AmberTools
if: ${{ matrix.openeye == false }}
Expand Down Expand Up @@ -66,22 +68,19 @@ jobs:
conda info
conda list

- name: Run Tests
shell: bash -l {0}
run: |
pytest -v --cov=openff --cov-config=setup.cfg openff/bespokefit/tests --cov-report=xml
#- name: Run Tests
# shell: bash -l {0}
# run: |
# pytest -v --cov=openff --cov-config=setup.cfg openff/bespokefit/tests --cov-report=xml

- name: Codecov
uses: codecov/[email protected]
with:
file: ./coverage.xml
fail_ci_if_error: false
#- name: Codecov
# uses: codecov/[email protected]
# with:
# file: ./coverage.xml
# fail_ci_if_error: false

- name: Run Integration Tests
if: ${{ matrix.integration == true }}
shell: bash -l {0}
run: |
openff-bespoke executor run --smiles 'CC' \
--workflow 'default' \
--default-qc-spec xtb gfn2xtb none \
--target-torsion '[C:1]-[C:2]'
openff-bespoke executor run --smiles "CC" --target-torsion '[C:1]-[C:2]' --workflow-file openff/bespokefit/data/test/miscellaneous/fast-psi4-workflow.yaml
5 changes: 3 additions & 2 deletions devtools/conda-envs/no_openeye.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: bespokefit-no-openeye

channels:
- psi4
- conda-forge
- nodefaults
- defaults

dependencies:

Expand Down Expand Up @@ -35,7 +36,7 @@ dependencies:
# Optional
- forcebalance
- openff-fragmenter-base
- xtb-python
- psi4

### Bespoke dependencies

Expand Down
15 changes: 8 additions & 7 deletions devtools/conda-envs/test-env.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: bespokefit-test

channels:
- openeye
- psi4
- conda-forge
- nodefaults
- openeye
- defaults

dependencies:

Expand All @@ -20,11 +21,11 @@ dependencies:
- rich
- click
- click-option-group
- rdkit
#- rdkit
- openff-utilities
- openff-toolkit-base >=0.11.3
- openff-toolkit-base >=0.12
- openff-forcefields
- openff-interchange
- openff-interchange-base >=0.2.3
- openff-units
- openff-qcsubmit
- openmm >=7.6.0
Expand All @@ -34,9 +35,9 @@ dependencies:
- importlib_metadata >=4

# Optional
- forcebalance
- forcebalance =1.9.5
- openff-fragmenter-base
- xtb-python
- psi4 >=1.5
- openeye-toolkits

### Bespoke dependencies
Expand Down
47 changes: 47 additions & 0 deletions openff/bespokefit/data/test/miscellaneous/fast-psi4-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
default_qc_specs:
- basis: STO-3G
implicit_solvent: null
keywords: null
maxiter: 200
method: hf
program: psi4
scf_properties:
- dipole
- quadrupole
- wiberg_lowdin_indices
- mayer_indices
spec_description: Standard OpenFF optimization quantum chemistry specification.
spec_name: default
store_wavefunction: none
initial_force_field: openff_unconstrained-2.0.0.offxml
target_templates:
- attenuate_weights: true
calculation_specification:
grid_spacing: 90
model:
basis: sto-3g
method: hf
n_conformers: 1
optimization_spec:
check: 0
constraints: {}
convergence_set: GAU_LOOSE
coordsys: dlc
enforce: 0.1
epsilon: 0.0
maxiter: 300
molcnv: false
program: geometric
qccnv: true
reset: true
tmax: 0.3
trust: 0.1
program: psi4
scan_range: null
type: torsion1d
energy_cutoff: 10.0
energy_denominator: 1.0
extras: {}
reference_data: null
type: TorsionProfile
weight: 1.0
8 changes: 4 additions & 4 deletions openff/bespokefit/utilities/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def canonical_order_atoms(molecule: Molecule):

molecule = molecule.remap(atom_map, current_to_new=True)

if "atom_map" in molecule.properties:
molecule.properties["atom_map"] = {
atom_map[i]: j for i, j in molecule.properties["atom_map"].items()
}
# if "atom_map" in molecule.properties:
# molecule.properties["atom_map"] = {
# atom_map[i]: j for i, j in molecule.properties["atom_map"].items()
# }

return molecule

Expand Down