nirs4all.core.logging.events module
Event types and structured logging for nirs4all.
This module defines event categories and structured event types used for consistent logging throughout the pipeline execution.
- class nirs4all.core.logging.events.EventType(value)[source]
-
Event types within phases.
- ARTIFACT = 'artifact'
- BRANCH_COMPARE = 'branch_compare'
- BRANCH_ENTER = 'branch_enter'
- BRANCH_EXIT = 'branch_exit'
- BUILD = 'build'
- COLLECT = 'collect'
- COMPLETE = 'complete'
- CONFIG_LOAD = 'config_load'
- DEDUPLICATE = 'deduplicate'
- ENVIRONMENT = 'environment'
- ERROR = 'error'
- EXPAND = 'expand'
- LEAKAGE_CHECK = 'leakage_check'
- LOAD = 'load'
- METRIC = 'metric'
- MODEL = 'model'
- PREDICTIONS = 'predictions'
- PROGRESS = 'progress'
- PRUNE = 'prune'
- REPORT = 'report'
- SKIP = 'skip'
- SOURCE_CONCAT = 'source_concat'
- SOURCE_PROCESS = 'source_process'
- START = 'start'
- STEP = 'step'
- TRAIN_META = 'train_meta'
- TRANSFORM = 'transform'
- VALIDATE = 'validate'
- WARNING = 'warning'
- class nirs4all.core.logging.events.LogEvent(timestamp: datetime, level: str, phase: Phase | None, event_type: EventType, message: str, run_id: str | None = None, status: Status | None = None, branch_name: str | None = None, branch_path: list[str] | None = None, branch_index: int | None = None, source_index: int | None = None, source_name: str | None = None, duration_ms: float | None = None, metrics: dict[str, ~typing.Any]=<factory>, extra: dict[str, ~typing.Any]=<factory>)[source]
Bases:
objectStructured log event for machine-readable logging.
- timestamp
Event timestamp.
- Type:
- phase
Current workflow phase.
- Type:
- event_type
Type of event within the phase.
- status
Event status indicator.
- Type:
- class nirs4all.core.logging.events.Phase(value)[source]
-
Major workflow phases for high-level tracking.
- BRANCH = 'branch'
- COMPLETE = 'complete'
- DATA = 'data'
- EVALUATE = 'evaluate'
- EXPORT = 'export'
- GENERATE = 'generate'
- INIT = 'init'
- PREDICT = 'predict'
- SOURCE = 'source'
- SPLIT = 'split'
- STACK = 'stack'
- TRAIN = 'train'