Skip to content

Commit

Permalink
refactor: Simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Apr 26, 2024
1 parent 0fb62fe commit 48c10cf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions capellambse_context_diagrams/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ def _create_diagram(self, params: dict[str, t.Any]) -> cdiagram.Diagram:
params.setdefault(
"search_direction", params.get("search_direction", "ALL")
)
params.setdefault("show_owners", params.get("show_owners", True))
params.setdefault("layer_sizing", params.get("layer_sizing", "WIDTH"))
params.setdefault("show_owners", True)
params.setdefault("layer_sizing", "WIDTH")
data, edges = realization_view.collector(self, params)
layout = try_to_layout(data)
adjust_layer_sizing(data, layout, params["layer_sizing"])
Expand Down
20 changes: 9 additions & 11 deletions docs/gen_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,16 @@ def generate_realization_view_images() -> None:
diag = obj.realization_view
for layer_sizing in ("UNION", "HEIGHT", "WIDTH", "INDIVIDUAL"):
with mkdocs_gen_files.open(
f"{str(dest / diag.name)} {layer_sizing}.svg", "w"
str(dest / f"{diag.name} {layer_sizing}.svg"), "wb"
) as fd:
print(
diag.render(
"svg",
depth=3,
search_direction="ALL",
show_owners=True,
transparent_background=False,
layer_sizing=layer_sizing,
),
file=fd,
diag.save(
fd,
"svg",
depth=3,
search_direction="ALL",
show_owners=True,
transparent_background=False,
layer_sizing=layer_sizing,
)


Expand Down

0 comments on commit 48c10cf

Please sign in to comment.