Coverage for src / mafw / models / loop_payloads.py: 100%
26 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-30 16:10 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-03-30 16:10 +0000
1# Copyright 2025–2026 European Union
2# Author: Bulgheroni Antonio (antonio.bulgheroni@ec.europa.eu)
3# SPDX-License-Identifier: EUPL-1.2
4"""
5Loop payload dataclasses for parallel processors.
7.. versionadded:: v2.1.0
9"""
11from __future__ import annotations
13from dataclasses import dataclass
14from typing import Any
16from mafw.enumerators import LoopingStatus
19@dataclass(slots=True)
20class LoopItem:
21 """Container for a loop item and its position."""
23 i_item: int
24 """Index of the item within the loop."""
26 n_item: int
27 """Total number of items in the loop."""
29 payload: Any
30 """The item payload."""
33@dataclass(slots=True)
34class LoopResult:
35 """Container for a loop result and its status."""
37 i_item: int
38 """Index of the item within the loop."""
40 n_item: int
41 """Total number of items in the loop."""
43 looping_status: LoopingStatus
44 """Looping status produced while processing the item."""
46 payload: Any
47 """Optional result payload returned by the processor."""
49 duration: float
50 """Wall clock duration of the item processing."""
53__all__ = ['LoopItem', 'LoopResult']
54"""Public exports for loop payload dataclasses."""