The Open Forcefield Toolkit provides implementations of the SMIRNOFF format, parameterization engine, and other tools. Documentation available at http://open-forcefield-toolkit.readthedocs.io
While working on updating the state enumerators, I noticed a lot of molecule.py had some missing annotations, historic shims, or quirks that could be updated. The changes here are as follows:
Use built-in types were possible. Previously i.e. from typing import Dict was needed to support Python <3.9 (although from __future__ import annotations was another option). I didn't change all of them, but I was able to drop some of the typing imports changing the common types.
Add warn_unused_ignores = True into the mypy configuration. It does just what it describes - throws a warning (from the type checker only) when a # type: ignore is not needed. I like this option.
Add many missing annotations to molecule.py.
This started by trying to sneak some changes into those PRs, but I realized quickly that wasn't the place (common code across several different changesets) and it'd be better to just consolidate everything in one go.
While working on updating the state enumerators, I noticed a lot of
molecule.py
had some missing annotations, historic shims, or quirks that could be updated. The changes here are as follows:from typing import Dict
was needed to support Python <3.9 (althoughfrom __future__ import annotations
was another option). I didn't change all of them, but I was able to drop some of thetyping
imports changing the common types.warn_unused_ignores = True
into the mypy configuration. It does just what it describes - throws a warning (from the type checker only) when a# type: ignore
is not needed. I like this option.molecule.py
.This started by trying to sneak some changes into those PRs, but I realized quickly that wasn't the place (common code across several different changesets) and it'd be better to just consolidate everything in one go.