@wafertools/wafermap 0.39.0 → 0.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -3
- package/README.md +2 -2
- package/dist/packages/canvas-adapter/charts/commonality.js +4 -1
- package/dist/packages/canvas-adapter/charts/plotChart.d.ts +10 -2
- package/dist/packages/canvas-adapter/charts/plotChart.js +1 -1
- package/dist/packages/canvas-adapter/charts/regionYieldDiagram.js +1 -1
- package/dist/packages/canvas-adapter/charts/sweep.js +1 -1
- package/dist/packages/canvas-adapter/dataTab.d.ts +12 -6
- package/dist/packages/canvas-adapter/dataTab.js +1 -1
- package/dist/packages/canvas-adapter/drilldown.d.ts +1 -1
- package/dist/packages/canvas-adapter/drilldown.js +1 -1
- package/dist/packages/canvas-adapter/filterButton.d.ts +2 -0
- package/dist/packages/canvas-adapter/filterButton.js +1 -1
- package/dist/packages/canvas-adapter/identityHeader.js +1 -1
- package/dist/packages/canvas-adapter/insightsTab.d.ts +9 -4
- package/dist/packages/canvas-adapter/insightsTab.js +1 -1
- package/dist/packages/canvas-adapter/openWaferMode.d.ts +7 -0
- package/dist/packages/canvas-adapter/openWaferMode.js +1 -0
- package/dist/packages/canvas-adapter/plotTab.d.ts +1 -1
- package/dist/packages/canvas-adapter/plotTab.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferGallery.js +1 -1
- package/dist/packages/canvas-adapter/renderWaferMap.js +1 -1
- package/dist/packages/canvas-adapter/summaryPanel.d.ts +2 -2
- package/dist/packages/canvas-adapter/summaryPanel.js +4 -4
- package/dist/packages/canvas-adapter/sweepEditor.js +1 -1
- package/dist/packages/canvas-adapter/toCanvas.d.ts +1 -0
- package/dist/packages/canvas-adapter/toCanvas.js +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.d.ts +1 -1
- package/dist/packages/canvas-adapter/userGuideHtml.js +61 -38
- package/dist/packages/canvas-adapter/version.d.ts +2 -2
- package/dist/packages/canvas-adapter/version.js +1 -1
- package/dist/packages/canvas-adapter/virtualTable.d.ts +2 -1
- package/dist/packages/canvas-adapter/virtualTable.js +1 -1
- package/dist/packages/core/compact.js +2 -2
- package/dist/packages/core/dieTable.js +1 -1
- package/dist/packages/renderer/buildView.js +1 -1
- package/dist/packages/renderer/fmt.d.ts +2 -0
- package/dist/packages/renderer/fmt.js +1 -1
- package/dist/packages/stats/commonality.d.ts +38 -5
- package/dist/packages/stats/commonality.js +1 -1
- package/dist/packages/stats/dieRegions.d.ts +2 -0
- package/dist/packages/stats/dieRegions.js +1 -1
- package/dist/packages/stats/examplePicks.d.ts +6 -0
- package/dist/packages/stats/examplePicks.js +1 -1
- package/dist/packages/stats/groupEffects.d.ts +74 -0
- package/dist/packages/stats/groupEffects.js +1 -0
- package/dist/packages/stats/plotData.d.ts +7 -2
- package/dist/packages/stats/plotData.js +1 -1
- package/dist/packages/stats/renderFindingsReport.js +1 -1
- package/dist/packages/stats/renderSummaryReport.js +7 -7
- package/dist/packages/stats/reportHtml.js +18 -13
- package/dist/packages/stats/sweep.d.ts +3 -3
- package/dist/packages/stats/sweepXFromName.js +1 -1
- package/dist/packages/stats/synthesis.d.ts +21 -1
- package/dist/packages/stats/synthesis.js +1 -1
- package/package.json +1 -1
|
@@ -34,20 +34,35 @@ export interface CommonalityRow {
|
|
|
34
34
|
};
|
|
35
35
|
/** `worst` to `best` in percentage points, always positive. */
|
|
36
36
|
spread: number;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* The comparison the p and q come from, when the field was read after allowing for another (the strongest other field that
|
|
39
|
+
* explains the same measure): its groups' values less that field's group means. Absent when `comparison` is what was ranked.
|
|
40
|
+
* `comparison` always holds the measure's own means, so a row reads in percent whichever way it was ranked.
|
|
41
|
+
*/
|
|
42
|
+
adjusted?: GroupComparison;
|
|
43
|
+
/** The fields allowed for, when `adjusted` is set. */
|
|
44
|
+
allowedFor?: CommonalityField[];
|
|
45
|
+
/** Benjamini–Hochberg q of Welch's p (Kruskal–Wallis's where Welch cannot be computed) of `adjusted ?? comparison`, over every row. */
|
|
38
46
|
pAdjusted: number;
|
|
39
47
|
}
|
|
40
48
|
export interface CommonalityResult {
|
|
41
49
|
rows: CommonalityRow[];
|
|
42
|
-
/** Fields
|
|
50
|
+
/** Fields whose groups cannot be compared: fewer than two groups of two or more wafers, or nearly one group per wafer. */
|
|
43
51
|
untestable: CommonalityField[];
|
|
44
52
|
/** The fail bins compared, most dies first. */
|
|
45
53
|
bins: number[];
|
|
46
54
|
/**
|
|
47
|
-
*
|
|
48
|
-
* say which of
|
|
55
|
+
* Sets of fields that divide the wafers identically (every group of one is a group of the other), each of two or more
|
|
56
|
+
* fields: the wafers cannot say which of them it is.
|
|
49
57
|
*/
|
|
50
|
-
|
|
58
|
+
tied: CommonalityField[][];
|
|
59
|
+
/** Sets of fields that nearly match without being identical: how many of the wafers they put in matching groups. */
|
|
60
|
+
overlapping: Array<{
|
|
61
|
+
fields: CommonalityField[];
|
|
62
|
+
with: CommonalityField[];
|
|
63
|
+
agree: number;
|
|
64
|
+
of: number;
|
|
65
|
+
}>;
|
|
51
66
|
}
|
|
52
67
|
/** How many of the most common fail bins are compared, besides yield. */
|
|
53
68
|
export declare const COMMONALITY_BINS = 5;
|
|
@@ -59,4 +74,22 @@ export declare const COMMONALITY_BINS = 5;
|
|
|
59
74
|
export declare function rankCommonality(wafers: readonly CommonalityWafer[], fields: readonly CommonalityField[], curation?: Record<string, FacetCuration>): CommonalityResult;
|
|
60
75
|
/** A measure as the reader names it: "Yield", "Hard bin 2". */
|
|
61
76
|
export declare const measureLabel: (m: CommonalityMeasure, binName?: (bin: number) => string | undefined) => string;
|
|
77
|
+
/** How plainly a row's groups differ, from its q: the word the card shows in place of the p-values. */
|
|
78
|
+
export type CommonalityConfidence = 'clear' | 'possible' | 'none';
|
|
79
|
+
/** q under 0.05 is clear, under 0.2 possible; a q that could not be computed is not clear. */
|
|
80
|
+
export declare const commonalityConfidence: (q: number) => CommonalityConfidence;
|
|
81
|
+
export declare const CONFIDENCE_LABEL: Record<CommonalityConfidence, string>;
|
|
82
|
+
/** One field with its strongest measure, and its other measures behind it. */
|
|
83
|
+
export interface CommonalityFieldRows {
|
|
84
|
+
field: CommonalityField;
|
|
85
|
+
/** Every field that gives the same groups of wafers, `field` first: one row stands for all of them. */
|
|
86
|
+
fields: CommonalityField[];
|
|
87
|
+
primary: CommonalityRow;
|
|
88
|
+
others: CommonalityRow[];
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The rows as one entry per field: yield leads unless a fail bin is clearer, then the measure with the lowest q, the field's other measures follow it.
|
|
92
|
+
* Fields are ordered clear, then possible, then not clear, and within each by the size of the leading difference.
|
|
93
|
+
*/
|
|
94
|
+
export declare function groupCommonalityRows(rows: readonly CommonalityRow[], tied?: readonly (readonly CommonalityField[])[]): CommonalityFieldRows[];
|
|
62
95
|
//# sourceMappingURL=commonality.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{diePassStatus as
|
|
1
|
+
import{diePassStatus as _,isYieldEligibleDie as B}from"../core/dies.js";import{benjaminiHochberg as $}from"./math.js";import{compareGroups as I,comparisonP as D}from"./groupCompare.js";import{adjustedFits as G,comparableGrouping as H,mergePartitions as T,overlapping as V,partitionId as q}from"./groupEffects.js";import{facetValueOf as z}from"./facets.js";import{yieldCounts as J}from"./yield.js";import{compareNatural as K}from"../core/utils.js";export const COMMONALITY_BINS=5;function Q(s,f){let c=0,d=0;for(const p of s.dies)!B(p)||p.hbin===void 0||(d++,p.hbin===f&&c++);return d?c/d*100:NaN}export function rankCommonality(s,f,c){const d=s.map(e=>{const{pass:o,total:i}=J(e.dies,e.passBins);return i?o/i*100:NaN}),p=new Map;for(const e of s){const o=new Set(e.passBins);for(const i of e.dies)B(i)&&i.hbin!==void 0&&_(i,o)===!1&&p.set(i.hbin,(p.get(i.hbin)??0)+1)}const k=[...p].sort((e,o)=>o[1]-e[1]||e[0]-o[0]).slice(0,COMMONALITY_BINS).map(([e])=>e),b=new Map(k.map(e=>[e,s.map(o=>Q(o,e))])),t=[],a=[],y=[];for(const e of f){const o=s.map(r=>z(r.metadata,e.key,c)),i=[...new Set(o.filter(r=>r!==void 0))].sort(K);if(!H(o)){a.push(e);continue}y.push({field:e,value:o,keys:i})}const m=T(y.map(e=>({key:e.field.key,groupOf:e.value}))),l=new Map(f.map(e=>[e.key,e])),L=[[{kind:"yield"},d],...k.map(e=>[{kind:"bin",bin:e},b.get(e)])];for(const[e,o]of L){const i=new Map(G(o.map(r=>Number.isFinite(r)?r:void 0),m).map(r=>[r.partition.id,r]));for(const{field:r,value:w,keys:E}of y){const N=I(E.map(n=>({key:n,values:o.filter((u,O)=>w[O]===n)}))),F=N.groups.filter(n=>!N.tooSmall.includes(n.key)&&Number.isFinite(n.mean));if(F.length<2)continue;const j=F.reduce((n,u)=>u.mean<n.mean?u:n),C=F.reduce((n,u)=>u.mean>n.mean?u:n),[P,S]=e.kind==="yield"?[j,C]:[C,j],h=i.get(q(w));let g=h?.allowedFor?I(E.map(n=>({key:n,values:h.used.filter((u,O)=>w[O]===n&&u!==void 0)}))):void 0;g?.welch&&h?.fitted&&(g={...g,welch:{...g.welch,p:h.fitted.p}}),t.push({field:r,measure:e,comparison:N,worst:{key:P.key,mean:P.mean},best:{key:S.key,mean:S.mean},spread:C.mean-j.mean,pAdjusted:NaN,...g&&h?.allowedFor?{adjusted:g,allowedFor:h.allowedFor.map(n=>l.get(n)??{key:n,label:n})}:{}})}}const x=e=>D(e.adjusted??e.comparison),M=t.filter(e=>Number.isFinite(x(e))),R=$(M.map(x));M.forEach((e,o)=>{e.pAdjusted=R[o]});const v=e=>Number.isFinite(e.pAdjusted)?e.pAdjusted:1/0;t.sort((e,o)=>v(e)-v(o)||o.spread-e.spread);const Y=m.filter(e=>e.keys.length>1).map(e=>e.keys.map(o=>l.get(o))),A=[];return m.forEach((e,o)=>{for(const i of V(e,m))m.indexOf(i.partition)>o&&A.push({fields:e.keys.map(r=>l.get(r)),with:i.partition.keys.map(r=>l.get(r)),agree:i.agree,of:i.of})}),{rows:t,untestable:a,bins:k,tied:Y,overlapping:A}}export const measureLabel=(s,f)=>s.kind==="yield"?"Yield":`Hard bin ${s.bin}${f?.(s.bin)?` (${f(s.bin)})`:""}`,commonalityConfidence=s=>s<.05?"clear":s<.2?"possible":"none",CONFIDENCE_LABEL={clear:"Clear",possible:"Possible",none:"Not clear"};export function groupCommonalityRows(s,f=[]){const c=new Map;for(const t of s)(c.get(t.field.key)??c.set(t.field.key,[]).get(t.field.key)).push(t);const d=t=>["clear","possible","none"].indexOf(commonalityConfidence(t.pAdjusted)),p=new Map;for(const t of f)for(const a of t)p.set(a.key,t);const k=new Set,b=[];for(const t of c.values()){const a=p.get(t[0].field.key);if(a){if(k.has(a))continue;k.add(a)}const y=t.find(l=>l.measure.kind==="yield"),m=y&&d(y)<=d(t[0])?y:t[0];b.push({field:t[0].field,fields:a?[t[0].field,...a.filter(l=>l.key!==t[0].field.key)]:[t[0].field],primary:m,others:t.filter(l=>l!==m)})}return b.sort((t,a)=>d(t.primary)-d(a.primary)||a.primary.spread-t.primary.spread)}
|
|
@@ -39,6 +39,8 @@ export interface DieRegionDef {
|
|
|
39
39
|
export declare function dieRadialPosition(d: Die, ctx: {
|
|
40
40
|
wafer?: Wafer;
|
|
41
41
|
}): number | undefined;
|
|
42
|
+
/** The value a plot's Ring field gives ring `ring`: the one name a ring condition in a plot spec must use. */
|
|
43
|
+
export declare const ringPlotValue: (ring: number) => string;
|
|
42
44
|
export declare const DIE_REGIONS: Record<DieRegionKey, DieRegionDef>;
|
|
43
45
|
/** The regions this population offers, in the order they are listed. */
|
|
44
46
|
export declare function availableRegions(ctx: RegionContext, anyPositioned: boolean): DieRegionDef[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{classifyDie as c}from"../core/classify.js";import{getReticleCell as f,getReticleShot as d}from"../core/reticle.js";import{requireRingCount as g}from"../core/ringCount.js";import{hasPosition as a}from"../core/dies.js";import{getRingLabel as s,radialPosition as p}from"../core/classify.js";export const DIE_REGION_KEYS=["ring","quadrant","reticleCell","reticleShot"];function m(e,r){return!!r.wafer&&a(e)&&e.physX!==void 0&&e.physY!==void 0}export function dieRadialPosition(e,r){return r.wafer&&a(e)&&e.physX!==void 0&&e.physY!==void 0?p(e,r.wafer):void 0}function i(e,r,n){if(m(e,r))return c(e,r.wafer,{ringCount:g(r,n)})}const
|
|
1
|
+
import{classifyDie as c}from"../core/classify.js";import{getReticleCell as f,getReticleShot as d}from"../core/reticle.js";import{requireRingCount as g}from"../core/ringCount.js";import{hasPosition as a}from"../core/dies.js";import{getRingLabel as s,radialPosition as p}from"../core/classify.js";export const DIE_REGION_KEYS=["ring","quadrant","reticleCell","reticleShot"];function m(e,r){return!!r.wafer&&a(e)&&e.physX!==void 0&&e.physY!==void 0}export function dieRadialPosition(e,r){return r.wafer&&a(e)&&e.physX!==void 0&&e.physY!==void 0?p(e,r.wafer):void 0}function i(e,r,n){if(m(e,r))return c(e,r.wafer,{ringCount:g(r,n)})}const t=new Map([["quadrant:NE",0],["quadrant:NW",1],["quadrant:SE",2],["quadrant:SW",3]]);function l(e,r){const n=r.reticle??r.wafer?.reticle;return n&&a(e)?f(e,n):void 0}export const ringPlotValue=e=>`Ring ${e}`,DIE_REGIONS={ring:{key:"ring",label:"Ring",available:(e,r)=>!!e.wafer&&r,valueOf:(e,r)=>{const n=i(e,r,"a ring of a plot");return n?ringPlotValue(n.ring):void 0},rawOf:(e,r)=>{const n=i(e,r,"a ring of a plot");return n?String(n.ring):void 0},grouping:{family:"ring",place:(e,r)=>{const n=i(e,r,"a ring");return n?{key:`ring:${n.ring}`,label:s(n.ring,r.ringCount)}:void 0},order:(e,r)=>e.localeCompare(r)}},quadrant:{key:"quadrant",label:"Quadrant",available:(e,r)=>!!e.wafer&&r,valueOf:(e,r)=>i(e,r,"a quadrant of a plot")?.quadrant,grouping:{family:"quadrant",place:(e,r)=>{const n=i(e,r,"a quadrant");return n?{key:`quadrant:${n.quadrant}`,label:n.quadrant}:void 0},order:(e,r)=>(t.get(e)??4)-(t.get(r)??4)}},reticleCell:{key:"reticleCell",label:"Reticle cell",available:(e,r)=>!!(e.reticle??e.wafer?.reticle)&&r,valueOf:(e,r)=>{const n=l(e,r);return n?`Reticle cell (${n.column}, ${n.row})`:void 0},grouping:{family:"reticle-position",place:(e,r)=>{const n=l(e,r);return n?{key:`reticle-position:cell:${n.column},${n.row}`,label:`Reticle cell (${n.column}, ${n.row})`}:void 0},order:(e,r)=>e.localeCompare(r,void 0,{numeric:!0})}},reticleShot:{key:"reticleShot",label:"Reticle shot",available:(e,r)=>!!(e.reticle??e.wafer?.reticle)&&r,valueOf:(e,r)=>{const n=r.reticle??r.wafer?.reticle;if(!n||!a(e))return;const{column:o,row:u}=d(e,n);return`Reticle shot (${o}, ${u})`}}};export function availableRegions(e,r){return DIE_REGION_KEYS.map(n=>DIE_REGIONS[n]).filter(n=>n.available(e,r))}
|
|
@@ -12,6 +12,12 @@ export interface ExamplePicks {
|
|
|
12
12
|
partner?: number;
|
|
13
13
|
/** The lot field whose values best separate the wafers' means of the lead test. */
|
|
14
14
|
splitKey?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The lot fields whose groups differ in yield, strongest set of groups first. Fields that group the wafers identically (a
|
|
17
|
+
* tester and the handler docked to it) are listed together, so each is offered; a set is read after allowing for the
|
|
18
|
+
* strongest other one, as in What stands out. Absent when no field divides the wafers' yield.
|
|
19
|
+
*/
|
|
20
|
+
yieldKeys?: string[];
|
|
15
21
|
}
|
|
16
22
|
/**
|
|
17
23
|
* `tests` in order of how much each has to show: the share of its variation that lies between wafers (a shift, a drift,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{testValuesReader as
|
|
1
|
+
import{testValuesReader as T}from"../core/dieTable.js";import{facetValueOf as j}from"./facets.js";import{dieRadialPosition as B}from"./dieRegions.js";import{pearsonOfPairs as I}from"./correlation.js";import{benjaminiHochberg as U,sampleVariance as X}from"./math.js";import{adjustedFits as v,comparableGrouping as C,mergePartitions as D}from"./groupEffects.js";import{yieldCounts as H}from"./yield.js";const L=4e3,O=60,q=20,Q=.1,x=r=>Math.sqrt(X(r));function P(r,c){const l=Math.min(r.length,c.length);return l<q?0:I(Array.from({length:l},(u,a)=>({x:r[a],y:c[a]}))).r??0}export function pickExamples(r,c,l,u){const a=c.slice(0,O),h=r.reduce((e,t)=>e+t.dies.length,0);if(a.length===0||h===0)return{ranked:[...c],...N(r,l,u)};const w=Math.max(1,Math.ceil(h/L)),b=T(a),g=new Float64Array(a.length),n=a.map(()=>[]),f=[],d=[],i=r.map(()=>[]);let M=0;r.forEach((e,t)=>{for(const o of e.dies){if(M++%w)continue;b(o,g);const s=f.length;f.push(t),i[t].push(s),d.push(B(o,{wafer:e.wafer})??NaN);for(let p=0;p<a.length;p++)n[p].push(g[p])}});const S=e=>n[e].reduce((t,o,s)=>(Number.isFinite(o)&&t.push(s),t),[]),A=e=>i.map(t=>{const o=t.map(s=>n[e][s]).filter(Number.isFinite);return o.length>=3?o.reduce((s,p)=>s+p,0)/o.length:void 0}),_=a.map((e,t)=>{const o=S(t);if(o.length<q)return 0;if(r.length===1)return Math.abs(P(o.map(m=>n[t][m]),o.map(m=>d[m]))||0);const s=x(o.map(m=>n[t][m])),p=A(t).filter(m=>m!==void 0);return s>0&&p.length>=2?Math.min(1,x(p)/s):0}),k=a.map((e,t)=>t).sort((e,t)=>_[t]-_[e]||e-t),R=[...k.map(e=>a[e]),...c.slice(O)],y=k[0];if(_[y]<=0)return{ranked:[...c],...N(r,l,u)};let E,F=.3;const V=S(y);for(const e of k.slice(1)){const t=V.filter(s=>Number.isFinite(n[e][s])),o=Math.abs(P(t.map(s=>n[y][s]),t.map(s=>n[e][s])));o>F&&(F=o,E=a[e])}const G=N(r,l,u,A(y));return{ranked:R,...E!==void 0?{partner:E}:{},...G}}function N(r,c,l,u){if(r.length<4)return{};const a=D(c.map(n=>({key:n,groupOf:r.map(f=>j(f.metadata,n,l))})).filter(n=>C(n.groupOf)));if(a.length===0)return{};const h=n=>{const f=v(n,a).filter(i=>i.fitted),d=U(f.map(i=>i.fitted.p));return f.map((i,M)=>({f:i,q:d[M]})).filter(i=>i.q<Q).sort((i,M)=>i.f.fitted.p-M.f.fitted.p).map(i=>i.f.partition)},w=u?h(u)[0]?.keys[0]:void 0,b=r.map(n=>{const{pass:f,total:d}=H(n.dies,n.passBins);return d?f/d:void 0}),g=h(b).flatMap(n=>n.keys);return{...w?{splitKey:w}:{},...g.length?{yieldKeys:g}:{}}}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** The group each wafer is in on one field (undefined: no value for it). */
|
|
2
|
+
export type GroupOf = ReadonlyArray<string | undefined>;
|
|
3
|
+
/** A set of groups, and every field that puts the wafers in exactly those groups. */
|
|
4
|
+
export interface Partition {
|
|
5
|
+
/** Which wafers are together, whatever the groups are called: equal for fields that group the wafers identically. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The fields, in the order given; the first names the set. */
|
|
8
|
+
keys: string[];
|
|
9
|
+
groupOf: GroupOf;
|
|
10
|
+
}
|
|
11
|
+
/** The wafers grouped as a number per group in order of first appearance, so equal groupings compare equal whatever their labels. */
|
|
12
|
+
export declare function partitionId(groupOf: GroupOf): string;
|
|
13
|
+
/** The most groups a field may put `wafers` wafers in and still be compared: past it the field nearly names each wafer. */
|
|
14
|
+
export declare const maxGroups: (wafers: number) => number;
|
|
15
|
+
/**
|
|
16
|
+
* Whether a field's groups can be compared: two groups or more with two wafers or more each, and no more groups than
|
|
17
|
+
* {@link maxGroups}. Every surface that reads groups of wafers takes its fields through here, so a field is read by all of
|
|
18
|
+
* them or by none, and each set of groups is read after allowing for the same others.
|
|
19
|
+
*/
|
|
20
|
+
export declare function comparableGrouping(groupOf: GroupOf): boolean;
|
|
21
|
+
/** Fields that group the wafers identically are one partition. */
|
|
22
|
+
export declare function mergePartitions(fields: ReadonlyArray<{
|
|
23
|
+
key: string;
|
|
24
|
+
groupOf: GroupOf;
|
|
25
|
+
}>): Partition[];
|
|
26
|
+
/** Whether every group of `fine` lies inside one group of `coarse`: allowing for a finer set (a probe session) would remove the coarser one (its tester). */
|
|
27
|
+
export declare function nested(fine: GroupOf, coarse: GroupOf): boolean;
|
|
28
|
+
/** The wafers of each group that have a value, and the groups' comparison (undefined when it cannot be made). */
|
|
29
|
+
export interface GroupFit {
|
|
30
|
+
byGroup: Map<string, number[]>;
|
|
31
|
+
p: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* `lostDf`: degrees of freedom already spent estimating means that were taken out of `values` (see {@link adjustedFits}), so
|
|
35
|
+
* a difference read from what is left is judged on the wafers that remain free, not as if no mean had been estimated.
|
|
36
|
+
*/
|
|
37
|
+
export declare function fitGroups(values: ReadonlyArray<number | undefined>, groupOf: GroupOf, lostDf?: number): GroupFit | undefined;
|
|
38
|
+
/** The p below which another set of groups is allowed for before a set is read. */
|
|
39
|
+
export declare const ALLOW_FOR_P = 0.25;
|
|
40
|
+
/** One set of groups read against a measure. */
|
|
41
|
+
export interface AdjustedFit {
|
|
42
|
+
partition: Partition;
|
|
43
|
+
/** The values compared: the measure's own, or what is left of them after allowing for other sets of groups. */
|
|
44
|
+
used: Array<number | undefined>;
|
|
45
|
+
fitted?: GroupFit;
|
|
46
|
+
/** The first field of each set allowed for, when `used` is not the measure's own values. */
|
|
47
|
+
allowedFor?: string[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every partition read against `values`. Each is read after allowing for the strongest other set that explains the measure
|
|
51
|
+
* at all (a raw p under {@link ALLOW_FOR_P}) and does not sit inside it, and for every coarser set it divides, so a field
|
|
52
|
+
* another hides (a weak card on wafers that also differ by recipe) is still found, and a probe session is read beyond its
|
|
53
|
+
* card. A set read this way says which it allowed for.
|
|
54
|
+
*/
|
|
55
|
+
export declare function adjustedFits(values: ReadonlyArray<number | undefined>, partitions: readonly Partition[]): AdjustedFit[];
|
|
56
|
+
/** How closely two sets of groups agree: wafers in matching groups, and wafers compared. */
|
|
57
|
+
export interface Overlap {
|
|
58
|
+
agree: number;
|
|
59
|
+
of: number;
|
|
60
|
+
}
|
|
61
|
+
/** Overlaps this share of wafers or more, short of identical, is worth saying (a tester and an operator who mostly go together). */
|
|
62
|
+
export declare const MIN_OVERLAP_SHARE = 0.75;
|
|
63
|
+
/**
|
|
64
|
+
* The wafers two sets of groups put in matching groups, when they have the same number of groups and each group of one matches a
|
|
65
|
+
* different group of the other (its commonest partner). Undefined when they cannot be matched that way: different numbers of
|
|
66
|
+
* groups, or two groups with the same partner (one set nests inside the other, which is a different thing to say). Identical
|
|
67
|
+
* sets agree on every wafer; they are one partition (see {@link mergePartitions}) and not reported as an overlap.
|
|
68
|
+
*/
|
|
69
|
+
export declare function overlapOf(a: GroupOf, b: GroupOf): Overlap | undefined;
|
|
70
|
+
/** The sets among `partitions` that overlap `partition` without being identical to it, strongest first. */
|
|
71
|
+
export declare function overlapping(partition: Partition, partitions: readonly Partition[]): Array<{
|
|
72
|
+
partition: Partition;
|
|
73
|
+
} & Overlap>;
|
|
74
|
+
//# sourceMappingURL=groupEffects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{compareGroups as z}from"./groupCompare.js";import{fUpperTail as k,tTwoSided as x}from"./math.js";export function partitionId(i){const o=new Map;return i.map(t=>t===void 0?"-":String(o.get(t)??o.set(t,o.size).get(t))).join(",")}export const maxGroups=i=>Math.max(2,Math.floor(i/2));export function comparableGrouping(i){const o=new Map;for(const e of i)e!==void 0&&o.set(e,(o.get(e)??0)+1);let t=0;for(const e of o.values())e>=2&&t++;return t>=2&&o.size<=maxGroups(i.length)}export function mergePartitions(i){const o=new Map;for(const t of i){const e=partitionId(t.groupOf),n=o.get(e);n?n.keys.push(t.key):o.set(e,{id:e,keys:[t.key],groupOf:t.groupOf})}return[...o.values()]}export function nested(i,o){const t=new Map;return i.every((e,n)=>e===void 0||(t.has(e)?t.get(e)===o[n]:(t.set(e,o[n]),!0)))}export function fitGroups(i,o,t=0){const e=new Map;if(i.forEach((s,u)=>{const r=o[u];s===void 0||!Number.isFinite(s)||r===void 0||(e.get(r)??e.set(r,[]).get(r)).push(u)}),e.size<2)return;const n=z([...e].map(([s,u])=>({key:s,values:u.map(r=>i[r])})));let p=n.welch?.p??n.kruskal?.p;if(n.welch&&t>0){const s=n.welch.df2-t;p=s<1?1:n.welch.method==="welch-t"?x(n.welch.statistic,s):k(n.welch.statistic,n.welch.df1,s)}return p===void 0||!Number.isFinite(p)?void 0:{byGroup:e,p}}export const ALLOW_FOR_P=.25;function y(i,o){const t=overlapOf(i,o);return!!t&&t.agree/t.of>=MIN_OVERLAP_SHARE}export function adjustedFits(i,o){const t=o.map(n=>({partition:n,fitted:fitGroups(i,n.groupOf)})),e=t.filter(n=>n.fitted).sort((n,p)=>n.fitted.p-p.fitted.p);return t.map(n=>{const p=e.filter(f=>f.partition.id!==n.partition.id&&f.fitted.p<ALLOW_FOR_P&&!nested(f.partition.groupOf,n.partition.groupOf)&&!y(f.partition.groupOf,n.partition.groupOf)),s=p.filter(f=>nested(n.partition.groupOf,f.partition.groupOf)),u=p.find(f=>!nested(n.partition.groupOf,f.partition.groupOf)),r=[...u?[u]:[],...s];let a=[...i],d=n.fitted,h;if(r.length>0){let f=0;for(const g of r){f+=Math.max(0,(g.fitted?.byGroup.size??1)-1);const w=new Map;a.forEach((l,m)=>{const c=g.partition.groupOf[m];l!==void 0&&c!==void 0&&(w.get(c)??w.set(c,[]).get(c)).push(l)});const O=new Map([...w].map(([l,m])=>[l,m.reduce((c,M)=>c+M,0)/m.length]));a=a.map((l,m)=>{const c=g.partition.groupOf[m];return l===void 0||c===void 0?void 0:l-O.get(c)})}d=fitGroups(a,n.partition.groupOf,f)??n.fitted,d!==n.fitted&&(h=r.map(g=>g.partition.keys[0]))}return{partition:n.partition,used:d===n.fitted?[...i]:a,fitted:d,...h?{allowedFor:h}:{}}})}export const MIN_OVERLAP_SHARE=.75;export function overlapOf(i,o){const t=i.flatMap((r,a)=>r!==void 0&&o[a]!==void 0?[[r,o[a]]]:[]),e=new Set(t.map(r=>r[0])),n=new Set(t.map(r=>r[1]));if(t.length===0||e.size<2||e.size!==n.size)return;const p=new Map;for(const[r,a]of t){const d=p.get(r)??p.set(r,new Map).get(r);d.set(a,(d.get(a)??0)+1)}const s=new Map;let u=0;for(const[r,a]of p){const[d,h]=[...a].sort((f,g)=>g[1]-f[1]||(f[0]<g[0]?-1:1))[0];s.set(r,d),u+=h}return new Set(s.values()).size===e.size?{agree:u,of:t.length}:void 0}export function overlapping(i,o){return o.filter(t=>t.id!==i.id).flatMap(t=>{const e=overlapOf(i.groupOf,t.groupOf);return e&&e.agree<e.of&&e.agree/e.of>=MIN_OVERLAP_SHARE?[{partition:t,...e}]:[]}).sort((t,e)=>e.agree/e.of-t.agree/t.of)}
|
|
@@ -547,11 +547,16 @@ export declare function examplePlots(catalogue: readonly FieldOption[], waferCou
|
|
|
547
547
|
items: readonly PlotItem[];
|
|
548
548
|
ctx?: PlotContext;
|
|
549
549
|
}): PlotSpec[];
|
|
550
|
+
/**
|
|
551
|
+
* Whether a wafer opened from a plot opens on its bins: a plot of yield or of bins that names no test, as a yield bar does
|
|
552
|
+
* everywhere. A plot that names a test opens on it ({@link plotTestNumber}); any other leaves the map as it is.
|
|
553
|
+
*/
|
|
554
|
+
export declare function plotOpensBins(spec: PlotSpec): boolean;
|
|
550
555
|
/**
|
|
551
556
|
* The test a click on this plot should open a wafer on: the plot's own measurement, so the map shows the values the
|
|
552
557
|
* plot is about rather than the bins. A scatter takes its X (as the Insights scatter does), then its Y, then its
|
|
553
|
-
* colour; every other chart type its values. `undefined` when the plot has no test in it (yield against wafer order)
|
|
554
|
-
*
|
|
558
|
+
* colour; every other chart type its values. `undefined` when the plot has no test in it (yield against wafer order):
|
|
559
|
+
* {@link plotOpensBins} then says whether the wafer opens on its bins.
|
|
555
560
|
*/
|
|
556
561
|
export declare function plotTestNumber(spec: PlotSpec): number | undefined;
|
|
557
562
|
/**
|