Skip to content

Commit 858a898

Browse files
Uniformly lint (#89)
* Lint * Lint * Lint * Specify tolerances * Re-lint * Fix bad merge * Show changes to OFFXML files * Still error out
1 parent 5297297 commit 858a898

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+480
-443
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The full error message (may be large, that's fine. Better to paste too much than
3232

3333
**Computing environment (please complete the following information):**
3434
- Operating system
35-
- Output of running `conda list`
35+
- Output of running `conda list`
3636

3737
**Additional context**
3838
Add any other context about the problem here.

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ jobs:
8989
run: |
9090
if test "$( git diff openforcefields/offxml/ | wc | awk '{print $1}' )" -gt 0
9191
then
92+
echo 'The following changes in OFFXML files were detected:'
93+
git diff openforcefields/offxml/
9294
exit 1
9395
else
9496
echo 'no files differ'

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: debug-statements
9+
- repo: https://github.com/psf/black
10+
rev: 23.10.1
11+
hooks:
12+
- id: black
13+
- repo: https://github.com/PyCQA/isort
14+
rev: 5.12.0
15+
hooks:
16+
- id: isort
17+
- repo: https://github.com/PyCQA/flake8
18+
rev: 6.1.0
19+
hooks:
20+
- id: flake8
21+
- repo: https://github.com/asottile/pyupgrade
22+
rev: v3.15.0
23+
hooks:
24+
- id: pyupgrade
25+
exclude: openforcefields/_version.py|setup.py

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ exhaustive, and do not form part of our licenses.
5151
such as asking that all changes be marked or described.
5252
Although not required by our licenses, you are encouraged to
5353
respect those requests where reasonable. More considerations
54-
for the public:
54+
for the public:
5555
wiki.creativecommons.org/Considerations_for_licensees
5656

5757
=======================================================================
@@ -395,4 +395,3 @@ the avoidance of doubt, this paragraph does not form part of the
395395
public licenses.
396396

397397
Creative Commons may be contacted at creativecommons.org.
398-

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenFF Force Fields
22

3-
[![Build Status](https://github.com/openforcefield/openff-forcefields/workflows/CI/badge.svg)](https://github.com/openforcefield/openff-forcefields/actions?query=branch%3Amaster+workflow%3ACI)
3+
[![Build Status](https://github.com/openforcefield/openff-forcefields/workflows/CI/badge.svg)](https://github.com/openforcefield/openff-forcefields/actions?query=branch%3Amaster+workflow%3ACI)
44

55

66
This repository contains force fields released by the [Open Force Field Initiative](https://openforcefield.org).
@@ -151,15 +151,15 @@ Force fields moving forward will be called `name-X.Y.Z`
151151

152152
- `v2.0.0 Sage`: This major release contains the same physical parameters as `v2.0.0-rc.2 Sage`, but has the parameter ids changed. For more information see the [openff-sage repository](https://github.com/openforcefield/openff-sage).
153153

154-
- `2023.02.1`: This release switches to a calendar-versioning system and adds `tip3p-1.0.0.offxml` and `tip3p-fb-1.0.0.offxml`, as well as `tip3p.offxml` and `tip3p-fb.offxml`, which will always point to the latest files in their respective lines.
154+
- `2023.02.1`: This release switches to a calendar-versioning system and adds `tip3p-1.0.0.offxml` and `tip3p-fb-1.0.0.offxml`, as well as `tip3p.offxml` and `tip3p-fb.offxml`, which will always point to the latest files in their respective lines.
155155

156156
- `2023.04.1`: This release adds `openff-2.1.0-rc.1.offxml` Sage 2.1.0 Release Candidate 1, with several small parameter fixes and improvements.
157157

158158
- `2023.05.0`: This release adds the `opc-1.0.0.offxml`, our initial port of the OPC water model.
159159

160160
- `2023.05.1`: This release adds `openff-2.1.0.offxml`, Sage 2.1.0, with identical physics parameters to `openff-2.1.0-rc.1.offxml`.
161161

162-
- `2023.06.0`: This release adds `opc-1.0.1.offxml`, standardizing the use of the string "kilocalorie_per_mole". It also adds `tip3p-fb-1.1.0.offxml`, which fixes a unit error in the geometric constraints and adds additional ion parameters. Finally, it adds `opc3-1.0.0.offxml` and `tip4p_fb-1.0.0.offxml`.
162+
- `2023.06.0`: This release adds `opc-1.0.1.offxml`, standardizing the use of the string "kilocalorie_per_mole". It also adds `tip3p-fb-1.1.0.offxml`, which fixes a unit error in the geometric constraints and adds additional ion parameters. Finally, it adds `opc3-1.0.0.offxml` and `tip4p_fb-1.0.0.offxml`.
163163

164164
#### Acknowledgements
165165

canary/scripts/test_hmr.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1+
import importlib.resources
12
import sys
2-
from pathlib import Path
33

44
import numpy as np
55
from openff.toolkit.topology import Molecule
66
from openmmforcefields.generators import SystemGenerator
77
from simtk import openmm, unit
88
from simtk.openmm import app
9-
import importlib.resources
10-
119

1210
DATA_PATH = importlib.resources.files("openforcefields") / "canary" / "data"
1311
coverage_mols = DATA_PATH / "coverage.smi"
@@ -22,7 +20,7 @@ class CanaryError(Exception):
2220
"""Base exception for canary"""
2321

2422
def __init__(self, message, runs):
25-
super(CanaryError, self).__init__(message)
23+
super().__init__(message)
2624
self.message = message
2725
self.runs = runs
2826

@@ -36,7 +34,8 @@ class HMRCanaryError(CanaryError):
3634

3735
def hmr_driver(mol, ff_name):
3836
"""Given an OpenFF Molecule, run a short 4 fs HMR simulation. This function is adapted from
39-
https://github.com/openforcefield/openforcefields/issues/19#issuecomment-689816995"""
37+
https://github.com/openforcefield/openforcefields/issues/19#issuecomment-689816995
38+
"""
4039
print(
4140
f"Running HMR with force field {ff_name} and molecule with SMILES {mol.to_smiles()}"
4241
)
@@ -45,8 +44,7 @@ def hmr_driver(mol, ff_name):
4544
"constraints": app.HBonds,
4645
"rigidWater": True,
4746
"removeCMMotion": False,
48-
"hydrogenMass": 4
49-
* unit.amu, # Does this also _subtract_ mass from heavy atoms?:w
47+
"hydrogenMass": 4 * unit.amu,
5048
}
5149

5250
system_generator = SystemGenerator(

codecov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ comment:
1212
branches: null
1313
behavior: default
1414
flags: null
15-
paths: null
15+
paths: null

devtools/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Development, testing, and deployment tools
22

3-
This directory contains a collection of tools for running Continuous Integration (CI) tests,
3+
This directory contains a collection of tools for running Continuous Integration (CI) tests,
44
conda installation, and other development tools not directly related to the coding process.
55

66

@@ -17,7 +17,7 @@ This directory contains the files to setup the Conda environment for testing pur
1717

1818
* `conda-envs`: directory containing the YAML file(s) which fully describe Conda Environments, their dependencies, and those dependency provenance's
1919
* `test_env.yaml`: Simple test environment file with base dependencies. Channels are not specified here and therefore respect global Conda configuration
20-
20+
2121
### Additional Scripts:
2222

2323
This directory contains OS agnostic helper scripts which don't fall in any of the previous categories
@@ -40,17 +40,17 @@ This directory contains OS agnostic helper scripts which don't fall in any of th
4040
- [ ] Make sure there is an/are issue(s) opened for your specific update
4141
- [ ] Create the PR, referencing the issue
4242
- [ ] Debug the PR as needed until tests pass
43-
- [ ] Tag the final, debugged version
43+
- [ ] Tag the final, debugged version
4444
* `git tag -a X.Y.Z [latest pushed commit] && git push --follow-tags`
4545
- [ ] Get the PR merged in
4646

4747
## Versioneer Auto-version
48-
[Versioneer](https://github.com/warner/python-versioneer) will automatically infer what version
49-
is installed by looking at the `git` tags and how many commits ahead this version is. The format follows
48+
[Versioneer](https://github.com/warner/python-versioneer) will automatically infer what version
49+
is installed by looking at the `git` tags and how many commits ahead this version is. The format follows
5050
[PEP 440](https://www.python.org/dev/peps/pep-0440/) and has the regular expression of:
5151
```regexp
5252
\d+.\d+.\d+(?\+\d+-[a-z0-9]+)
5353
```
54-
If the version of this commit is the same as a `git` tag, the installed version is the same as the tag,
55-
e.g. `openforcefield-forcefields-0.1.2`, otherwise it will be appended with `+X` where `X` is the number of commits
54+
If the version of this commit is the same as a `git` tag, the installed version is the same as the tag,
55+
e.g. `openforcefield-forcefields-0.1.2`, otherwise it will be appended with `+X` where `X` is the number of commits
5656
ahead from the last tag, and then `-YYYYYY` where the `Y`'s are replaced with the `git` commit hash.

devtools/scripts/create_conda_env.py

Lines changed: 0 additions & 95 deletions
This file was deleted.

docs/water-models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The OPC, OPC3, TIP3P-FB, and TIP4P-FB files includes the 12-6 hydration free ene
1818
These files are not original force fields made by Open Force Field.
1919
Instead they are ports of existing force fields into the [SMIRNOFF](https://openforcefield.github.io/standards/standards/smirnoff/) force field format.
2020

21-
**Note**: Current mainline SMIRNOFF force fields already contain a water model and ion parameters. If you intend to use a mainline OpenFF force field for most molecules in a topology while using an alternate force field specifically for water and ions, ensure that the water-and-ions force field is loaded _last_, so that its parameters take precedence over those from the main-line force field.
21+
**Note**: Current mainline SMIRNOFF force fields already contain a water model and ion parameters. If you intend to use a mainline OpenFF force field for most molecules in a topology while using an alternate force field specifically for water and ions, ensure that the water-and-ions force field is loaded _last_, so that its parameters take precedence over those from the main-line force field.
2222

2323
## Versioning
2424

@@ -30,7 +30,7 @@ To eliminate this possibility, use a versioned file name, i.e. `ForceField("tip3
3030

3131
The first version of each file is given version number 1.0.0 and is associated with a best-effort attempt at reproducing the parameters from the original source.
3232
These parameters may not precisely match what is packaged elsewhere, such as those bundled alongside of MD engines. Such files often do not agree with each other to the last significant digit.
33-
The SMIRNOFF format also requires definitions of some terms that affect the total energy of a system, but are either not relevant or not clearly defined for these water models, such as 1-4 scaling factors and nonbonded cutoffs. We make an effort here to choose values for these settings to ensure compatibility with the most recent mainline OpenFF force field, but when using other force fields users may need to update these values manually to ensure compatibility.
33+
The SMIRNOFF format also requires definitions of some terms that affect the total energy of a system, but are either not relevant or not clearly defined for these water models, such as 1-4 scaling factors and nonbonded cutoffs. We make an effort here to choose values for these settings to ensure compatibility with the most recent mainline OpenFF force field, but when using other force fields users may need to update these values manually to ensure compatibility.
3434

3535

3636
If errors in these files are discovered, changes may be made and released in new versions of these files, i.e. `tip3p_1.0.1.offxml`.

0 commit comments

Comments
 (0)