From cc3d1d6b8160551f604d3c5d87402fe492b90c85 Mon Sep 17 00:00:00 2001 From: Anke Koke Date: Wed, 8 Nov 2023 12:23:26 +0100 Subject: [PATCH] rename variables to improve readability --- niceml/mkdocs/mdgraph.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/niceml/mkdocs/mdgraph.py b/niceml/mkdocs/mdgraph.py index 459f0714..f5e45bdb 100644 --- a/niceml/mkdocs/mdgraph.py +++ b/niceml/mkdocs/mdgraph.py @@ -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 ""