Skip to content

Commit

Permalink
rename variables to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ankeko committed Nov 8, 2023
1 parent fdc969b commit cc3d1d6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions niceml/mkdocs/mdgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ def get_graph_md(job: JobDefinition) -> str:
"""Creates a graph as str with material for mkdocs"""
deps = job.graph.dependencies
graph_str = ""
for key, value in deps.items():
for _, val2 in value.items():
if isinstance(val2, DependencyDefinition):
graph_str += f" {val2.node} --> {key.name};\n"
elif isinstance(val2, MultiDependencyDefinition):
for dependency in val2.dependencies:
graph_str += f" {dependency.node} --> {key.name};\n"
for node, node_dependencies in deps.items():
for _, dependencies in node_dependencies.items():
if isinstance(dependencies, DependencyDefinition):
graph_str += f" {dependencies.node} --> {node.name};\n"
elif isinstance(dependencies, MultiDependencyDefinition):
for dependency in dependencies.dependencies:
graph_str += f" {dependency.node} --> {node.name};\n"
else:
raise AttributeError("'val2' is not of expected type.")
raise AttributeError("'dependencies' is not of expected type.")
if len(graph_str) == 0:
return ""

Expand Down

0 comments on commit cc3d1d6

Please sign in to comment.