pipeline.src.helpers.controls ============================= .. py:module:: pipeline.src.helpers.controls Functions --------- .. autoapisummary:: pipeline.src.helpers.controls.make_infractions Module Contents --------------- .. py:function:: make_infractions(natinfs: Union[None, Set[int]], infraction_type: src.entities.missions.InfractionType) -> List[dict] Generates a list of infraction dicts. :param natinfs: Set of infractions natinfs. :type natinfs: Union[None, Set[int]] :param infraction_type: infraction_type to set in the infractions. :type infraction_type: InfractionType :raises ValueError: If both `only_natinfs` and `exclude_natinfs` are given. :returns: `list` of the form `[{"natinf": 1234}, {"natinf": 9876}]` :rtype: List[dict] .. rubric:: Examples >>> make_infractions({1, 2, 4}, InfractionType.WITH_RECORD) [ {"natinf": 1, "infractionType": "WITH_RECORD"}, {"natinf": 2, "infractionType": "WITH_RECORD"}, {"natinf": 4, "infractionType": "WITH_RECORD"} ] >>> make_infractions(None, InfractionType.WITH_RECORD) [] >>> make_infractions({}, InfractionType.WITH_RECORD) []