Skip to content

Commit

Permalink
feat: Feat-cache-collection
Browse files Browse the repository at this point in the history
Merge pull request #147 from DSD-DBS/feat-cache-collection
  • Loading branch information
ewuerger authored Oct 29, 2024
2 parents bd56468 + 3939b20 commit 0e69afe
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 90 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
18 changes: 18 additions & 0 deletions capellambse_context_diagrams/collectors/exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,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

0 comments on commit 0e69afe

Please sign in to comment.