Skip to content

Commit f0acf98

Browse files
authored
Merge pull request #128 from pebenito/nx-optional-fix
infoflow/dta: Correct typing for NetworkX.
2 parents b15f2f2 + 0a1849b commit f0acf98

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

setools/dta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def results(self) -> Iterable[DTAPath] | Iterable[DomainTransition]:
278278
case _:
279279
raise ValueError(f"Unknown analysis mode: {self.mode}")
280280

281-
def graphical_results(self) -> nx.DiGraph:
281+
def graphical_results(self) -> "nx.DiGraph":
282282

283283
"""
284284
Return the results of the analysis as a NetworkX directed graph.
@@ -697,7 +697,7 @@ class Edge(mixins.NetworkXGraphEdge):
697697
The default is False.
698698
"""
699699

700-
G: nx.DiGraph
700+
G: "nx.DiGraph"
701701
source: policyrep.Type
702702
target: policyrep.Type
703703
create: InitVar[bool] = False

setools/infoflow.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def results(self) -> Iterable[InfoFlowPath] | Iterable["InfoFlowStep"]:
202202
case _:
203203
raise ValueError(f"Unknown analysis mode: {self.mode}")
204204

205-
def graphical_results(self) -> nx.DiGraph:
205+
def graphical_results(self) -> "nx.DiGraph":
206206

207207
"""
208208
Return the results of the analysis as a NetworkX directed graph.
@@ -432,7 +432,7 @@ class InfoFlowStep(mixins.NetworkXGraphEdge):
432432
The default is False.
433433
"""
434434

435-
G: nx.DiGraph
435+
G: "nx.DiGraph"
436436
source: policyrep.Type
437437
target: policyrep.Type
438438
create: InitVar[bool] = False

0 commit comments

Comments
 (0)