space_packet_parser.xtce.containers =================================== .. py:module:: space_packet_parser.xtce.containers .. autoapi-nested-parse:: Module with XTCE models related to SequenceContainers Classes ------- .. autoapisummary:: space_packet_parser.xtce.containers.SequenceContainer Module Contents --------------- .. py:class:: SequenceContainer Bases: :py:obj:`space_packet_parser.common.Parseable`, :py:obj:`space_packet_parser.common.XmlObject` :param name: Container name :type name: str :param entry_list: List of Parameter objects :type entry_list: list :param long_description: Long description of the container :type long_description: str :param base_container_name: Name of the base container from which this may inherit if restriction criteria are met. :type base_container_name: str :param restriction_criteria: A list of MatchCriteria elements that evaluate to determine whether the SequenceContainer should be included. :type restriction_criteria: list :param abstract: True if container has abstract=true attribute. False otherwise. :type abstract: bool :param inheritors: List of SequenceContainer objects that may inherit this one's entry list if their restriction criteria are met. Any SequenceContainers with this container as base_container_name should be listed here. :type inheritors: Optional[list] .. py:attribute:: name :type: str .. py:attribute:: entry_list :type: list[Union[space_packet_parser.xtce.parameters.Parameter, SequenceContainer]] .. py:attribute:: short_description :type: str | None :value: None .. py:attribute:: long_description :type: str | None :value: None .. py:attribute:: base_container_name :type: str | None :value: None .. py:attribute:: restriction_criteria :type: list[space_packet_parser.xtce.comparisons.MatchCriteria] | None :value: [] .. py:attribute:: abstract :type: bool :value: False .. py:attribute:: inheritors :type: list[str] | None :value: [] .. py:method:: __post_init__() .. py:method:: parse(packet: space_packet_parser.SpacePacket) -> None Parse the entry list of parameters/containers in the order they are expected in the packet. This could be recursive if the entry list contains SequenceContainers. .. py:method:: from_xml(element: lxml.etree.Element, *, tree: lxml.etree.ElementTree, parameter_lookup: dict[str, space_packet_parser.xtce.parameters.Parameter], container_lookup: dict[str, Any] | None, parameter_type_lookup: dict[str, space_packet_parser.xtce.parameter_types.ParameterType] | None = None) -> SequenceContainer :classmethod: Parses the list of parameters in a SequenceContainer element, recursively parsing nested SequenceContainers to build an entry list of parameters that flattens the nested structure to derive a sequential ordering of expected parameters for each SequenceContainer. Note that this also stores entry lists for containers that are not intended to stand alone. :param tree: Full XTCE tree :type tree: ElementTree.ElementTree :param element: The SequenceContainer element to parse. :type element: ElementTree.Element :param parameter_lookup: Parameters contained in the entry lists of sequence containers :type parameter_lookup: dict[str, parameters.Parameter] :param container_lookup: Containers already parsed, used to sort out duplicate references :type container_lookup: Optional[dict[str, SequenceContainer]] :param parameter_type_lookup: Ignored. :type parameter_type_lookup: Optional[dict[str, parameter_types.ParameterType]] :returns: SequenceContainer containing an entry_list of SequenceContainers and Parameters with ParameterTypes in the order expected in a packet. :rtype: cls .. py:method:: to_xml(*, elmaker: lxml.builder.ElementMaker) -> lxml.etree.Element Create a SequenceContainer XML element :param elmaker: Element factory with predefined namespace :type elmaker: ElementMaker :rtype: ElementTree.Element .. py:method:: _get_container_element(tree: lxml.etree.ElementTree, name: str) -> lxml.etree.Element :staticmethod: Finds an XTCE container by name. :param name: Name of the container to find :type name: str :rtype: ElementTree.Element .. py:method:: _get_base_container_element(tree: lxml.etree.Element, container_element: lxml.etree.Element) -> tuple[lxml.etree.Element, list[space_packet_parser.xtce.comparisons.MatchCriteria]] :staticmethod: Finds the referenced base container of an existing XTCE container element, including its inheritance restrictions. :param tree: Full XML tree object, for finding additional referenced containers if necessary. :type tree: ElementTree.ElementTree :param container_element: The container element for which to find its base container. :type container_element: ElementTree.Element :returns: The base container element of the input container_element. The restriction criteria for the inheritance. :rtype: tuple[ElementTree.Element, list[comparisons.MatchCriteria]] .. py:method:: _is_abstract_container(container_element: lxml.etree.Element) -> bool :staticmethod: Determine in a SequenceContainer element is abstract :param container_element: SequenceContainer element to examine :type container_element: ElementTree.Element :returns: True if SequenceContainer element has the attribute abstract=true. False otherwise. :rtype: bool