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

Feat-cache-collection #147

Merged
merged 7 commits into from
Oct 29, 2024
Merged
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ default_install_hook_types: [commit-msg, pre-commit]
default_stages: [commit, merge-commit]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-ast
@@ -26,7 +26,7 @@ repos:
- id: fix-byte-order-marker
- id: trailing-whitespace
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.8.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
18 changes: 18 additions & 0 deletions capellambse_context_diagrams/collectors/exchanges.py
Original file line number Diff line number Diff line change
@@ -433,3 +433,21 @@ def is_hierarchical(
source_contained = src.uuid in objs or attr_getter(src) == box.id
target_contained = trg.uuid in objs or attr_getter(trg) == box.id
return source_contained and target_contained


def functional_context_collector(
diagram: context.FunctionalContextDiagram, pars: dict[str, t.Any]
) -> _elkjs.ELKInputData:
return get_elkdata_for_exchanges(diagram, FunctionalContextCollector, pars)


def interface_context_collector(
diagram: context.InterfaceContextDiagram, pars: dict[str, t.Any]
) -> _elkjs.ELKInputData:
collector: t.Type[ExchangeCollector]
if isinstance(diagram.target, cs.PhysicalLink):
collector = PhysicalLinkContextCollector
else:
collector = InterfaceContextCollector

return get_elkdata_for_exchanges(diagram, collector, pars)
Loading