Skip to main content
Version: 0.0.98

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).

Classes
NameDescription
DesignSpaceEventsFit and monitor a multivariate qualified operating window.

DesignSpaceEvents​

classsource
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)
Functions
NameDescription
fit_boxFit per-axis bounds from the qualification data.
fit_hullFit a convex hull around the qualification data.
detect_excursionsFind contiguous intervals where operation leaves the design space.
boundary_proximityEmit point events for samples within warn_margin of the boundary.
Parameters
NameTypeDescriptionDefault
dataframeDataFrameQualification frame the operating window is fitted on.required
cpp_uuidslist[str]UUIDs of the critical process parameters (at least two; use :class:ProcessWindowEvents for one).required
event_uuidstrUUID stamped on emitted events.'dev:design_space'
value_columnstrColumn holding the signal values.'value_double'
time_columnstrTimestamp column.'systime'

fit_box​

methodsource
fit_box(quantiles: tuple[float, float] = (0.05, 0.95)) -> DesignSpaceEvents

Fit per-axis bounds from the qualification data.

Parameters
NameTypeDescriptionDefault
quantilestuple[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)
Returns
TypeDescription
DesignSpaceEventsself to allow DesignSpaceEvents(...).fit_box() chaining.

fit_hull​

methodsource
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.

Returns
TypeDescription
DesignSpaceEventsself for chaining.
Raises
TypeDescription
ValueErrorToo few points, or points that span no volume (a constant parameter, collinear points).

detect_excursions​

methodsource
detect_excursions(operation_df: pd.DataFrame) -> pd.DataFrame

Find contiguous intervals where operation leaves the design space.

Parameters
NameTypeDescriptionDefault
operation_dfDataFrameLong-form signal DataFrame containing all CPP signals; only the configured cpp_uuids are used.required
Returns
TypeDescription
DataFrameInterval-shape DataFrame with columns: start, end,
DataFrameduration_seconds, uuid, excursion_mode
DataFrame("box" / "hull").

boundary_proximity​

methodsource
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.

Parameters
NameTypeDescriptionDefault
operation_dfDataFrameLong-form signal DataFrame.required
warn_marginfloatNormalized 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
Returns
TypeDescription
DataFramePoint-shape DataFrame: systime, uuid,
DataFramesigned_margin, closest_axis.