raesl.excel.utils
#
Excel export utility methods.
Module Contents#
Functions#
|
Get all tagged comment keys from a list of nodes. |
|
Make a table of a cell range in a worksheet. |
|
Apply styling to columns given some default option dictionary. |
|
Get parent component name of a requirement. |
|
Get the parent (component) definition of a requirement. |
|
Format multiline (list) text. |
|
Get requirement kind. |
|
Deduplicate any iterable into a list where the first occurrence is preserved. |
Yield all functional dependencies with which a component is involved. |
|
Yield all function specification nodes and edge combinations for a given iterable of dependency edges. |
|
Get all function specification nodes corresponding to a functional dependency edge. |
|
|
Get the function specification node names corresponding to a functional dependency edge. |
|
Yield all edge function combinations for which the active component matches the given path. |
|
Get the active component in a function specification. |
Yield all edge function combinations for which the passive component matches the given path. |
|
|
Get the receiving component of a goal function. |
|
Get the variables involved with a functional dependency. |
|
Get the subclauses belonging to a function specification. |
|
Get the variable type of a node. |
|
Create data dictionaries for the outgoing goals in the component overview. |
|
Create data dictionaries for the incoming goals in the component overview. |
|
Create a subclause data dictionary for each OR clause for use in the component overview. |
|
Create a subclause's body data dict for use in the component overview. |
- raesl.excel.utils.get_all_tags(nodes: List[ragraph.node.Node]) List[str] #
Get all tagged comment keys from a list of nodes.
- raesl.excel.utils.make_table(ws: openpyxl.worksheet.worksheet.Worksheet, name: str = 'Table', min_row: int = 1, max_row: int = 1, min_col: int = 1, max_col: int = 1, style: openpyxl.worksheet.table.TableStyleInfo = TableStyleInfo(name='TableStyleMedium9', showRowStripes=True)) openpyxl.worksheet.table.Table #
Make a table of a cell range in a worksheet.
- raesl.excel.utils.apply_styling(ws: openpyxl.worksheet.worksheet.Worksheet, headers: List[str], defaults: Dict[str, Any] = dict(), start_row: int = 0, end_row: int | None = None)#
Apply styling to columns given some default option dictionary.
- raesl.excel.utils.parent_component(requirement: ragraph.node.Node, skip: str | None = 'world') str #
Get parent component name of a requirement.
- raesl.excel.utils.parent_def(graph: ragraph.graph.Graph, requirement: ragraph.node.Node) str #
Get the parent (component) definition of a requirement.
- raesl.excel.utils.format_multiline(comments: List[str]) str #
Format multiline (list) text.
- raesl.excel.utils.requirement_kind(requirement: ragraph.node.Node) str #
Get requirement kind.
- raesl.excel.utils.dedupe(iterable: Iterable) List[Any] #
Deduplicate any iterable into a list where the first occurrence is preserved.
- raesl.excel.utils.yield_functional_dependencies(g: ragraph.graph.Graph, component: ragraph.node.Node, flows: Set[str] | None) Generator[ragraph.edge.Edge, None, None] #
Yield all functional dependencies with which a component is involved.
- raesl.excel.utils.yield_all_function_specifications(g: ragraph.graph.Graph, functional_dependencies: Iterable[ragraph.edge.Edge]) Generator[Tuple[ragraph.node.Node, ragraph.node.Node], None, None] #
Yield all function specification nodes and edge combinations for a given iterable of dependency edges.
- raesl.excel.utils.yield_function_specifications(g: ragraph.graph.Graph, functional_dependency: ragraph.edge.Edge) Generator[Tuple[ragraph.node.Node, ragraph.node.Node], None, None] #
Get all function specification nodes corresponding to a functional dependency edge.
- raesl.excel.utils.get_function_specification_names(functional_dependency: ragraph.edge.Edge) List[str] #
Get the function specification node names corresponding to a functional dependency edge.
- raesl.excel.utils.yield_active_functions(function_specifications: Iterable[ragraph.node.Node], active_path: str) Generator[ragraph.node.Node, None, None] #
Yield all edge function combinations for which the active component matches the given path.
- raesl.excel.utils.get_goal_active(function_specification: ragraph.node.Node) str | None #
Get the active component in a function specification.
- raesl.excel.utils.yield_passive_functions(function_specifications: Iterable[ragraph.node.Node], passive_path: str) Generator[Tuple[ragraph.node.Node, ragraph.node.Node], None, None] #
Yield all edge function combinations for which the passive component matches the given path.
- raesl.excel.utils.get_goal_passive(function_specification: ragraph.node.Node) str | None #
Get the receiving component of a goal function.
- raesl.excel.utils.get_function_flow_variables(function_specification: ragraph.node.Node, edge: ragraph.edge.Edge, function_specifications: Set[ragraph.node.Node] = set()) Set[str] #
Get the variables involved with a functional dependency.
- raesl.excel.utils.get_function_subclauses(function_specification: ragraph.node.Node) List[str] #
Get the subclauses belonging to a function specification.
- raesl.excel.utils.get_variable_type(variable: ragraph.node.Node) str #
Get the variable type of a node.
- raesl.excel.utils.build_active_goal_data(graph: ragraph.graph.Graph, edge: ragraph.edge.Edge, goal: ragraph.node.Node, function_specifications: Set[ragraph.node.Node] = set()) Generator[Dict[str, Any], None, None] #
Create data dictionaries for the outgoing goals in the component overview.
- Keys:
label: Goal label. target: Target component (shared path skipped). flows: Sent flow variables (shared path skipped). types: Flow variable types. subclause: Subclause label, optionally prefixed with numbers for OR-concatenations. subject: Subclause subject with prefix skipped. comparison: Abbreviated comparison (<, <=, ==, >=, >, ++, –). bound: Comparison variable or value. unit: Comparison value unit.
- raesl.excel.utils.build_passive_goal_data(graph: ragraph.graph.Graph, edge: ragraph.edge.Edge, goal: ragraph.node.Node, function_specifications: Set[ragraph.node.Node]) Generator[Dict[str, Any], None, None] #
Create data dictionaries for the incoming goals in the component overview.
- Keys:
label: Goal label. target: Target component (shared path skipped). flows: Sent flow variables (shared path skipped). types: Flow variable types. subclause: Subclause label, optionally prefixed with numbers for OR-concatenations. subject: Subclause subject with prefix skipped. comparison: Abbreviated comparison (<, <=, ==, >=, >, ++, –). bound: Comparison variable or value. unit: Comparison value unit.
- raesl.excel.utils.build_subclause_data(subclause_info: Dict[str, Any], skip_prefix: str) Generator[Dict[str, Any], None, None] #
Create a subclause data dictionary for each OR clause for use in the component overview.
- Keys:
subclause: Subclause label, optionally prefixed with numbers for OR-concatenations. subject: Subclause subject with prefix skipped. comparison: Abbreviated comparison (<, <=, ==, >=, >, ++, –). bound: Comparison variable or value. unit: Comparison value unit.
- raesl.excel.utils.build_subclause_body_data(subclause_body: Dict[str, Any], skip_prefix: str) Dict[str, Any] #
Create a subclause’s body data dict for use in the component overview.
- Keys:
subject: Subclause subject with prefix skipped. comparison: Abbreviated comparison (<, <=, ==, >=, >, ++, –). bound: Comparison variable or value. unit: Comparison value unit.