Skip to content

Commit

Permalink
refactor: Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger authored and huyenngn committed Feb 9, 2024
1 parent 94b7375 commit 40ec890
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions capellambse_context_diagrams/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,15 @@ def add_context(data: _elkjs.ELKOutputData, is_legend: bool = False) -> None:

ids: set[str] = set()

def get_ids(obj: _elkjs.ELKOutputNode | _elkjs.ELKOutputEdge) -> None:
def get_ids(obj: _elkjs.ELKOutputElement) -> None:
if obj["id"] and not obj["id"].startswith("g_"):
ids.add(obj["id"])
for cobj in obj.get("children", []):
if cobj["type"] == "node":
for cobj in obj.get("children", []): # type: ignore[attr-defined]
if cobj["type"] in {"node", "port", "junction", "edge"}:
get_ids(cobj)

for child in data["children"]:
if child["type"] == "node" or child["type"] == "edge":
if child["type"] in {"node", "port", "junction", "edge"}:
get_ids(child)

for child in data["children"]:
Expand Down

0 comments on commit 40ec890

Please sign in to comment.