Skip to content

Commit

Permalink
merge: Merge pull request #48 from DSD-DBS/get-dry
Browse files Browse the repository at this point in the history
fix: Remove obsolete `nodes`
  • Loading branch information
ewuerger authored Jun 20, 2023
2 parents 48b4207 + 099b465 commit b93ad30
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions capellambse_context_diagrams/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ def __init__(
slim_center_box: bool = True,
) -> None:
super().__init__(obj._model)
self._allow_render = True
self.target = obj
self.styleclass = class_

Expand Down Expand Up @@ -210,31 +209,6 @@ def type(self) -> modeltypes.DiagramType:
logger.warning("Unknown diagram type %r", self.styleclass)
return modeltypes.DiagramType.UNKNOWN

@property
def nodes(self) -> common.MixedElementList:
"""Return a list of all nodes visible in this diagram."""
adiagram = self.render(None)
assert isinstance(adiagram, cdiagram.Diagram)
allids = {e.uuid for e in iter(adiagram) if not e.hidden}
assert None not in allids
elems = []
for elemid in allids:
assert elemid is not None
try:
elem = self._model._loader[elemid]
except (KeyError, StopIteration): # pragma: no cover
continue
else:
# Filter out visual-only elements that live in the
# .aird / .airdfragment files
frag = self._model._loader.find_fragment(elem)
if frag.suffix not in {".aird", ".airdfragment"}:
elems.append(elem)

return common.MixedElementList(
self._model, elems, common.GenericElement
)

class FilterSet(cabc.MutableSet):
"""A set that stores filter_names and invalidates diagram cache."""

Expand Down

0 comments on commit b93ad30

Please sign in to comment.