Skip to content

Commit

Permalink
infoflow/dta: Correct typing for NetworkX.
Browse files Browse the repository at this point in the history
Quote the annotations so NetworkX is optional again.

Signed-off-by: Chris PeBenito <[email protected]>
  • Loading branch information
pebenito committed Apr 22, 2024
1 parent 0f7a123 commit 0a1849b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions setools/dta.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def results(self) -> Iterable[DTAPath] | Iterable[DomainTransition]:
case _:
raise ValueError(f"Unknown analysis mode: {self.mode}")

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

"""
Return the results of the analysis as a NetworkX directed graph.
Expand Down Expand Up @@ -697,7 +697,7 @@ class Edge(mixins.NetworkXGraphEdge):
The default is False.
"""

G: nx.DiGraph
G: "nx.DiGraph"
source: policyrep.Type
target: policyrep.Type
create: InitVar[bool] = False
Expand Down
4 changes: 2 additions & 2 deletions setools/infoflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def results(self) -> Iterable[InfoFlowPath] | Iterable["InfoFlowStep"]:
case _:
raise ValueError(f"Unknown analysis mode: {self.mode}")

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

"""
Return the results of the analysis as a NetworkX directed graph.
Expand Down Expand Up @@ -432,7 +432,7 @@ class InfoFlowStep(mixins.NetworkXGraphEdge):
The default is False.
"""

G: nx.DiGraph
G: "nx.DiGraph"
source: policyrep.Type
target: policyrep.Type
create: InitVar[bool] = False
Expand Down

0 comments on commit 0a1849b

Please sign in to comment.