ax.exceptions

Core

exception ax.exceptions.core.AxError(message, hint='')[source]

Bases: Exception

Base Ax exception.

All exceptions derived from AxError need to define a custom error message. Additionally, exceptions can define a hint property that provides additional guidance as to how to remedy the error.

exception ax.exceptions.core.AxWarning(message, hint='')[source]

Bases: Warning

Base Ax warning.

All warnings derived from AxWarning need to define a custom warning message. Additionally, warnings can define a hint property that provides additional guidance as to how to remedy the warning.

exception ax.exceptions.core.DataRequiredError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when more observed data is needed by the model to continue the optimization.

Useful to distinguish when user needs to wait to request more trials until more data is available.

exception ax.exceptions.core.ExperimentNotReadyError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when failing to query data due to immature experiment.

Useful to distinguish data failure reasons in automated analyses.

exception ax.exceptions.core.MisconfiguredExperiment(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when experiment has incomplete or incorrect information.

exception ax.exceptions.core.NoDataError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when no data is found for experiment in underlying data store.

Useful to distinguish data failure reasons in automated analyses.

exception ax.exceptions.core.UnsupportedError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an unsupported request is made.

UnsupportedError may seem similar to NotImplementedError (NIE). It differs in the following ways:

  1. UnsupportedError is not used for abstract methods, which

    is the official NIE use case.

  2. UnsupportedError indicates an intentional and permanent lack of support.

    It should not be used for TODO (another common use case of NIE).

Data

exception ax.exceptions.data_provider.DataProviderError(message, data_provider, data_provider_error)[source]

Bases: Exception

Base Exception for Ax DataProviders.

The type of the data provider must be included. The raw error is stored in the data_provider_error section, and an Ax-friendly message is stored as the actual error message.

Model

exception ax.exceptions.model.ModelError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an error occurs during modeling.

Storage

exception ax.exceptions.storage.ImmutabilityError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an attempt is made to update an immutable object.

exception ax.exceptions.storage.JSONDecodeError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an error occurs during JSON decoding.

exception ax.exceptions.storage.JSONEncodeError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an error occurs during JSON encoding.

exception ax.exceptions.storage.SQADecodeError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an error occurs during SQA decoding.

exception ax.exceptions.storage.SQAEncodeError(message, hint='')[source]

Bases: ax.exceptions.core.AxError

Raised when an error occurs during SQA encoding.