From e773c1afdec3f1b0daf8750b8bda9999961e3521 Mon Sep 17 00:00:00 2001 From: Alyssa Travitz Date: Thu, 14 Nov 2024 11:54:00 -0800 Subject: [PATCH] fixing typing import --- gufe/network.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/gufe/network.py b/gufe/network.py index 20f8f740..a98e52fe 100644 --- a/gufe/network.py +++ b/gufe/network.py @@ -3,17 +3,19 @@ from typing import Generator, Iterable, Optional +# Self typing is supported in python 3.11+ +try: + from typing import Self +except ImportError: + from typing_extensions import Self + import networkx as nx from .tokenization import GufeTokenizable from .chemicalsystem import ChemicalSystem from .transformations import Transformation -# Self typing is supported in python 3.11+ -try: - from typing import Self -except ImportError: - from __future__ import annotations + class AlchemicalNetwork(GufeTokenizable): _edges: frozenset[Transformation]