ax.exceptions¶
Constants¶
Core¶
- exception ax.exceptions.core.AxError(message: str, hint: str = '')[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: str, hint: str = '')[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: str, hint: str = '')[source]¶
Bases:
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: str, hint: str = '', exposures_unavailable: bool = False)[source]¶
Bases:
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: str, hint: str = '')[source]¶
Bases:
AxError
Raised when experiment has incomplete or incorrect information.
- exception ax.exceptions.core.NoDataError(message: str, hint: str = '')[source]¶
Bases:
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.ObjectNotFoundError(message: str, hint: str = '')[source]¶
Bases:
AxError
,ValueError
Raised when an object is not found in the database.
This exception replaces ValueError raised by code when an objects is not found in the database. In order to maintain backwards compatibility ObjectNotFoundError inherits from ValueError. Dependency on ValueError may be removed in the future.
- exception ax.exceptions.core.OptimizationComplete(message: str)[source]¶
Bases:
AxError
Raised when you hit SearchSpaceExhausted and GenerationStrategyComplete.
- exception ax.exceptions.core.OptimizationShouldStop(message: str)[source]¶
Bases:
OptimizationComplete
Raised when the Global Stopping Strategy suggests to stop the optimization.
- exception ax.exceptions.core.SearchSpaceExhausted(message: str)[source]¶
Bases:
OptimizationComplete
Raised when using an algorithm that deduplicates points and no more new points can be sampled from the search space.
- exception ax.exceptions.core.UnsupportedError(message: str, hint: str = '')[source]¶
Bases:
AxError
Raised when an unsupported request is made.
UnsupportedError may seem similar to NotImplementedError (NIE). It differs in the following ways:
- UnsupportedError is not used for abstract methods, which
is the official NIE use case.
- 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: str, data_provider: str, data_provider_error: Any)[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.
Generation Strategy¶
- exception ax.exceptions.generation_strategy.GenerationStrategyCompleted(message: str)[source]¶
Bases:
OptimizationComplete
Special exception indicating that the generation strategy has been completed.
- exception ax.exceptions.generation_strategy.GenerationStrategyRepeatedPoints(message: str)[source]¶
Bases:
GenerationStrategyCompleted
Special exception indicating that the generation strategy is repeatedly suggesting previously sampled points.
- exception ax.exceptions.generation_strategy.MaxParallelismReachedException(step_index: int, model_name: str, num_running: int)[source]¶
Bases:
AxError
Special exception indicating that maximum number of trials running in parallel set on a given step (as GenerationStep.max_parallelism) has been reached. Upon getting this exception, users should wait until more trials are completed with data, to generate new trials.
Model¶
Storage¶
- exception ax.exceptions.storage.ImmutabilityError(message: str, hint: str = '')[source]¶
Bases:
AxError
Raised when an attempt is made to update an immutable object.
- exception ax.exceptions.storage.IncorrectDBConfigurationError(message: str, hint: str = '')[source]¶
Bases:
AxError
Raised when an attempt is made to save and load an object, but the current engine and session factory is setup up incorrectly to process the call (e.g. current session factory will connect to a wrong database for the call).
- exception ax.exceptions.storage.JSONDecodeError(message: str, hint: str = '')[source]¶
Bases:
AxError
Raised when an error occurs during JSON decoding.
- exception ax.exceptions.storage.JSONEncodeError(message: str, hint: str = '')[source]¶
Bases:
AxError
Raised when an error occurs during JSON encoding.