Skip to content

Commit

Permalink
fix: Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ewuerger committed Sep 19, 2024
1 parent 8a3f52a commit 5825b83
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions capella2polarion/converters/link_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

TYPE_RESOLVERS = {"Part": lambda obj: obj.type.uuid}
_Serializer: t.TypeAlias = cabc.Callable[
[m.ModelObject, str, str, dict[str, t.Any]],
[m.ModelElement | m.Diagram, str, str, dict[str, t.Any]],
list[polarion_api.WorkItemLink],
]

Expand Down Expand Up @@ -139,19 +139,18 @@ def _get_work_item_ids(

def _handle_description_reference_links(
self,
obj: m.ModelObject,
obj: m.ModelElement | m.Diagram,
work_item_id: str,
role_id: str,
links: dict[str, polarion_api.WorkItemLink],
) -> list[polarion_api.WorkItemLink]:
assert isinstance(obj, m.ModelElement)
refs = self.converter_session[obj.uuid].description_references
ref_set = set(self._get_work_item_ids(work_item_id, refs, role_id))
return self._create(work_item_id, role_id, ref_set, links)

def _handle_diagram_reference_links(
self,
diagram: m.ModelObject,
diagram: m.ModelElement | m.Diagram,
work_item_id: str,
role_id: str,
links: dict[str, polarion_api.WorkItemLink],
Expand Down Expand Up @@ -384,7 +383,7 @@ def _sorted_unordered_html_list(


def _resolve_attribute(
obj: m.ModelObject, attr_id: str
obj: m.ModelElement | m.Diagram, attr_id: str
) -> m.ElementList[m.ModelElement] | m.ModelElement:
attr_name, _, map_id = attr_id.partition(".")
objs = getattr(obj, attr_name)
Expand Down
4 changes: 2 additions & 2 deletions jupyter-notebooks/document_templates/test-icd.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,14 @@ This interface control document defines functional interactions between the foll
{{ heading(3, "Message Catalog", session)}}
<p>This section identifies messages used within the interface.</p>
{%- set classes = [] %}
{% for ei in interface.exchange_items | unique %}
{% for ei in interface.exchange_items | unique(attribute="uuid") %}
{{ insert_work_item(ei, session) }}
{% for el in ei.elements %}
{{ add_class_dependencies(el.abstract_type, classes) }}
{% endfor %}
{% endfor %}
{{ heading(3, "Message Description", session)}}
<p>This section provides a detailed description of each message used within the interface.</p>
{% for cl in classes | unique %}
{% for cl in classes | unique(attribute="uuid") %}
{{ insert_work_item(cl, session) }}
{% endfor %}

0 comments on commit 5825b83

Please sign in to comment.