Skip to content

Commit

Permalink
Fix linting for see_dict_algo
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahtang7 committed May 5, 2023
1 parent f6ff716 commit 3e6c84f
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions seealgo/see_dict_algo.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,18 @@ def create_viz(self, data, keys=None):
# Create nodes for each key-value pair in the dictionary
for k, val in data.items():
if isinstance(val, dict): # if value is a nested dictionary
subgraph.node(str(k), label=str(k), shape='rectangle',
style='filled', color='lightblue2')
subgraph.node(str(k),
label=str(k),
shape='rectangle',
style='filled',
color='lightblue2',)

for nested_k, nested_v in val.items():
if nested_k in keys:
subgraph.node(str(nested_k), label=f"{str(nested_k)}: {str(nested_v)}",
style='filled', color='green')
subgraph.node(str(nested_k),
label=f"{str(nested_k)}: {str(nested_v)}",

Check warning on line 97 in seealgo/see_dict_algo.py

View check run for this annotation

Codecov / codecov/patch

seealgo/see_dict_algo.py#L97

Added line #L97 was not covered by tests
style='filled',
color='green',)

else:
subgraph.node(str(nested_k), label=f"{str(nested_k)}: {str(nested_v)}")
Expand All @@ -102,8 +107,10 @@ def create_viz(self, data, keys=None):
else: # if value is not a nested dictionary

if k in keys:
subgraph.node(str(k), label=f"{str(k)}: {str(val)}",
style='filled', color='green')
subgraph.node(str(k),
label=f"{str(k)}: {str(val)}",
style='filled',
color='green',)
else:
subgraph.node(str(k), label=f"{str(k)}: {str(val)}")

Expand Down

0 comments on commit 3e6c84f

Please sign in to comment.