From 24c2b8dfd6bf2c27e6e0a11b38284ed5867c8b8c Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Tue, 16 Dec 2025 14:06:10 -0800 Subject: [PATCH 1/9] drop abc inheritance from ComponentMapping --- gufe/mapping/componentmapping.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gufe/mapping/componentmapping.py b/gufe/mapping/componentmapping.py index 8c665a0a6..bea4378d9 100644 --- a/gufe/mapping/componentmapping.py +++ b/gufe/mapping/componentmapping.py @@ -1,12 +1,11 @@ # This code is part of gufe and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe -import abc import gufe from gufe.tokenization import GufeTokenizable -class ComponentMapping(GufeTokenizable, abc.ABC): +class ComponentMapping(GufeTokenizable): """A relationship between two Components stating that they transform in some way For components that are atom-based is specialised to :class:`.AtomMapping` From 8656dfd351660644341c98905a9f1146d1485f7e Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 13:31:29 -0800 Subject: [PATCH 2/9] remove unused imports in tests --- gufe/tests/conftest.py | 1 - gufe/tests/storage/test_externalresource.py | 7 +------ gufe/tests/test_alchemicalnetwork.py | 3 +-- gufe/tests/test_chemicalsystem.py | 2 -- gufe/tests/test_ligand_network.py | 1 - gufe/tests/test_models.py | 1 - gufe/tests/test_proteincomponent.py | 1 - gufe/tests/test_protocol.py | 2 +- gufe/tests/test_serialization_json.py | 1 - gufe/tests/test_serialization_migration.py | 2 +- gufe/tests/test_smallmoleculecomponent.py | 4 ---- gufe/tests/test_tokenization.py | 3 --- gufe/tests/test_utils.py | 1 - 13 files changed, 4 insertions(+), 25 deletions(-) diff --git a/gufe/tests/conftest.py b/gufe/tests/conftest.py index 4cbe675f6..4711bd2c8 100644 --- a/gufe/tests/conftest.py +++ b/gufe/tests/conftest.py @@ -1,7 +1,6 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe -import importlib.resources import pooch import pytest diff --git a/gufe/tests/storage/test_externalresource.py b/gufe/tests/storage/test_externalresource.py index eb8167bd7..778aeaa0f 100644 --- a/gufe/tests/storage/test_externalresource.py +++ b/gufe/tests/storage/test_externalresource.py @@ -1,11 +1,6 @@ -import hashlib -import os -import pathlib -from unittest import mock - import pytest -from gufe.storage.errors import ChangedExternalResourceError, MissingExternalResourceError +from gufe.storage.errors import MissingExternalResourceError from gufe.storage.externalresource import FileStorage, MemoryStorage # NOTE: Tests for the abstract base are just part of the tests of its diff --git a/gufe/tests/test_alchemicalnetwork.py b/gufe/tests/test_alchemicalnetwork.py index 2f1b46101..f06cc2b64 100644 --- a/gufe/tests/test_alchemicalnetwork.py +++ b/gufe/tests/test_alchemicalnetwork.py @@ -4,9 +4,8 @@ import networkx as nx import pytest -from gufe import AlchemicalNetwork, ChemicalSystem, Transformation +from gufe import AlchemicalNetwork -from .test_protocol import DummyProtocol, DummyProtocolResult from .test_tokenization import GufeTokenizableTestsMixin diff --git a/gufe/tests/test_chemicalsystem.py b/gufe/tests/test_chemicalsystem.py index 160360b87..23b56bafa 100644 --- a/gufe/tests/test_chemicalsystem.py +++ b/gufe/tests/test_chemicalsystem.py @@ -1,13 +1,11 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe -import numpy as np import pytest from gufe import ChemicalSystem, Component, SmallMoleculeComponent, SolventComponent from gufe.components import ProteinComponent -from ..components.explicitmoleculecomponent import ExplicitMoleculeComponent from .test_tokenization import GufeTokenizableTestsMixin diff --git a/gufe/tests/test_ligand_network.py b/gufe/tests/test_ligand_network.py index 165c559f9..7faf9a1a4 100644 --- a/gufe/tests/test_ligand_network.py +++ b/gufe/tests/test_ligand_network.py @@ -1,6 +1,5 @@ # This code is part of gufe and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe -import importlib.resources from collections.abc import Iterable from typing import NamedTuple diff --git a/gufe/tests/test_models.py b/gufe/tests/test_models.py index c13d06dd5..2412b466f 100644 --- a/gufe/tests/test_models.py +++ b/gufe/tests/test_models.py @@ -5,7 +5,6 @@ """ import json -from typing import Iterable import numpy as np import pytest diff --git a/gufe/tests/test_proteincomponent.py b/gufe/tests/test_proteincomponent.py index d8e262cc0..a2b994dc5 100644 --- a/gufe/tests/test_proteincomponent.py +++ b/gufe/tests/test_proteincomponent.py @@ -1,6 +1,5 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe -import copy import io import os from unittest import mock diff --git a/gufe/tests/test_protocol.py b/gufe/tests/test_protocol.py index 4de6241c3..8e491f8ab 100644 --- a/gufe/tests/test_protocol.py +++ b/gufe/tests/test_protocol.py @@ -5,7 +5,7 @@ import pathlib from collections import defaultdict from collections.abc import Iterable, Sized -from typing import Any, Dict, List, Optional, Union +from typing import Any import networkx as nx import numpy as np diff --git a/gufe/tests/test_serialization_json.py b/gufe/tests/test_serialization_json.py index 45d680e66..8afbb3b64 100644 --- a/gufe/tests/test_serialization_json.py +++ b/gufe/tests/test_serialization_json.py @@ -10,7 +10,6 @@ from uuid import uuid4 import numpy as np -import openff.units import pytest from numpy import testing as npt from openff.units import unit diff --git a/gufe/tests/test_serialization_migration.py b/gufe/tests/test_serialization_migration.py index 0275e26a2..87850599d 100644 --- a/gufe/tests/test_serialization_migration.py +++ b/gufe/tests/test_serialization_migration.py @@ -1,5 +1,5 @@ import copy -from typing import Any, Optional, Type +from typing import Any import pytest from pydantic import BaseModel diff --git a/gufe/tests/test_smallmoleculecomponent.py b/gufe/tests/test_smallmoleculecomponent.py index ae6cf2f42..c8f9521d6 100644 --- a/gufe/tests/test_smallmoleculecomponent.py +++ b/gufe/tests/test_smallmoleculecomponent.py @@ -1,8 +1,6 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe -import importlib -import importlib.resources try: import openff.toolkit.topology @@ -13,14 +11,12 @@ HAS_OFFTK = True import json import logging -import os from unittest import mock import pytest from rdkit import Chem from rdkit.Chem import AllChem -import gufe from gufe import SmallMoleculeComponent from gufe.components.explicitmoleculecomponent import _ensure_ofe_name from gufe.tokenization import TOKENIZABLE_REGISTRY diff --git a/gufe/tests/test_tokenization.py b/gufe/tests/test_tokenization.py index a96c7f56d..1aeb3ad2d 100644 --- a/gufe/tests/test_tokenization.py +++ b/gufe/tests/test_tokenization.py @@ -3,7 +3,6 @@ import io import json import logging -from typing import Optional from unittest import mock import pytest @@ -11,7 +10,6 @@ from gufe.serialization.msgpack import packb, unpackb from gufe.tokenization import ( JSON_HANDLER, - TOKENIZABLE_CLASS_REGISTRY, TOKENIZABLE_REGISTRY, GufeKey, GufeTokenizable, @@ -21,7 +19,6 @@ gufe_objects_from_shallow_dict, gufe_to_digraph, import_qualname, - tokenize, ) diff --git a/gufe/tests/test_utils.py b/gufe/tests/test_utils.py index 1e2ec9625..b82472b7f 100644 --- a/gufe/tests/test_utils.py +++ b/gufe/tests/test_utils.py @@ -2,7 +2,6 @@ # For details, see https://github.com/OpenFreeEnergy/openfe import io -import pathlib import pytest From d13fcd007538041f60c72b8a4c6d9a9b1d645267 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 13:41:23 -0800 Subject: [PATCH 3/9] update pyproject.toml --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cf1471c5a..fb7ae503f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ line-length = 120 # Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. lint.select = [ - # "F", # Pyflakes + "F", # Pyflakes "I", # isort "W", # pycodestyle warnings # "E", # pycodestyle errors @@ -56,12 +56,13 @@ lint.ignore = [ "E402", # module-level import not at top (conflicts w/ isort) "E722", # bare excepts (TODO: we should fix these in a follow-up PR) "E731", # lambda expressions (TODO: we should fix these) - "F401", # unused imports (TODO: we should fix these) + "F403", + "F405", "UP03", # pyupgrade linting (TODO: we should fix these) ] # ignore "unused import" error for all __init__.py files -lint.per-file-ignores."__init__.py" = [ "E401" ] +lint.per-file-ignores."__init__.py" = [ "F401" ] lint.isort.known-first-party = [ "gufe" ] From 7dbcf1b2849f027100c1dcb96957f154aec08427 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 16:43:01 -0800 Subject: [PATCH 4/9] remove more unused imports --- gufe/chemicalsystem.py | 1 - gufe/network.py | 1 - gufe/tokenization.py | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gufe/chemicalsystem.py b/gufe/chemicalsystem.py index 041f433a2..82413c5db 100644 --- a/gufe/chemicalsystem.py +++ b/gufe/chemicalsystem.py @@ -2,7 +2,6 @@ # For details, see https://github.com/OpenFreeEnergy/gufe from collections import abc -from typing import Optional from .components import Component from .tokenization import GufeTokenizable diff --git a/gufe/network.py b/gufe/network.py index c5b1c68cb..852b60535 100644 --- a/gufe/network.py +++ b/gufe/network.py @@ -2,7 +2,6 @@ # For details, see https://github.com/OpenFreeEnergy/gufe from collections.abc import Generator, Iterable -from typing import Optional import networkx as nx from typing_extensions import Self # Self is included in typing as of python 3.11 diff --git a/gufe/tokenization.py b/gufe/tokenization.py index 5b8bef60e..c83bbd32c 100644 --- a/gufe/tokenization.py +++ b/gufe/tokenization.py @@ -16,7 +16,7 @@ from collections.abc import Generator from itertools import chain from os import PathLike -from typing import Any, BinaryIO, Callable, Dict, List, Optional, TextIO, Tuple, Union +from typing import Any, BinaryIO, Callable, TextIO import networkx as nx from typing_extensions import Self @@ -712,7 +712,7 @@ def from_json(cls, file: PathLike | TextIO | None = None, content: str | None = return cls.from_keyed_chain(keyed_chain=deserialized) except ValueError: # if the above fails, try to load as the dict representation - warnings.warn(f"keyed-chain deserialization failed; falling back to deserializing dict representation") + warnings.warn("keyed-chain deserialization failed; falling back to deserializing dict representation") return cls.from_dict(deserialized) from gufe.utils import ensure_filelike @@ -724,7 +724,7 @@ def from_json(cls, file: PathLike | TextIO | None = None, content: str | None = return cls.from_keyed_chain(keyed_chain=deserialized) except ValueError: # if the above fails, try to load as the dict representation - warnings.warn(f"keyed-chain deserialization failed; falling back to deserializing dict representation") + warnings.warn("keyed-chain deserialization failed; falling back to deserializing dict representation") return cls.from_dict(deserialized) def to_msgpack(self, file: PathLike | BinaryIO | None = None) -> None | bytes: From 4b5fc9aecf52b6e4d17a7f3408360d6b26e6dfde Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 17:08:26 -0800 Subject: [PATCH 5/9] remove more unused imports --- gufe/protocols/protocol.py | 2 +- gufe/protocols/protocoldag.py | 7 +------ gufe/protocols/protocolunit.py | 8 ++------ gufe/serialization/json.py | 2 +- gufe/storage/externalresource/base.py | 2 -- gufe/storage/externalresource/filestorage.py | 3 +-- gufe/storage/externalresource/memorystorage.py | 3 +-- gufe/tests/test_ligandatommapping.py | 2 +- gufe/tests/test_mapping_visualization.py | 2 +- gufe/tests/test_models.py | 2 +- gufe/transformations/transformation.py | 1 - gufe/vendor/openff/interchange/_annotations.py | 2 +- gufe/vendor/pdb_file/element.py | 1 - gufe/visualization/mapping_visualization.py | 2 +- pyproject.toml | 3 ++- 15 files changed, 14 insertions(+), 28 deletions(-) diff --git a/gufe/protocols/protocol.py b/gufe/protocols/protocol.py index 1ec6c6eb0..59a825fbd 100644 --- a/gufe/protocols/protocol.py +++ b/gufe/protocols/protocol.py @@ -6,7 +6,7 @@ import abc import warnings from collections.abc import Iterable, Sized -from typing import Any, Optional, Union +from typing import Any from openff.units import Quantity diff --git a/gufe/protocols/protocoldag.py b/gufe/protocols/protocoldag.py index 538b0abe2..43dd5e036 100644 --- a/gufe/protocols/protocoldag.py +++ b/gufe/protocols/protocoldag.py @@ -1,15 +1,10 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe -import abc -import os import shutil from collections import defaultdict -from collections.abc import Iterable -from copy import copy -from os import PathLike from pathlib import Path -from typing import Any, Optional, Union +from typing import Any import networkx as nx diff --git a/gufe/protocols/protocolunit.py b/gufe/protocols/protocolunit.py index 9f3b90c4f..c70d0ac38 100644 --- a/gufe/protocols/protocolunit.py +++ b/gufe/protocols/protocolunit.py @@ -10,18 +10,14 @@ import abc import datetime -import sys -import tempfile import traceback import uuid -from collections.abc import Iterable from copy import copy from dataclasses import dataclass -from os import PathLike from pathlib import Path -from typing import Any, Dict, List, Optional, Tuple, Union +from typing import Any -from ..tokenization import TOKENIZABLE_REGISTRY, GufeKey, GufeTokenizable +from ..tokenization import GufeKey, GufeTokenizable from .errors import ExecutionInterrupt diff --git a/gufe/serialization/json.py b/gufe/serialization/json.py index e00b9c481..7defbcc4b 100644 --- a/gufe/serialization/json.py +++ b/gufe/serialization/json.py @@ -11,7 +11,7 @@ import json import pathlib from collections.abc import Callable, Iterable -from typing import Any, Dict, List, Optional, Tuple, Type, Union +from typing import Any from uuid import UUID import numpy as np diff --git a/gufe/storage/externalresource/base.py b/gufe/storage/externalresource/base.py index 0215b14ad..5e24de9e6 100644 --- a/gufe/storage/externalresource/base.py +++ b/gufe/storage/externalresource/base.py @@ -6,8 +6,6 @@ import pathlib from typing import ContextManager, Iterator -from ..errors import MissingExternalResourceError - @dataclasses.dataclass class Metadata: diff --git a/gufe/storage/externalresource/filestorage.py b/gufe/storage/externalresource/filestorage.py index 47d296ff6..aa3377d5d 100644 --- a/gufe/storage/externalresource/filestorage.py +++ b/gufe/storage/externalresource/filestorage.py @@ -3,9 +3,8 @@ import os import pathlib import shutil -from typing import ContextManager, Tuple, Union -from ..errors import ChangedExternalResourceError, MissingExternalResourceError +from ..errors import MissingExternalResourceError from .base import ExternalStorage diff --git a/gufe/storage/externalresource/memorystorage.py b/gufe/storage/externalresource/memorystorage.py index e8ee07d39..f959d6959 100644 --- a/gufe/storage/externalresource/memorystorage.py +++ b/gufe/storage/externalresource/memorystorage.py @@ -1,9 +1,8 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe import io -from typing import ContextManager, Tuple, Union -from ..errors import ChangedExternalResourceError, MissingExternalResourceError +from ..errors import MissingExternalResourceError from .base import ExternalStorage diff --git a/gufe/tests/test_ligandatommapping.py b/gufe/tests/test_ligandatommapping.py index a1a7bc70f..fa5773548 100644 --- a/gufe/tests/test_ligandatommapping.py +++ b/gufe/tests/test_ligandatommapping.py @@ -15,7 +15,7 @@ from .test_tokenization import GufeTokenizableTestsMixin try: - import py3Dmol + import py3Dmol # noqa: F401 HAS_PY3DMOL = True except ImportError: diff --git a/gufe/tests/test_mapping_visualization.py b/gufe/tests/test_mapping_visualization.py index aae084387..a922a9b9f 100644 --- a/gufe/tests/test_mapping_visualization.py +++ b/gufe/tests/test_mapping_visualization.py @@ -13,7 +13,7 @@ ) try: - import py3Dmol + import py3Dmol # noqa: F401 HAS_PY3DMOL = True except ImportError: diff --git a/gufe/tests/test_models.py b/gufe/tests/test_models.py index 2412b466f..89716ad21 100644 --- a/gufe/tests/test_models.py +++ b/gufe/tests/test_models.py @@ -12,7 +12,7 @@ from gufe.settings import SettingsBaseModel from gufe.settings.models import OpenMMSystemGeneratorFFSettings, Settings, ThermoSettings -from gufe.settings.typing import BoxQuantity, GufeQuantity, NanometerArrayQuantity, NanometerQuantity +from gufe.settings.typing import BoxQuantity, NanometerArrayQuantity def test_settings_schema(): diff --git a/gufe/transformations/transformation.py b/gufe/transformations/transformation.py index 7b9a025f0..f1fe8d289 100644 --- a/gufe/transformations/transformation.py +++ b/gufe/transformations/transformation.py @@ -5,7 +5,6 @@ import json import warnings from collections.abc import Iterable -from typing import Optional, Union from ..chemicalsystem import ChemicalSystem from ..mapping import ComponentMapping diff --git a/gufe/vendor/openff/interchange/_annotations.py b/gufe/vendor/openff/interchange/_annotations.py index e6c9fc919..a9fd3f659 100644 --- a/gufe/vendor/openff/interchange/_annotations.py +++ b/gufe/vendor/openff/interchange/_annotations.py @@ -1,7 +1,7 @@ # Vendored from https://github.com/openforcefield/openff-interchange/blob/main/openff/interchange/_annotations.py import functools from collections.abc import Callable -from typing import Annotated, Any +from typing import Annotated import numpy from annotated_types import Gt diff --git a/gufe/vendor/pdb_file/element.py b/gufe/vendor/pdb_file/element.py index 3b675233c..ab4d7a350 100644 --- a/gufe/vendor/pdb_file/element.py +++ b/gufe/vendor/pdb_file/element.py @@ -33,7 +33,6 @@ __version__ = "1.0" import copyreg -import sys from collections import OrderedDict from openmm.unit import daltons, is_quantity diff --git a/gufe/visualization/mapping_visualization.py b/gufe/visualization/mapping_visualization.py index f02a97800..065182765 100644 --- a/gufe/visualization/mapping_visualization.py +++ b/gufe/visualization/mapping_visualization.py @@ -13,7 +13,7 @@ from ..utils import requires_package if TYPE_CHECKING: - import py3Dmol + pass # highlight core element changes differently from unique atoms # RGBA color value needs to be between 0 and 1, so divide by 255 diff --git a/pyproject.toml b/pyproject.toml index fb7ae503f..ce9917d79 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -57,7 +57,8 @@ lint.ignore = [ "E722", # bare excepts (TODO: we should fix these in a follow-up PR) "E731", # lambda expressions (TODO: we should fix these) "F403", - "F405", + # "F405", + "F841", # vars assigned but not sued (TODO: fix these) "UP03", # pyupgrade linting (TODO: we should fix these) ] From df9ade06f7480d3f0fca11dd13bfb2fb24d1cc3c Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 17:10:26 -0800 Subject: [PATCH 6/9] add comments --- gufe/components/smallmoleculecomponent.py | 2 +- gufe/tests/test_protocol.py | 2 +- pyproject.toml | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gufe/components/smallmoleculecomponent.py b/gufe/components/smallmoleculecomponent.py index ab0c05638..f30e49070 100644 --- a/gufe/components/smallmoleculecomponent.py +++ b/gufe/components/smallmoleculecomponent.py @@ -195,7 +195,7 @@ def _from_sdf_supplier(cls, supp): pass else: # TODO: less generic exception type here - raise RuntimeError(f"SDF contains more than 1 molecule") + raise RuntimeError("SDF contains more than 1 molecule") return cls(rdkit=mol) # name is obtained automatically diff --git a/gufe/tests/test_protocol.py b/gufe/tests/test_protocol.py index 8e491f8ab..7c1044221 100644 --- a/gufe/tests/test_protocol.py +++ b/gufe/tests/test_protocol.py @@ -580,7 +580,7 @@ def instance(self, vacuum_ligand, solvated_ligand): some_dict={"a": 2, "b": 12}, ) - return SimulationUnit(name=f"simulation", initialization=alpha) + return SimulationUnit(name="simulation", initialization=alpha) def test_key_stable(self, instance): # for the DAG system, keys for `ProtocolUnit`s are based on UUIDs, diff --git a/pyproject.toml b/pyproject.toml index ce9917d79..cf7db4db9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ lint.select = [ "F", # Pyflakes "I", # isort "W", # pycodestyle warnings - # "E", # pycodestyle errors + # "E", # pycodestyle errors # "C901" # mccabe complexity TODO: add this back in # "UP", # TODO: add this in ] @@ -56,9 +56,9 @@ lint.ignore = [ "E402", # module-level import not at top (conflicts w/ isort) "E722", # bare excepts (TODO: we should fix these in a follow-up PR) "E731", # lambda expressions (TODO: we should fix these) - "F403", - # "F405", - "F841", # vars assigned but not sued (TODO: fix these) + "F403", # undefined name (TODO: fix these) + "F405", # undefined imports (TODO: fix these) + "F841", # vars assigned but not used (TODO: fix these) "UP03", # pyupgrade linting (TODO: we should fix these) ] From f42c5a199bf56a2b34d138188184f4f183781ca0 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 17:10:31 -0800 Subject: [PATCH 7/9] Revert "drop abc inheritance from ComponentMapping" This reverts commit 24c2b8dfd6bf2c27e6e0a11b38284ed5867c8b8c. --- gufe/mapping/componentmapping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gufe/mapping/componentmapping.py b/gufe/mapping/componentmapping.py index bea4378d9..8c665a0a6 100644 --- a/gufe/mapping/componentmapping.py +++ b/gufe/mapping/componentmapping.py @@ -1,11 +1,12 @@ # This code is part of gufe and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe +import abc import gufe from gufe.tokenization import GufeTokenizable -class ComponentMapping(GufeTokenizable): +class ComponentMapping(GufeTokenizable, abc.ABC): """A relationship between two Components stating that they transform in some way For components that are atom-based is specialised to :class:`.AtomMapping` From f2b0a083041232bafae245592cc999678923f4e1 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 17:27:35 -0800 Subject: [PATCH 8/9] fixing a few imports --- gufe/tests/conftest.py | 2 ++ gufe/tests/test_ligand_network.py | 1 + gufe/tests/test_serialization_json.py | 1 + 3 files changed, 4 insertions(+) diff --git a/gufe/tests/conftest.py b/gufe/tests/conftest.py index 4711bd2c8..1ff724f68 100644 --- a/gufe/tests/conftest.py +++ b/gufe/tests/conftest.py @@ -2,6 +2,8 @@ # For details, see https://github.com/OpenFreeEnergy/gufe +import importlib + import pooch import pytest from openff.units import unit diff --git a/gufe/tests/test_ligand_network.py b/gufe/tests/test_ligand_network.py index 7faf9a1a4..ff5a597a8 100644 --- a/gufe/tests/test_ligand_network.py +++ b/gufe/tests/test_ligand_network.py @@ -1,5 +1,6 @@ # This code is part of gufe and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/gufe +import importlib from collections.abc import Iterable from typing import NamedTuple diff --git a/gufe/tests/test_serialization_json.py b/gufe/tests/test_serialization_json.py index 8afbb3b64..3ccc7812f 100644 --- a/gufe/tests/test_serialization_json.py +++ b/gufe/tests/test_serialization_json.py @@ -10,6 +10,7 @@ from uuid import uuid4 import numpy as np +import openff import pytest from numpy import testing as npt from openff.units import unit From e5313cc1083bee567b1650366f991b5d7dee1c77 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 18 Dec 2025 17:38:00 -0800 Subject: [PATCH 9/9] add ignores to vendored code --- gufe/vendor/pdb_file/PdbxContainers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gufe/vendor/pdb_file/PdbxContainers.py b/gufe/vendor/pdb_file/PdbxContainers.py index e8bcd94d1..a94a0fec3 100644 --- a/gufe/vendor/pdb_file/PdbxContainers.py +++ b/gufe/vendor/pdb_file/PdbxContainers.py @@ -492,7 +492,7 @@ def setValue(self, value, attributeName=None, rowIndex=None): # extend the list if needed - if ind >= ll: - self._rowList[rowI].extend([None for ii in xrange(2 * ind - ll)]) + self._rowList[rowI].extend([None for ii in xrange(2 * ind - ll)]) # noqa: F821, but note that xrange is deprecated self._rowList[rowI][ind] = value except IndexError: self.__lfh.write( @@ -543,14 +543,14 @@ def invokeAttributeMethod(self, attributeName, type, method, db): # ind = self._attributeNameList.index(attributeName) if len(self._rowList) == 0: - row = [None for ii in xrange(len(self._attributeNameList) * 2)] + row = [None for ii in xrange(len(self._attributeNameList) * 2)] # noqa: F821, but note that xrange is deprecated row[ind] = None self._rowList.append(row) for row in self._rowList: ll = len(row) if ind >= ll: - row.extend([None for ii in xrange(2 * ind - ll)]) + row.extend([None for ii in xrange(2 * ind - ll)]) # noqa: F821, but note that xrange is deprecated row[ind] = None exec(method.getInline()) self.__currentRowIndex += 1