Skip to main content
Version: 0.0.98

ts_shape.errors

Custom warnings and exceptions for ts-shape.

Follows the pandas/scikit-learn pattern:

  • warnings.warn() for user-facing feedback (visible by default).
  • logging for internal diagnostics (silent unless configured).

Users can filter specific categories, e.g.::

import warnings
from ts_shape.errors import PerformanceWarning
warnings.filterwarnings("ignore", category=PerformanceWarning)
Classes
NameDescription
TsShapeWarningBase warning for all ts-shape warnings.
PerformanceWarningWarn when an operation may be slow due to data size or shape.
DataQualityWarningWarn about potential data quality issues (gaps, duplicates, NaNs).
LoaderConfigWarningWarn when a loader returns no data, likely due to misconfiguration.
ColumnNotFoundErrorRaised when a required column is missing from the DataFrame.
LoaderErrorRaised when a loader cannot read from its configured source.
NotChunkableErrorRaised when a detector method cannot run slice by slice.
ObjectNotFoundErrorRaised when an object id is not in an event log.

TsShapeWarning​

classsource

Bases: UserWarning

Base warning for all ts-shape warnings.

PerformanceWarning​

classsource

Bases: TsShapeWarning

Warn when an operation may be slow due to data size or shape.

DataQualityWarning​

classsource

Bases: TsShapeWarning

Warn about potential data quality issues (gaps, duplicates, NaNs).

LoaderConfigWarning​

classsource

Bases: TsShapeWarning

Warn when a loader returns no data, likely due to misconfiguration.

ColumnNotFoundError​

classsource

Bases: ValueError

Raised when a required column is missing from the DataFrame.

Subclasses ValueError so existing except ValueError handlers keep working, while callers that want to react specifically to a missing column can catch this narrower type.

LoaderError​

classsource

Bases: Exception

Raised when a loader cannot read from its configured source.

Covers misconfiguration (missing path, absent credentials) and I/O that fails after the configured number of retries. Callers can catch this single type regardless of the underlying backend (local, S3, Azure, database).

NotChunkableError​

classsource

Bases: ValueError

Raised when a detector method cannot run slice by slice.

:func:ts_shape.run_chunked and :meth:ts_shape.Pipeline.run_stream only run methods whose chunked result is known to equal the in-memory result (:data:ts_shape.stream.SUPPORT). Methods that need the whole signal at once -- whole-signal statistics, a model fit, a baseline taken from the first window -- raise this error. Subclasses ValueError so existing except ValueError handlers keep working.

ObjectNotFoundError​

classsource

Bases: KeyError

Raised when an object id is not in an event log.

Raised by the genealogy queries (:func:ts_shape.eventlog.where_used, :func:~ts_shape.eventlog.where_from, :func:~ts_shape.eventlog.lineage) for an ocel:oid that is neither in objects nor in o2o. Subclasses KeyError so lookups by id can be caught the usual way; the message is printed without the quotes KeyError adds.