Skip to content

Commit

Permalink
Merge pull request #128 from pebenito/nx-optional-fix
Browse files Browse the repository at this point in the history
infoflow/dta: Correct typing for NetworkX.
  • Loading branch information
pebenito authored Apr 24, 2024
2 parents b15f2f2 + 0a1849b commit f0acf98
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 f0acf98

Please sign in to comment.