Files
PyPortfolioOpt/pypfopt/exceptions.py
2020-08-29 14:17:56 +08:00

19 lines
494 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""
The ``exceptions`` module houses custom exceptions. Currently implemented:
- OptimizationError
"""
class OptimizationError(Exception):
"""
When an optimization routine fails usually, this means
that cvxpy has not returned the "optimal" flag.
"""
def __init__(self, *args, **kwargs):
default_message = (
"Please check your objectives/constraints or use a different solver."
)
super().__init__(default_message, *args, **kwargs)