Exceptions

All GPClarity exceptions inherit from GPClarityError. Catch it to handle any library error in a single except block, or catch a more specific subclass when you want targeted recovery.

from gpclarity.exceptions import GPClarityError, InfluenceError

try:
    result = influence.compute_loo_variance_increase(X_train)
except InfluenceError as e:
    print(f"LOO computation failed: {e}")
except GPClarityError as e:
    print(f"Unexpected GPClarity error: {e}")

Custom exceptions for GPClarity.

exception gpclarity.exceptions.GPClarityError[source]

Bases: Exception

Base exception for all GPClarity errors.

exception gpclarity.exceptions.InfluenceError[source]

Bases: GPClarityError

Raised when influence computation fails.

exception gpclarity.exceptions.KernelError[source]

Bases: GPClarityError

Raised when kernel operations fail.

exception gpclarity.exceptions.ModelError[source]

Bases: GPClarityError

Raised when model validation fails.

exception gpclarity.exceptions.TrackingError[source]

Bases: GPClarityError

Raised when parameter tracking fails.

exception gpclarity.exceptions.OptimizationError[source]

Bases: GPClarityError

Raised when optimization fails.

exception gpclarity.exceptions.ComplexityError[source]

Bases: GPClarityError

Raised when complexity computation or analysis fails.

exception gpclarity.exceptions.UncertaintyError[source]

Bases: GPClarityError

Raised when uncertainty quantification or analysis fails.

exception gpclarity.exceptions.LinAlgError[source]

Bases: GPClarityError

Raised when linear algebra operations fail.

exception gpclarity.exceptions.ValidationError[source]

Bases: GPClarityError

Raised when input validation fails.

Exception Hierarchy

GPClarityError
├── KernelError
├── ModelError
├── ComplexityError
├── UncertaintyError
├── TrackingError
├── OptimizationError
├── InfluenceError
├── LinAlgError
└── ValidationError

All exceptions inherit from GPClarityError, which itself inherits from Python’s built-in Exception. Catch GPClarityError to handle any library error in a single except block.

GPClarityError

Base exception for all GPClarity errors.

KernelError

Raised when kernel operations fail.

ModelError

Raised when model validation fails.

ComplexityError

Raised when complexity computation or analysis fails.

UncertaintyError

Raised when uncertainty quantification or analysis fails.

TrackingError

Raised when parameter tracking fails.

OptimizationError

Raised when optimization fails.

InfluenceError

Raised when influence computation fails.

LinAlgError

Raised when linear algebra operations fail.

ValidationError

Raised when input validation fails.