nirs4all.controllers.models.stacking.exceptions module

Meta-Model Exceptions - Error classes for meta-model stacking.

This module provides specific exception classes for meta-model prediction and serialization errors.

Exception Hierarchy:

MetaModelError (base) ├── MetaModelPredictionError (prediction failures) │ ├── MissingSourceModelError (source model not found) │ ├── SourcePredictionError (source model prediction failed) │ ├── FeatureOrderMismatchError (column order doesn’t match) │ └── BranchMismatchError (branch context incompatible) └── MetaModelSerializationError (persistence failures)

└── MissingDependencyError (dependency not serialized)

exception nirs4all.controllers.models.stacking.exceptions.BranchingError(message: str, details: dict[str, Any] | None = None)[source]

Bases: MetaModelError

Base exception for branching-related errors in meta-model stacking.

exception nirs4all.controllers.models.stacking.exceptions.CrossBranchStackingError(message: str, details: dict[str, Any] | None = None)[source]

Bases: BranchingError

Base exception for cross-branch stacking errors.

exception nirs4all.controllers.models.stacking.exceptions.InvalidMetaModelArtifactError(artifact_id: str, validation_errors: list[str])[source]

Bases: MetaModelSerializationError

Raised when a meta-model artifact is invalid or corrupted.

This occurs when loading a meta-model artifact that doesn’t contain the required fields or has inconsistent data.

Variables:
  • artifact_id – The artifact ID being loaded.

  • validation_errors – List of validation errors found.

exception nirs4all.controllers.models.stacking.exceptions.MetaModelError(message: str, details: dict[str, Any] | None = None)[source]

Bases: Exception

Base exception for meta-model errors.

All meta-model specific exceptions inherit from this class, allowing catch-all handling of meta-model issues.

Variables:
  • message – Human-readable error description.

  • details – Optional dictionary with additional context.

exception nirs4all.controllers.models.stacking.exceptions.MetaModelSerializationError(message: str, details: dict[str, Any] | None = None)[source]

Bases: MetaModelError

Base exception for meta-model serialization errors.

Raised when persistence or loading of meta-model artifacts fails.

exception nirs4all.controllers.models.stacking.exceptions.MissingDependencyError(dependency_id: str, meta_model_id: str, dependency_name: str | None = None)[source]

Bases: MetaModelSerializationError

Raised when a dependency is not serialized.

This occurs when attempting to serialize a meta-model but one of its source model dependencies hasn’t been persisted yet.

Variables:
  • dependency_id – The artifact ID of the missing dependency.

  • meta_model_id – The artifact ID of the meta-model.

  • dependency_name – Optional name of the missing dependency.

exception nirs4all.controllers.models.stacking.exceptions.MultiLevelStackingError(message: str, details: dict[str, Any] | None = None)[source]

Bases: MetaModelError

Base exception for multi-level stacking errors.