merton.exceptions¶
Exception hierarchy for merton.
Every numerical or operational failure raises a MertonError subclass.
Each carries an optional suggested_fix attribute that gets rendered when
the exception is printed.
Examples
>>> raise CalibrationConvergenceError(
... "Vassalou-Xing did not converge after 200 steps",
... suggested_fix="Increase max_iter or relax tol.",
... )
Traceback (most recent call last):
...
merton.exceptions.CalibrationConvergenceError: Vassalou-Xing did not converge ...
Exceptions¶
Base class for every error raised by merton. |
|
Invalid input values supplied by the caller (NaN, negative debt, etc.). |
|
Two or more input arrays have incompatible shapes. |
|
An input contains NaN or infinity where finite values are required. |
|
A passed-in panel of market data is too sparse or contains stale ticks. |
|
Not enough observations to fit / calibrate. |
|
Calibration failed for some reason. |
|
Iterative calibration did not converge inside |
|
Something went wrong with the array-backend dispatch layer. |
|
The requested backend extra is not installed. |
|
A function could not be dispatched to any available backend. |
|
An extension model (Black-Cox, Geske, …) raised an error. |
|
Something went wrong with the Excel integration path. |
|
The Office.js add-in manifest could not be installed. |
|
The xlwings Server failed to start. |
|
Base class for non-fatal warnings emitted by merton. |
|
A requested backend was unavailable; we fell back to another. |
|
Iterative solver hit a numerical edge case (near-zero σ, etc.). |
Module Contents¶
- exception merton.exceptions.MertonError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
ExceptionBase class for every error raised by merton.
- exception merton.exceptions.MertonInputError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonError,ValueErrorInvalid input values supplied by the caller (NaN, negative debt, etc.).
- exception merton.exceptions.DimensionMismatchError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonInputErrorTwo or more input arrays have incompatible shapes.
- exception merton.exceptions.NonFiniteInputError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonInputErrorAn input contains NaN or infinity where finite values are required.
- exception merton.exceptions.DataQualityError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonErrorA passed-in panel of market data is too sparse or contains stale ticks.
- exception merton.exceptions.InsufficientDataError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
DataQualityErrorNot enough observations to fit / calibrate.
- exception merton.exceptions.CalibrationError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonErrorCalibration failed for some reason.
- exception merton.exceptions.CalibrationConvergenceError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
CalibrationErrorIterative calibration did not converge inside
max_iter.
- exception merton.exceptions.BackendError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonErrorSomething went wrong with the array-backend dispatch layer.
- exception merton.exceptions.BackendNotAvailableError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
BackendErrorThe requested backend extra is not installed.
- exception merton.exceptions.BackendDispatchError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
BackendErrorA function could not be dispatched to any available backend.
- exception merton.exceptions.ExtensionError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonErrorAn extension model (Black-Cox, Geske, …) raised an error.
- exception merton.exceptions.ExcelError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
MertonErrorSomething went wrong with the Excel integration path.
- exception merton.exceptions.ManifestInstallError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
ExcelErrorThe Office.js add-in manifest could not be installed.
- exception merton.exceptions.ServerStartupError(message: str = '', *, suggested_fix: str | None = None)[source]¶
Bases:
ExcelErrorThe xlwings Server failed to start.
- exception merton.exceptions.MertonWarning[source]¶
Bases:
UserWarningBase class for non-fatal warnings emitted by merton.
- exception merton.exceptions.MertonBackendFallbackWarning[source]¶
Bases:
MertonWarningA requested backend was unavailable; we fell back to another.
- exception merton.exceptions.MertonNumericalWarning[source]¶
Bases:
MertonWarningIterative solver hit a numerical edge case (near-zero σ, etc.).