design_space
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 characterisation 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).
DesignSpaceEvents ¤
DesignSpaceEvents(
dataframe: DataFrame,
cpp_uuids: list[str],
*,
event_uuid: str = "dev:design_space",
value_column: str = "value_double",
time_column: str = "systime"
)
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)
fit_box ¤
fit_box(
quantiles: tuple[float, float] = (0.05, 0.95)
) -> DesignSpaceEvents
Fit per-axis bounds from the qualification data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantiles
|
tuple[float, float]
|
|
(0.05, 0.95)
|
Returns:
| Type | Description |
|---|---|
DesignSpaceEvents
|
|
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.
Returns:
| Type | Description |
|---|---|
DesignSpaceEvents
|
|
detect_excursions ¤
detect_excursions(operation_df: DataFrame) -> pd.DataFrame
Find contiguous intervals where operation leaves the design space.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
operation_df
|
DataFrame
|
Long-form signal DataFrame containing all CPP
signals; only the configured |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
Interval-shape DataFrame with columns: |
DataFrame
|
|
DataFrame
|
( |
boundary_proximity ¤
boundary_proximity(
operation_df: 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:
| Name | Type | Description | Default |
|---|---|---|---|
operation_df
|
DataFrame
|
Long-form signal DataFrame. |
required |
warn_margin
|
float
|
Normalised 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:
| Type | Description |
|---|---|
DataFrame
|
Point-shape DataFrame: |
DataFrame
|
|