Skip to content

tsam.exceptions

tsam.exceptions

Custom exceptions and warnings for tsam.

LegacyAPIWarning

Bases: FutureWarning

Warning for deprecated tsam legacy API usage.

This warning is raised when using the old class-based API (TimeSeriesAggregation) instead of the new functional API (aggregate).

Users can suppress this warning during migration with:

import warnings
from tsam.exceptions import LegacyAPIWarning
warnings.filterwarnings("ignore", category=LegacyAPIWarning)
Source code in src/tsam/exceptions.py
class LegacyAPIWarning(FutureWarning):
    """Warning for deprecated tsam legacy API usage.

    This warning is raised when using the old class-based API
    (TimeSeriesAggregation) instead of the new functional API (aggregate).

    Users can suppress this warning during migration with:

        import warnings
        from tsam.exceptions import LegacyAPIWarning
        warnings.filterwarnings("ignore", category=LegacyAPIWarning)
    """

    pass