Skip to content

Commit

Permalink
mypy fixes around AlchemicalNetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjgowers committed Feb 12, 2024
1 parent f1dbc6f commit 6475936
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions gufe/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@


class AlchemicalNetwork(GufeTokenizable):
_edges: frozenset[Transformation]
_nodes: frozenset[ChemicalSystem]
_name: Optional[str]
_graph: Optional[nx.MultiDiGraph] # lazily created and cached

"""A network with all the information needed for a simulation campaign.
Nodes are :class:`.ChemicalSystem` instances and edges are
Expand All @@ -30,9 +35,7 @@ def __init__(
nodes: Optional[Iterable[ChemicalSystem]] = None,
name: Optional[str] = None,
):
self._edges: frozenset[Transformation] = frozenset(edges) if edges else frozenset()
self._nodes: frozenset[ChemicalSystem]

self._edges = frozenset(edges) if edges else frozenset()
self._name = name

# possible to get more nodes via edges above,
Expand All @@ -51,7 +54,7 @@ def __init__(
self._graph = None

@staticmethod
def _generate_graph(edges, nodes):
def _generate_graph(edges, nodes) -> nx.MultiDiGraph:
g = nx.MultiDiGraph()

for transformation in edges:
Expand Down

0 comments on commit 6475936

Please sign in to comment.