Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Feb 28, 2024
1 parent df605d9 commit 84ee68c
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/beta_rc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ jobs:
pytest -r fE --tb=short openff/toolkit/_tests/test_links.py
- name: Run mypy
run: |
mypy --namespace-packages -p "openff.toolkit"
run: mypy -p "openff.toolkit"

- name: Run unit tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
files: ^openff|(^examples/((?!deprecated).)*$)|^docs
repos:
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black
- id: black-jupyter
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies:
- nbval
# No idea why this is necessary, see https://github.com/openforcefield/openff-toolkit/pull/1821
- nomkl
- mypy
- mypy =1.8
- typing_extensions
- pydantic =1
- pip:
Expand Down
9 changes: 5 additions & 4 deletions openff/toolkit/topology/_mm_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ def from_dict(cls, molecule_dict):
hier_scheme_dicts = molecule_dict.pop("hierarchy_schemes")
for iterator_name, hierarchy_scheme_dict in hier_scheme_dicts.items():
molecule._hierarchy_schemes[iterator_name] = HierarchyScheme(
parent=molecule,
parent=molecule, # type: ignore[arg-type]
uniqueness_criteria=tuple(hierarchy_scheme_dict["uniqueness_criteria"]),
iterator_name=iterator_name,
)
Expand All @@ -394,7 +394,8 @@ def from_dict(cls, molecule_dict):
atom_indices=element_dict["atom_indices"],
)

{setattr(molecule, key, val) for key, val in molecule_dict.items()}
for key, val in molecule_dict.items():
setattr(molecule, key, val)

return molecule

Expand All @@ -418,7 +419,7 @@ def from_molecule(cls, molecule: Molecule):

for name, hierarchy_scheme in molecule.hierarchy_schemes.items():
assert name == hierarchy_scheme.iterator_name
mm_molecule.add_hierarchy_scheme( # type: ignore[operator]
mm_molecule.add_hierarchy_scheme(
uniqueness_criteria=hierarchy_scheme.uniqueness_criteria,
iterator_name=hierarchy_scheme.iterator_name,
)
Expand Down Expand Up @@ -535,7 +536,7 @@ def __deepcopy__(self, memo):
return self.__class__.from_dict(self.to_dict())


_SimpleMolecule.add_hierarchy_scheme = Molecule.add_hierarchy_scheme # type: ignore[attr-defined]
_SimpleMolecule.add_hierarchy_scheme = Molecule.add_hierarchy_scheme # type: ignore[assignment]
_SimpleMolecule.update_hierarchy_schemes = Molecule.update_hierarchy_schemes # type: ignore[attr-defined]


Expand Down
2 changes: 1 addition & 1 deletion openff/toolkit/topology/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -4277,7 +4277,7 @@ def enumerate_protomers(self, max_states: int = 0) -> list:
"""

return OpenEyeToolkitWrapper().enumerate_protomers(
molecule=self, # type: ignore[arg-type]
molecule=self,
max_states=max_states,
)

Expand Down
2 changes: 1 addition & 1 deletion openff/toolkit/topology/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ def chemical_environment_matches(
# Find all atomsets that match this definition in the reference molecule
# This will automatically attempt to match chemically identical atoms in
# a canonical order within the Topology
mol_matches = unique_mol.chemical_environment_matches( # type: ignore[union-attr]
mol_matches = unique_mol.chemical_environment_matches( # type: ignore[operator]
smarts,
unique=unique,
toolkit_registry=toolkit_registry,
Expand Down
2 changes: 1 addition & 1 deletion openff/toolkit/typing/engines/smirnoff/forcefield.py
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ def label_molecules(self, topology: "Topology") -> list[dict[str, "ValenceDict"]
if type(parameter_handler) is VirtualSiteHandler:
param_is_list = True

matches = parameter_handler.find_matches(molecule.to_topology()) # type: ignore[union-attr]
matches = parameter_handler.find_matches(molecule.to_topology())

# Remove the chemical environment matches from the
# matched results.
Expand Down
2 changes: 1 addition & 1 deletion openff/toolkit/utils/openeye_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ def enumerate_protomers(
options.SetMaxCount(max_states)

return [
self.from_openeye(
self.from_openeye( # type: ignore[misc]
protomer,
allow_undefined_stereo=True,
_cls=molecule.__class__,
Expand Down

0 comments on commit 84ee68c

Please sign in to comment.