filters
Functions and registry for filter functionality.
EX_ITEMS
module-attribute
๐
EX_ITEMS = 'show.exchange.items.filter'
Show ExchangeItems wrapped in [E1,...] and separated by ',' - filter
in Capella.
EX_ITEMS_OR_EXCH
module-attribute
๐
EX_ITEMS_OR_EXCH = (
"capellambse_context_diagrams-show.exchanges.or.exchange.items.filter"
)
Show the names of ExchangeItems wrapped in [E1,...] and separated by ','
- Custom filter or the name of the ComponentExchange or FunctionalExchange,
not available in Capella.
FILTER_LABEL_ADJUSTERS
module-attribute
๐
FILTER_LABEL_ADJUSTERS: dict[
str, Callable[[ModelElement, str | None], str]
] = {
EX_ITEMS: lambda obj, _: exchange_items(obj),
SHOW_EX_ITEMS: exchange_name_and_items,
EX_ITEMS_OR_EXCH: lambda obj, label: (
exchange_items(obj)
if getattr(obj, "exchange_items", "")
else label or name
),
NO_UUID: uuid_filter,
SYSTEM_EX_RELABEL: relabel_system_exchange,
}
Label adjuster registry.
LABEL_CONVERSION
module-attribute
๐
LABEL_CONVERSION: Final[dict[str, str]] = {
"AbstractCapabilityExtend": "extends",
"AbstractCapabilityGeneralization": "specializes",
"AbstractCapabilityInclude": "includes",
"CapabilityExploitation": "exploits",
"CapabilityInvolvement": "involves",
"EntityOperationalCapabilityInvolvement": "involves",
"MissionInvolvement": "involves",
}
A map that for relabelling specific ModelObject types.
NO_UUID
module-attribute
๐
NO_UUID = 'capellambse_context_diagrams-hide.uuids.filter'
Filter out UUIDs from label text.
RENDER_ADJUSTERS
module-attribute
๐
RENDER_ADJUSTERS: dict[
str, Callable[[bool, ModelElement, dict[str, Any]], None]
] = {"sorted_exchangedItems": sort_exchange_items_label}
Available custom render parameter-solvers registry.
SHOW_EX_ITEMS
module-attribute
๐
SHOW_EX_ITEMS = 'show.functional.exchanges.exchange.items.filter'
Show the name of ComponentExchange or FunctionalExchange and its
ExchangeItems wrapped in [E1,...] and separated by ',' - filter in Capella.
SYSTEM_EX_RELABEL
module-attribute
๐
SYSTEM_EX_RELABEL = (
"capellambse_context_diagrams-relabel.system.analysis.exchange"
)
Relabel exchanges from the SystemAnalysis layer.
E.g. ยซ i ยป is converted to includes or involves, based on the type.
UUID_PTRN
module-attribute
๐
UUID_PTRN = compile(
"\\s*\\([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\\)"
)
Regular expression pattern for UUIDs of ModelObjects.
exchange_items ๐
exchange_items(obj: ModelElement) -> str
Return obj's ExchangeItems names.
The returned string is wrapped in [E1,...] and separated by ','.
Source code in src/capellambse_context_diagrams/filters.py
59 60 61 62 63 64 65 66 67 | |
exchange_name_and_items ๐
exchange_name_and_items(obj: ModelElement, label: str | None = None) -> str
Return obj's name and ExchangeItems if there are any.
Source code in src/capellambse_context_diagrams/filters.py
70 71 72 73 74 75 76 77 | |
relabel_system_exchange ๐
relabel_system_exchange(obj: ModelElement, label: str | None) -> str
Return converted label from obj, a system exchanges.
Source code in src/capellambse_context_diagrams/filters.py
87 88 89 90 91 92 | |
sort_exchange_items_label ๐
sort_exchange_items_label(
value: bool, exchange: ModelElement, adjustments: dict[str, Any]
) -> None
Sort the exchange items in the exchange label if value is true.
Source code in src/capellambse_context_diagrams/filters.py
111 112 113 114 115 116 117 118 119 120 | |
uuid_filter ๐
uuid_filter(obj: ModelElement, label: str | None = None) -> str
Return obj's name or obj if string w/o UUIDs in it.
Source code in src/capellambse_context_diagrams/filters.py
80 81 82 83 84 | |