:py:mod:`raesl.excel.utils` =========================== .. py:module:: raesl.excel.utils .. autoapi-nested-parse:: Excel export utility methods. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: raesl.excel.utils.get_all_tags raesl.excel.utils.make_table raesl.excel.utils.apply_styling raesl.excel.utils.parent_component raesl.excel.utils.parent_def raesl.excel.utils.format_multiline raesl.excel.utils.requirement_kind raesl.excel.utils.dedupe raesl.excel.utils.yield_functional_dependencies raesl.excel.utils.yield_all_function_specifications raesl.excel.utils.yield_function_specifications raesl.excel.utils.get_function_specification_names raesl.excel.utils.yield_active_functions raesl.excel.utils.get_goal_active raesl.excel.utils.yield_passive_functions raesl.excel.utils.get_goal_passive raesl.excel.utils.get_function_flow_variables raesl.excel.utils.get_function_subclauses raesl.excel.utils.get_variable_type raesl.excel.utils.build_active_goal_data raesl.excel.utils.build_passive_goal_data raesl.excel.utils.build_subclause_data raesl.excel.utils.build_subclause_body_data .. py:function:: get_all_tags(nodes: List[ragraph.node.Node]) -> List[str] Get all tagged comment keys from a list of nodes. .. py:function:: 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. .. py:function:: apply_styling(ws: openpyxl.worksheet.worksheet.Worksheet, headers: List[str], defaults: Dict[str, Any] = dict(), start_row: int = 0, end_row: Optional[int] = None) Apply styling to columns given some default option dictionary. .. py:function:: parent_component(requirement: ragraph.node.Node, skip: Optional[str] = 'world') -> str Get parent component name of a requirement. .. py:function:: parent_def(graph: ragraph.graph.Graph, requirement: ragraph.node.Node) -> str Get the parent (component) definition of a requirement. .. py:function:: format_multiline(comments: List[str]) -> str Format multiline (list) text. .. py:function:: requirement_kind(requirement: ragraph.node.Node) -> str Get requirement kind. .. py:function:: dedupe(iterable: Iterable) -> List[Any] Deduplicate any iterable into a list where the first occurrence is preserved. .. py:function:: yield_functional_dependencies(g: ragraph.graph.Graph, component: ragraph.node.Node, flows: Optional[Set[str]]) -> Generator[ragraph.edge.Edge, None, None] Yield all functional dependencies with which a component is involved. .. py:function:: 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. .. py:function:: 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. .. py:function:: get_function_specification_names(functional_dependency: ragraph.edge.Edge) -> List[str] Get the function specification node names corresponding to a functional dependency edge. .. py:function:: 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. .. py:function:: get_goal_active(function_specification: ragraph.node.Node) -> Optional[str] Get the active component in a function specification. .. py:function:: 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. .. py:function:: get_goal_passive(function_specification: ragraph.node.Node) -> Optional[str] Get the receiving component of a goal function. .. py:function:: 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. .. py:function:: get_function_subclauses(function_specification: ragraph.node.Node) -> List[str] Get the subclauses belonging to a function specification. .. py:function:: get_variable_type(variable: ragraph.node.Node) -> str Get the variable type of a node. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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. .. py:function:: 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.