"""Defines the data structure used to represent progress state"""

# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/progress_info.ipynb.

# %% auto 0
__all__ = ['ProgressInfo']

# %% ../nbs/progress_info.ipynb 3
from dataclasses import dataclass
import time
from typing import Optional

# %% ../nbs/progress_info.ipynb 4
@dataclass
class ProgressInfo:
    """Structured progress information"""
    progress: float                      # Percentage completion (0-100)
    current: Optional[int] = None        # Current iteration count
    total: Optional[int] = None          # Total iterations expected
    rate: Optional[str] = None           # Processing rate (e.g., "50.5 it/s")
    elapsed: Optional[str] = None        # Time elapsed since start
    remaining: Optional[str] = None      # Estimated time remaining
    description: Optional[str] = None    # Progress bar description/label
    raw_output: str = ""                 # Raw output string (if any)
    timestamp: float = None              # Unix timestamp when created
    
    def __post_init__(self):
        "Set timestamp to current time if not provided"
        if self.timestamp is None:
            self.timestamp = time.time()
