Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use custom collector for default context #191

Merged
merged 19 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/extras/derived.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ i.e. the system of interest on which `context_diagram` was called on. The
render parameter to enable this feature is called `display_derived_interfaces`
and is available on:

- `LogicalComponent`s and
- `SystemComponent`s
- `LogicalComponent`s and
- `SystemComponent`s

!!! example "Context Diagram with derived elements"

```py
from capellambse import MelodyModel

lost = model.by_uuid("0d18f31b-9a13-4c54-9e63-a13dbf619a69")
lost = model.by_uuid("47c3130b-ec39-4365-a77a-5ab6365d1e2e")
diag = obj.context_diagram
diag.render(
"svgdiagram", display_derived_interfaces=True
Expand All @@ -32,6 +32,6 @@ and is available on:
</figure>

See [`the derivator
functions`][capellambse_context_diagrams.collectors.default.DERIVATORS] to gain
functions`][capellambse_context_diagrams.collectors.custom.DERIVATORS] to gain
an overview over all supported capellambse types and the logic to derive
elements.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ context_diagrams = "capellambse_context_diagrams:init"
[dependency-groups]
dev = [
"coverage>=7.6.9",
"ipykernel>=6.29.5",
"pre-commit>=4.0.1",
"pyls-isort>=0.2.2",
"pylsp-mypy>=0.6.9",
Expand Down
2 changes: 1 addition & 1 deletion src/capellambse_context_diagrams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,5 +354,5 @@ def register_custom_diagram() -> None:
m.set_accessor(
class_,
"custom_diagram",
context.CustomContextAccessor(dgcls.value, {}),
context.CustomAccessor(dgcls.value, {}),
)
2 changes: 1 addition & 1 deletion src/capellambse_context_diagrams/collectors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


def get_elkdata(
diagram: context.ContextDiagram, params: dict[str, t.Any] | None = None
diagram: context.ContextDiagram, params: dict[str, t.Any]
) -> _elkjs.ELKInputData:
"""High level collector function to collect needed data for ELK.

Expand Down
Loading
Loading