Statistical process control primitives for manufacturing quality data.
type MaybeMeasurement = Double?pub(all) enum CapabilityResult {
CapabilityOk(Capability)
CapabilityInvalidInput(message~ : String)
} derive(Debug)pub(all) enum ChartResult {
ChartOk(ControlChart)
ChartInvalidInput(message~ : String)
} derive(Debug)pub(all) struct CleanResult {
values : Array[Double]
original_count : Int
removed : Int
replaced : Int
issues : Array[CleanIssue]
} derive(ToJson, Debug)pub(all) struct ControlChart {
kind : String
center : Double
points : Array[ChartPoint]
} derive(ToJson, Debug)fn ControlChart::cusum(values : Array[Double], target~ : Double, allowance~ : Double, decision~ : Double) -> ChartResultfn ControlChart::ewma(values : Array[Double], lambda~ : Double, initial~ : Double, sigma~ : Double) -> ChartResultpub struct DashboardSnapshot {
name : String
generated_at : String
cards : Array[DashboardCard]
alerts : Int
score : Double
} derive(ToJson, Debug)pub(all) struct LotFeature {
identity : LotIdentity
feature : String
values : Array[Double]
missing : Int
stations : Array[String]
} derive(ToJson, Debug)fn LotIdentity::new(lot~ : String, product~ : String, revision~ : String, line~ : String, shift~ : String, start_window~ : String, end_window~ : String) -> LotIdentityfn MaintenanceRecord::new(asset~ : String, event~ : String, timestamp~ : String, runtime_hours~ : Double, severity~ : Int, note~ : String) -> MaintenanceRecordpub(all) struct MeasurementEvent {
identity : LotIdentity
station : String
feature : String
value : Double?
sequence : Int
accepted : Bool
} derive(ToJson, Debug)fn MeasurementEvent::new(identity~ : LotIdentity, station~ : String, feature~ : String, value~ : Double?, sequence~ : Int) -> MeasurementEventfn MeasurementMatrix::new(rows~ : Array[Array[Double]], feature_names~ : Array[String]) -> MeasurementMatrixfn ProcessScenario::new(name~ : String, center~ : Double, deviation~ : Double, lower~ : Double?, upper~ : Double?, drift~ : Double, outlier_probability~ : Double, seed~ : Int) -> ProcessScenariopub(all) struct QualityAlert {
severity : AlertSeverity
code : String
message : String
index : Int
value : Double?
} derive(ToJson, Debug)pub(all) struct QualityReport {
summary : Summary
capability : Capability?
chart : ControlChart?
violations : Array[RuleViolation]
} derive(ToJson, Debug)pub(all) struct QualityWindow {
id : String
values : Array[Double]
specification : Specification?
} derive(ToJson, Debug)fn QualityWindow::new(id~ : String, values~ : Array[Double], specification~ : Specification?) -> QualityWindowpub(all) struct ReportDocument {
title : String
generated_at : String
sections : Array[ReportSection]
warnings : Array[String]
} derive(ToJson, Debug)fn ReportDocument::add_section(self : ReportDocument, title~ : String, lines~ : Array[String]) -> Unitpub(all) enum ReportResult {
ReportOk(QualityReport)
ReportInvalidInput(message~ : String)
} derive(Debug)pub struct SamplingPlan {
sampling_method : SamplingMethod
population : Int
requested : Int
seed : Int
strata : Array[Int]
} derive(Debug)pub(all) struct StreamMonitor {
policy : StreamPolicy
accumulator : StreamAccumulator
recent : MeasurementRing
ewma : EWMAStream
cusum : CUSUMStream
} derive(ToJson, Debug)fn StreamPolicy::with_cusum(self : StreamPolicy, allowance : Double, decision : Double) -> StreamPolicyfn ToolLifePoint::new(tool~ : String, runtime_hours~ : Double, wear~ : Double, threshold~ : Double) -> ToolLifePointfn add_benchmark_section(document : ReportDocument, sample_count : Int, elapsed_ms : Double) -> Unitfn append_feature(matrix : MeasurementMatrix, values : Array[Double], name : String) -> MeasurementMatrix?fn audit_event(event_id~ : String, lot_id~ : String, actor~ : String, action~ : String, timestamp~ : String, passed~ : Bool, evidence~ : String) -> AuditEventfn backtest_forecast(values : Array[Double], strategy : ForecastStrategy, minimum_history : Int) -> Array[BacktestPoint]fn capability_confidence_margin(deviation : Double, sample_count : Int) -> Doublefn capability_extended(mean~ : Double, deviation~ : Double, lower~ : Double, upper~ : Double, target~ : Double, threshold~ : Double) -> CapabilityExtendedfn card_status_from_gap(gap : Double, warning : Double, critical : Double) -> Stringfn category_delta(first : Array[CategoryCount], second : Array[CategoryCount]) -> Array[CategoryCount]fn choose_forecast_strategy(values : Array[Double], strategies : Array[ForecastStrategy], minimum_history : Int) -> ForecastStrategy?fn compare_stations(events : Array[MeasurementEvent], feature : String, threshold~ : Double) -> Array[StationComparison]fn compare_windows(previous : QualityWindow, current : QualityWindow, threshold : Double) -> QualityAlert?fn complete_work_order(order : QualityWorkOrder, actual_hours : Double, evidence_count : Int) -> QualityWorkOrderfn contract_version_compatible(old_version : String, new_version : String) -> Boolfn count_component_failures(matrix : MeasurementMatrix, lower : Array[Double], upper : Array[Double]) -> Intfn dashboard_card(key~ : String, title~ : String, value~ : Double, target~ : Double, unit~ : String, trend~ : Int, status~ : String) -> DashboardCardfn data_contract(name~ : String, required_fields~ : Array[String], minimum_rows~ : Int, maximum_missing_rate~ : Double, unique_key~ : String, version~ : String) -> DataContractfn defect_count_error(expected : Int, observed : Int) -> Intfn denormalize_range(value : Double, lower : Double, upper : Double) -> Doublefn detect_western_electric(values : Array[Double], mean~ : Double, sigma~ : Double) -> Array[RuleViolation]fn diagnose_process(values : Array[Double], baseline : Double, shift_tolerance : Double, variance_limit : Double) -> DiagnosticResultfn distance_alarms(matrix : MeasurementMatrix, center : Array[Double], threshold~ : Double) -> Array[MultivariateAlarm]?fn distance_from_interval(value : Double, lower : Double, upper : Double) -> Doublefn drift_score(values : Array[Double], baseline : Baseline, threshold~ : Double) -> Array[DriftPoint]fn failure_mode(id~ : String, process~ : String, cause~ : String, effect~ : String, severity~ : Int, occurrence~ : Int, detection~ : Int, owner~ : String, mitigation~ : String) -> FailureModefn filter_shifted_windows(windows : Array[QualityWindow], lower : Double, upper : Double) -> Array[QualityWindow]fn finite_population_sample(population~ : Int, confidence_z~ : Double, proportion~ : Double, margin~ : Double) -> Intfn forecast_with(values : Array[Double], strategy : ForecastStrategy, horizon : Int) -> ForecastResult?fn gauge_study(readings~ : Array[Double], reference~ : Double, tolerance~ : Double, resolution~ : Double) -> GaugeStudyfn increased_categories(first : Array[CategoryCount], second : Array[CategoryCount]) -> Array[CategoryCount]fn linear_interpolate(x : Double, x0 : Double, y0 : Double, x1 : Double, y1 : Double) -> Doublefn lot_feature_reports(events : Array[MeasurementEvent], specification : Specification?) -> Array[LotFeatureSummary]fn maintenance_plan(asset_id~ : String, interval_days~ : Int, last_service_day~ : Int, runtime_hours~ : Double, runtime_limit~ : Double, open_actions~ : Int) -> MaintenancePlanfn material_lot(material_id~ : String, lot_id~ : String, quantity~ : Double, lower_limit~ : Double, upper_limit~ : Double) -> MaterialLotfn measurement_system_rating(ndc_value : Double, grr : Double) -> Stringfn merge_event_streams(first : Array[MeasurementEvent], second : Array[MeasurementEvent]) -> Array[MeasurementEvent]fn one_sided_capability(mean~ : Double, deviation~ : Double, limit~ : Double, upper~ : Bool) -> Doublefn quality_metric(key~ : String, value~ : Double, unit~ : String, target~ : Double, lower_is_better~ : Bool) -> QualityMetricfn quality_policy(name~ : String, lower_limit~ : Double, upper_limit~ : Double, warning_margin~ : Double, critical_margin~ : Double, required_samples~ : Int) -> QualityPolicyfn quality_work_order(order_id~ : String, lot_id~ : String, title~ : String, owner~ : String, priority~ : Int, due_day~ : Int, estimated_hours~ : Double) -> QualityWorkOrderfn record_service(plan : MaintenancePlan, service_day : Int, runtime_hours : Double) -> MaintenancePlanfn release_decision(events : Array[MeasurementEvent], minimum_features~ : Int, minimum_measurements~ : Int) -> ReleaseDecisionfn release_gate(name~ : String, required_checks~ : Int, passed_checks~ : Int, open_alerts~ : Int, critical_alerts~ : Int, evidence_count~ : Int, minimum_score~ : Double) -> ReleaseGatefn reliability_summary(records : Array[MaintenanceRecord], asset : String, severe_threshold~ : Int) -> ReliabilitySummaryfn required_sample_size(confidence_z~ : Double, proportion~ : Double, margin~ : Double) -> Intfn safe_divide(numerator : Double, denominator : Double, fallback : Double) -> Doublefn sampling_plan(sampling_method~ : SamplingMethod, population~ : Int, requested~ : Int, seed~ : Int) -> SamplingPlanfn select_rows(matrix : MeasurementMatrix, alarms : Array[MultivariateAlarm], keep_alarms : Bool) -> MeasurementMatrixfn simulate_comparison(scenario : ProcessScenario, count : Int) -> (Array[SimulatedPoint], Array[SimulatedPoint])fn simulated_noise(seed : Int) -> Doublefn simulated_subgroups(scenario : ProcessScenario, count : Int, width : Int) -> Array[Array[Double]]?fn simulation_delta(first : Array[SimulatedPoint], second : Array[SimulatedPoint]) -> Array[Double]?fn sort_maintenance_plans(plans : Array[MaintenancePlan], current_day : Int) -> Array[MaintenancePlan]fn stage(name~ : String, duration_hours~ : Double, required_station~ : String, sequence~ : Int) -> ProductionStagefn station_capacity(station~ : String, available_hours~ : Double, planned_hours~ : Double, operators~ : Int) -> StationCapacityfn summarize_lot_features(features : Array[LotFeature], specification : Specification?) -> Array[LotFeatureSummary]fn summarize_simulation(scenario : ProcessScenario, points : Array[SimulatedPoint]) -> SimulationSummaryfn validate_contract(contract : DataContract, fields : Array[String], row_count : Int, missing_cells : Int, total_cells : Int, keys : Array[String]) -> ContractResultfn windows_from_values(values : Array[Double], width : Int, specification? : Specification) -> Array[QualityWindow]?fn work_orders_for_lot(orders : Array[QualityWorkOrder], lot_id : String) -> Array[QualityWorkOrder]Install
Download zipStatistical process control primitives for manufacturing quality data.