ts_shape.events.development.design_space
Multivariate design-space qualification and monitoring.
In process development the design space is the multidimensional region of input parameters that has been demonstrated -- through DOE or process characterization runs -- to deliver acceptable output quality. ICH Q8 formalises the concept for pharma; it is equally useful in any process industry where multiple critical process parameters (CPPs) interact.
This detector fits a design space to qualification data and emits events when commercial-operation data exits the qualified region. Two fitting modes are supported: per-axis quantile boxes (cheap, conservative) and a scipy convex hull (tight, captures correlation between factors).
| Name | Description |
|---|---|
DesignSpaceEvents | Fit and monitor a multivariate qualified operating window. |
DesignSpaceEvents
DesignSpaceEvents(
dataframe: pd.DataFrame,
cpp_uuids: list[str],
*,
event_uuid: str = "dev:design_space",
value_column: str = "value_double",
time_column: str = "systime"
) -> None
Bases: Base
Fit and monitor a multivariate qualified operating window.
Workflow::
ds = DesignSpaceEvents(qualification_df, cpp_uuids=[...])
ds.fit_box() # or ds.fit_hull()
excursions = ds.detect_excursions(operation_df)
near = ds.boundary_proximity(operation_df, warn_margin=0.1)
| Name | Description |
|---|---|
fit_box | Fit per-axis bounds from the qualification data. |
fit_hull | Fit a convex hull around the qualification data. |
detect_excursions | Find contiguous intervals where operation leaves the design space. |
boundary_proximity | Emit point events for samples within warn_margin of the boundary. |
| Name | Type | Description | Default |
|---|---|---|---|
dataframe | DataFrame | Qualification frame the operating window is fitted on. | required |
cpp_uuids | list[str] | UUIDs of the critical process parameters (at least two; use :class:ProcessWindowEvents for one). | required |
event_uuid | str | UUID stamped on emitted events. | 'dev:design_space' |
value_column | str | Column holding the signal values. | 'value_double' |
time_column | str | Timestamp column. | 'systime' |
fit_box
fit_box(quantiles: tuple[float, float] = (0.05, 0.95)) -> DesignSpaceEvents
Fit per-axis bounds from the qualification data.
| Name | Type | Description | Default |
|---|---|---|---|
quantiles | tuple[float, float] | (low, high) quantile pair used to set each axis's bounds. (0.0, 1.0) reduces to absolute min/max. | (0.05, 0.95) |
| Type | Description |
|---|---|
DesignSpaceEvents | self to allow DesignSpaceEvents(...).fit_box() chaining. |
fit_hull
fit_hull() -> DesignSpaceEvents
Fit a convex hull around the qualification data.
Requires :mod:scipy.spatial.ConvexHull. The hull captures
correlation between CPPs that a per-axis box cannot, at the cost
of needing len(cpps) + 1 non-degenerate qualification points.
| Type | Description |
|---|---|
DesignSpaceEvents | self for chaining. |
| Type | Description |
|---|---|
ValueError | Too few points, or points that span no volume (a constant parameter, collinear points). |
detect_excursions
detect_excursions(operation_df: pd.DataFrame) -> pd.DataFrame
Find contiguous intervals where operation leaves the design space.
| Name | Type | Description | Default |
|---|---|---|---|
operation_df | DataFrame | Long-form signal DataFrame containing all CPP signals; only the configured cpp_uuids are used. | required |
| Type | Description |
|---|---|
DataFrame | Interval-shape DataFrame with columns: start, end, |
DataFrame | duration_seconds, uuid, excursion_mode |
DataFrame | ("box" / "hull"). |
boundary_proximity
boundary_proximity(
operation_df: pd.DataFrame, warn_margin: float = 0.1
) -> pd.DataFrame
Emit point events for samples within warn_margin of the boundary.
Only supported for the fit_box mode -- a convex hull's
boundary distance is more expensive to compute per facet and is
not in scope for this detector. Call :meth:detect_excursions
for hull-fitted spaces.
| Name | Type | Description | Default |
|---|---|---|---|
operation_df | DataFrame | Long-form signal DataFrame. | required |
warn_margin | float | Normalized distance threshold (fraction of the axis span). A sample is reported when its closest axis margin is below this value while still inside the box. | 0.1 |
| Type | Description |
|---|---|
DataFrame | Point-shape DataFrame: systime, uuid, |
DataFrame | signed_margin, closest_axis. |