pymc_forecast.exceptions#

Exception taxonomy for pymc_forecast.

Package-specific errors derive from PymcForecastError, so callers can catch that family with one clause. Specific subclasses exist where a caller might plausibly branch on the failure mode. Plain argument validation raises builtin exceptions instead: mostly ValueError/TypeError (e.g. in metrics and features), plus KeyError for unknown names (prior names, statespace var_names) and NotImplementedError for unsupported statespace configurations.

exception pymc_forecast.exceptions.AlignmentError[source]#

Bases: PymcForecastError, ValueError

Inputs are malformed or do not align along the time dimension.

Covers data/covariate misalignment as well as invalid input shapes (e.g. no "time" dim), invalid horizons or non-extendable time indices, misordered future indices, and covariate structure mismatches.

exception pymc_forecast.exceptions.BacktestWindowError[source]#

Bases: PymcForecastError, ValueError

Backtest windowing parameters are invalid or admit no valid windows.

exception pymc_forecast.exceptions.HorizonError[source]#

Bases: PymcForecastError, ValueError

Forecast-horizon or model-structure misuse.

Raised when the train/forecast horizon cannot be derived or is inconsistent, and for related model-building misuse, e.g. missing model coords, horizon helpers used outside a model build, misuse of .dist() or Prior observation/noise specs, reserved predictive-output names (mu, expected_observation, …) already defined in the model, multivariate data passed to predict_mvn, or a model without the expected obs/future variables.

exception pymc_forecast.exceptions.MethodResolutionError[source]#

Bases: PymcForecastError, ValueError

A VI method, optimizer, or VI backend specification could not be resolved.

exception pymc_forecast.exceptions.NotFittedError[source]#

Bases: PymcForecastError, RuntimeError

A predictive method was called on a forecaster that has not been fit.

exception pymc_forecast.exceptions.OptionalDependencyError(package, extra, feature)[source]#

Bases: PymcForecastError, ImportError

An optional dependency is required for the requested feature.

Parameters:
  • package (str) – Distribution name of the missing dependency (used in the install hint).

  • extra (str) – Name of the pymc-forecast extra that provides it.

  • feature (str) – Human-readable name of the feature that needs it.

package#

Distribution name of the missing dependency.

Type:

str

exception pymc_forecast.exceptions.PymcForecastError[source]#

Bases: Exception

Base class for all pymc_forecast errors.