Skip to content

Commit

Permalink
Also replace isort
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwthompson committed Sep 10, 2024
1 parent 2398551 commit 64777e6
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
3 changes: 1 addition & 2 deletions devtools/scripts/build_cookiecutter_json.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sys
import json

import sys

release_tag = sys.argv[1]
python_version = sys.argv[2]
Expand Down
10 changes: 5 additions & 5 deletions docs/users/molecule_cookbook.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@
"except ImportError:\n",
" pass\n",
"\n",
"import warnings\n",
"import sys\n",
"import logging\n",
"import sys\n",
"import warnings\n",
"\n",
"from openeye import oechem\n",
"from rdkit import Chem\n",
"import mdtraj\n",
"import openmm.app\n",
"from openeye import oechem\n",
"from rdkit import Chem\n",
"\n",
"from openff.toolkit import Molecule, Topology\n",
"from openff.toolkit.utils import get_data_file_path\n",
"from openff.toolkit.utils.exceptions import UndefinedStereochemistryError\n",
"\n",
"\n",
"ipython = get_ipython()\n",
"\n",
"\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
"source": [
"# Retrieve protein and ligand files for BRD4 and a docked inhibitor from the benchmark systems GitHub repository\n",
"# https://github.com/MobleyLab/benchmarksets\n",
"import requests\n",
"import parmed\n",
"\n",
"import requests\n",
"from openmm import XmlSerializer, app, unit\n",
"from openmm.app import HBonds, NoCutoff, PDBFile\n",
"\n",
Expand Down
4 changes: 2 additions & 2 deletions openff/toolkit/_tests/test_molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,10 @@ def mini_drug_bank(xfail_mols=None, wip_mols=None):
Parameters
----------
xfail_mols : Dict[str, str or None]
xfail_mols : dict[str, str or None]
Dictionary mapping the molecule names that are allowed to
failed to the failure reason.
wip_mols : Dict[str, str or None]
wip_mols : dict[str, str or None]
Dictionary mapping the molecule names that are work in progress
to the failure reason.
Expand Down
2 changes: 1 addition & 1 deletion openff/toolkit/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
DEFAULT_CHARGE_MODEL,
DEFAULT_FRACTIONAL_BOND_ORDER_MODEL,
)
from openff.toolkit.utils.toolkit_registry import toolkit_registry_manager
from openff.toolkit.utils.toolkits import (
AMBERTOOLS_AVAILABLE,
BASIC_CHEMINFORMATICS_TOOLKITS,
Expand Down Expand Up @@ -53,4 +54,3 @@
temporary_cd,
unit_to_string,
)
from openff.toolkit.utils.toolkit_registry import toolkit_registry_manager
4 changes: 2 additions & 2 deletions openff/toolkit/utils/openeye_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import tempfile
from collections import defaultdict
from functools import wraps
from typing import TYPE_CHECKING, Any, Optional, Union, ClassVar
from typing import TYPE_CHECKING, Any, ClassVar, Optional, Union

import numpy as np
from cachetools import LRUCache, cached
Expand All @@ -22,7 +22,7 @@
from openff.toolkit import Quantity, unit

if TYPE_CHECKING:
from openff.toolkit.topology.molecule import FrozenMolecule, Molecule, Bond, Atom
from openff.toolkit.topology.molecule import Atom, Bond, FrozenMolecule, Molecule

from openff.units.elements import SYMBOLS

Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tool.ruff]
line-length = 119
exclude = ["examples/deprecated/", "utilities/deprecated"]

[tool.ruff.lint]
ignore = ["E721","D105","D107","D200","D203","D212", "RUF012"]
select = ["E", "F", "W", "NPY", "UP", "RUF"]
select = ["I", "E", "F", "W", "NPY", "UP", "RUF"]

[tool.ruff.lint.per-file-ignores]
"openff/toolkit/**/__init__.py" = ["F401"]
Expand All @@ -13,3 +14,10 @@ select = ["E", "F", "W", "NPY", "UP", "RUF"]
"openff/toolkit/_tests/_stale_tests.py" = ["F821"]
"docs/users/molecule_cookbook.ipynb" = ["F821"]
"examples/visualization/visualization.ipynb" = ["F821"]

[tool.ruff.lint.isort]
# can't find a clean way to get Rust's globset to handle this via regex ...
# https://docs.astral.sh/ruff/settings/#lint_isort_known-third-party
known-third-party = ["openff.interchange", "openff.utilities", "openff.units"]
known-first-party = ["openff.toolkit"]

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
openff-toolkit
A modern, extensible library for molecular mechanics force field science from the Open Force Field Consortium.
"""
from setuptools import setup, find_namespace_packages
from setuptools import find_namespace_packages, setup

import versioneer

short_description = __doc__.split("\n")
Expand Down
5 changes: 2 additions & 3 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,15 +310,14 @@

import configparser
import errno
import functools
import json
import os
import re
import subprocess
import sys
from pathlib import Path
from typing import Any, Callable, cast, Dict, List, Optional, Tuple, Union
from typing import NoReturn
import functools
from typing import Any, Callable, Dict, List, NoReturn, Optional, Tuple, Union, cast

have_tomllib = True
if sys.version_info >= (3, 11):
Expand Down

0 comments on commit 64777e6

Please sign in to comment.