@simtest-js/funnel 1.0.0-beta.11 → 1.0.0-beta.13
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/README.md +85 -0
- package/dist/index.d.ts +147 -12
- package/dist/index.js +47 -2
- package/dist/index.js.map +1 -1
- package/dist/wasm/simtest_funnel_wasm.d.ts +16 -1
- package/dist/wasm/simtest_funnel_wasm.js +1 -1
- package/dist/wasm/simtest_funnel_wasm_bg.js +88 -1
- package/dist/wasm/simtest_funnel_wasm_bg.wasm +0 -0
- package/dist/wasm/simtest_funnel_wasm_bg.wasm.d.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,87 @@ if (result.status === Status.Pass) {
|
|
|
41
41
|
returns a `CompareResult` whose `errorsY` array is **signed** — positive
|
|
42
42
|
above the upper bound, negative below the lower bound.
|
|
43
43
|
|
|
44
|
+
## Tolerances
|
|
45
|
+
|
|
46
|
+
A tolerance field that is omitted, `undefined` or `null` is "not
|
|
47
|
+
given". The given coefficients are resolved **per axis** by the Rust
|
|
48
|
+
core — the same rule as the Rust, Python and CLI front ends, so
|
|
49
|
+
identical inputs give identical verdicts everywhere:
|
|
50
|
+
|
|
51
|
+
- x axis: `atolx`, `ltolx`, `rtolx`; y axis: `atoly`, `ltoly`, `rtoly`.
|
|
52
|
+
- An axis with **no** coefficient given gets the default `rtol = 2e-3`
|
|
53
|
+
(other coefficients `0`).
|
|
54
|
+
- An axis with **at least one** coefficient given uses the given values
|
|
55
|
+
and `0` for the rest of that axis.
|
|
56
|
+
- An explicit `0` counts as given.
|
|
57
|
+
|
|
58
|
+
| You pass | Effective tolerances |
|
|
59
|
+
| ------------------------------------------- | ---------------------------------------- |
|
|
60
|
+
| no `options`, `{}`, `{ tolerances: {} }` | `rtolx = rtoly = 2e-3`, rest `0` |
|
|
61
|
+
| `{ tolerances: { atoly: 0.05 } }` | `atoly = 0.05`, `rtolx = 2e-3`, rest `0` |
|
|
62
|
+
| `{ tolerances: { atolx: 0, atoly: 0.05 } }` | `atoly = 0.05`, rest `0` |
|
|
63
|
+
|
|
64
|
+
`xRange` restricts the comparison to an x-window; each bound is optional
|
|
65
|
+
(omitted, `undefined` or `null` = unbounded), so `{ xRange: { lo: 0.5 } }`
|
|
66
|
+
compares `x >= 0.5`. Results report ranges as `ResolvedXRange` with both
|
|
67
|
+
bounds present (`-Infinity` / `Infinity` when unbounded).
|
|
68
|
+
|
|
69
|
+
`defaultOptions()` returns the six default values explicitly (passing
|
|
70
|
+
them is identical to omitting `options`), and `summarize()` echoes the
|
|
71
|
+
six resolved values (`ResolvedTolerances`).
|
|
72
|
+
|
|
73
|
+
## Violation summary
|
|
74
|
+
|
|
75
|
+
`summarize()` condenses an existing comparison into how much the given
|
|
76
|
+
tolerances were violated: violation intervals, the worst deviation with
|
|
77
|
+
the tube half-width at that x, and the share of test points and of the
|
|
78
|
+
compared x-span outside the tube. It is computed by the Rust core, so
|
|
79
|
+
the numbers match the Rust and Python APIs exactly.
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
import { compare, summarize } from '@simtest-js/funnel';
|
|
83
|
+
|
|
84
|
+
const options = { tolerances: { atoly: 0.005 } };
|
|
85
|
+
const result = compare(tRef, yRef, tRef, yTest, options);
|
|
86
|
+
const s = summarize(result, tRef, options); // same reference x and options
|
|
87
|
+
for (const iv of s.intervals) {
|
|
88
|
+
console.log(iv.startX, iv.endX, iv.direction, iv.worstDeviation);
|
|
89
|
+
}
|
|
90
|
+
console.log(s.worst, s.fractionOfPointsOutside, s.fractionOfSpanOutside);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Only test points inside the compared range (`xRange` intersected with
|
|
94
|
+
the reference x-extent) count. For validation statuses (e.g.
|
|
95
|
+
`NonMonotonic`) `worst`, `comparedRange` and both fractions are `null`.
|
|
96
|
+
|
|
97
|
+
## Downsampling for plots
|
|
98
|
+
|
|
99
|
+
`downsampleMinMax(x, y, buckets, pinnedX?)` reduces a long signal for
|
|
100
|
+
plotting or reporting. It is post-processing only: `compare()` and
|
|
101
|
+
`summarize()` always use the full signal. `createFunnelPlot()` does not
|
|
102
|
+
downsample; pass downsampled traces yourself if needed.
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
import { downsampleMinMax } from '@simtest-js/funnel';
|
|
106
|
+
|
|
107
|
+
const s = summarize(result, tRef, options);
|
|
108
|
+
const pins = s.intervals.map((iv) => iv.worstX); // keep every violation visible
|
|
109
|
+
const d = downsampleMinMax(tTest, yTest, 500, pins);
|
|
110
|
+
// d.x, d.y: Float64Array; d.indices: Uint32Array into the input
|
|
111
|
+
const errorsKept = Array.from(d.indices, (i) => result.errorsY[i]);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The x-extent is split into `buckets` buckets of equal x-width; the
|
|
115
|
+
lowest and highest sample of each bucket are kept (first occurrence on
|
|
116
|
+
ties, `NaN` y never selected), plus the first and last sample. Each
|
|
117
|
+
finite pin keeps the sample with the nearest x (ties go to the lower x)
|
|
118
|
+
and every sample sharing that x; `NaN` pins are ignored. At most
|
|
119
|
+
`min(n, 2 * buckets + 2 + M)` samples are returned (`M` = samples
|
|
120
|
+
selected by pins); signals with `n <= 2 * buckets` are returned
|
|
121
|
+
unchanged. An `Error` is thrown for a length mismatch, a non-finite or
|
|
122
|
+
decreasing x, a non-integer `buckets` or `buckets < 1`. Results are
|
|
123
|
+
identical to the Rust and Python APIs.
|
|
124
|
+
|
|
44
125
|
## Status codes
|
|
45
126
|
|
|
46
127
|
Mirror `simtest_funnel_core::Status`:
|
|
@@ -57,6 +138,10 @@ Mirror `simtest_funnel_core::Status`:
|
|
|
57
138
|
| `BufferTooSmall` | 13 |
|
|
58
139
|
| `InsufficientData` | 14 |
|
|
59
140
|
|
|
141
|
+
`MissingReference` / `MissingTest` are judged within `xRange`: both
|
|
142
|
+
x-extents are clipped to it first, so a window inside the overlap of the
|
|
143
|
+
two trajectories yields `Pass` or `Fail`.
|
|
144
|
+
|
|
60
145
|
## Reference documentation
|
|
61
146
|
|
|
62
147
|
A full `typedoc`-generated API reference is published alongside every
|
package/dist/index.d.ts
CHANGED
|
@@ -1,22 +1,63 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Tolerances passed to {@link compare} / {@link summarize}. A field that is
|
|
3
|
+
* omitted, `undefined` or `null` is "not given"; any number (including `0`)
|
|
4
|
+
* is given.
|
|
5
|
+
*
|
|
6
|
+
* Coefficients are resolved per axis by the Rust core, identically in every
|
|
7
|
+
* simtest-funnel API (x axis: `atolx`/`ltolx`/`rtolx`; y axis:
|
|
8
|
+
* `atoly`/`ltoly`/`rtoly`):
|
|
9
|
+
*
|
|
10
|
+
* - an axis with no coefficient given gets the default `rtol = 2e-3`
|
|
11
|
+
* (other coefficients `0`);
|
|
12
|
+
* - an axis with at least one coefficient given uses the given values and
|
|
13
|
+
* `0` for its other coefficients;
|
|
14
|
+
* - an explicit `0` counts as given.
|
|
15
|
+
*
|
|
16
|
+
* So `{ atoly: 0.05 }` means `atoly = 0.05`, `rtoly = 0` and
|
|
17
|
+
* `rtolx = 2e-3`; use `{ atolx: 0, atoly: 0.05 }` for zero x tolerance.
|
|
18
|
+
*/
|
|
2
19
|
export interface Tolerances {
|
|
3
|
-
atolx?: number;
|
|
4
|
-
atoly?: number;
|
|
5
|
-
ltolx?: number;
|
|
6
|
-
ltoly?: number;
|
|
7
|
-
rtolx?: number;
|
|
8
|
-
rtoly?: number;
|
|
20
|
+
atolx?: number | null;
|
|
21
|
+
atoly?: number | null;
|
|
22
|
+
ltolx?: number | null;
|
|
23
|
+
ltoly?: number | null;
|
|
24
|
+
rtolx?: number | null;
|
|
25
|
+
rtoly?: number | null;
|
|
9
26
|
}
|
|
10
|
-
/**
|
|
27
|
+
/** The six effective tolerance coefficients after resolution. */
|
|
28
|
+
export type ResolvedTolerances = {
|
|
29
|
+
[K in keyof Tolerances]-?: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* X-range filter passed in {@link Options}. A bound that is omitted,
|
|
33
|
+
* `undefined` or `null` is unbounded on that side, so `{ lo: 0.5 }` means
|
|
34
|
+
* `[0.5, Infinity]` (same as the Python `Range`).
|
|
35
|
+
*/
|
|
11
36
|
export interface XRange {
|
|
37
|
+
lo?: number | null;
|
|
38
|
+
hi?: number | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A range as returned by the library: both bounds present, unbounded
|
|
42
|
+
* sides are `-Infinity` / `Infinity`.
|
|
43
|
+
*/
|
|
44
|
+
export interface ResolvedXRange {
|
|
12
45
|
lo: number;
|
|
13
46
|
hi: number;
|
|
14
47
|
}
|
|
15
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Options for {@link compare}. Omitting `options`, or omitting
|
|
50
|
+
* `tolerances`, means the default tolerances (`rtolx = rtoly = 2e-3`).
|
|
51
|
+
*/
|
|
16
52
|
export interface Options {
|
|
17
53
|
tolerances?: Tolerances;
|
|
18
54
|
xRange?: XRange;
|
|
19
55
|
}
|
|
56
|
+
/** Fully explicit options, as returned by {@link defaultOptions}. */
|
|
57
|
+
export interface ResolvedOptions {
|
|
58
|
+
tolerances: ResolvedTolerances;
|
|
59
|
+
xRange: ResolvedXRange;
|
|
60
|
+
}
|
|
20
61
|
/** Status codes (mirror `simtest_funnel_core::Status`). */
|
|
21
62
|
export declare const Status: {
|
|
22
63
|
readonly Pass: 0;
|
|
@@ -42,11 +83,105 @@ export interface CompareResult {
|
|
|
42
83
|
}
|
|
43
84
|
/**
|
|
44
85
|
* Compare a test trajectory against a reference. Errors are signed
|
|
45
|
-
* (positive above upper, negative below lower).
|
|
86
|
+
* (positive above upper, negative below lower). Partially specified
|
|
87
|
+
* tolerances are resolved per axis (see {@link Tolerances}); `options`
|
|
88
|
+
* omitted means the defaults reported by {@link defaultOptions}.
|
|
46
89
|
*/
|
|
47
90
|
export declare function compare(referenceX: ArrayLike<number> | Float64Array, referenceY: ArrayLike<number> | Float64Array, testX: ArrayLike<number> | Float64Array, testY: ArrayLike<number> | Float64Array, options?: Options): CompareResult;
|
|
48
|
-
/**
|
|
49
|
-
export
|
|
91
|
+
/** Side of the tube on which a violation lies. */
|
|
92
|
+
export type ViolationDirection = 'above' | 'below';
|
|
93
|
+
/**
|
|
94
|
+
* A maximal run of consecutive judged test points outside the tube on the
|
|
95
|
+
* same side. `startX` / `endX` are the x of the first / last test point of
|
|
96
|
+
* the run (equal for a single-point violation).
|
|
97
|
+
*/
|
|
98
|
+
export interface ViolationInterval {
|
|
99
|
+
startX: number;
|
|
100
|
+
endX: number;
|
|
101
|
+
direction: ViolationDirection;
|
|
102
|
+
pointCount: number;
|
|
103
|
+
/** Signed deviation with the largest magnitude in the run. */
|
|
104
|
+
worstDeviation: number;
|
|
105
|
+
worstX: number;
|
|
106
|
+
}
|
|
107
|
+
/** Overall worst deviation of a comparison. */
|
|
108
|
+
export interface WorstDeviation {
|
|
109
|
+
x: number;
|
|
110
|
+
/** Signed deviation with the largest magnitude (first on ties). */
|
|
111
|
+
deviation: number;
|
|
112
|
+
/** Half the distance between upper and lower bound at `x`. */
|
|
113
|
+
tubeHalfWidthY: number;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* How much a comparison violated the tolerances it was run with. Only
|
|
117
|
+
* judged test points (x inside `xRange` intersected with the reference
|
|
118
|
+
* x-extent) contribute. For validation statuses, or when no point is
|
|
119
|
+
* judged, `comparedRange`, `worst` and both fractions are `null`.
|
|
120
|
+
*/
|
|
121
|
+
export interface ViolationSummary {
|
|
122
|
+
status: StatusCode;
|
|
123
|
+
/** The six resolved tolerance values used. */
|
|
124
|
+
tolerances: ResolvedTolerances;
|
|
125
|
+
xRange: ResolvedXRange;
|
|
126
|
+
/** First to last judged test point. */
|
|
127
|
+
comparedRange: ResolvedXRange | null;
|
|
128
|
+
intervals: ViolationInterval[];
|
|
129
|
+
worst: WorstDeviation | null;
|
|
130
|
+
pointsCompared: number;
|
|
131
|
+
pointsOutside: number;
|
|
132
|
+
fractionOfPointsOutside: number | null;
|
|
133
|
+
/**
|
|
134
|
+
* Each judged point represents the x-length halfway to its neighbours;
|
|
135
|
+
* share of that length lying outside the tube.
|
|
136
|
+
*/
|
|
137
|
+
fractionOfSpanOutside: number | null;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Summarize how much `result` violated its tolerances. `referenceX` and
|
|
141
|
+
* `options` must be the reference x-values and options passed to
|
|
142
|
+
* {@link compare} for `result` (`undefined` means the same defaults
|
|
143
|
+
* `compare` uses). Computed by the Rust core, so numbers are identical to
|
|
144
|
+
* the Rust and Python APIs.
|
|
145
|
+
*/
|
|
146
|
+
export declare function summarize(result: CompareResult, referenceX: ArrayLike<number> | Float64Array, options?: Options): ViolationSummary;
|
|
147
|
+
/**
|
|
148
|
+
* Samples kept by {@link downsampleMinMax}, in input order:
|
|
149
|
+
* `x[k] === inputX[indices[k]]` and `y[k] === inputY[indices[k]]`. Use
|
|
150
|
+
* `indices` to select the same samples from further arrays on the same
|
|
151
|
+
* x-grid (e.g. `result.errorsY` of a comparison).
|
|
152
|
+
*/
|
|
153
|
+
export interface Downsampled {
|
|
154
|
+
indices: Uint32Array;
|
|
155
|
+
x: Float64Array;
|
|
156
|
+
y: Float64Array;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Reduce a signal to the extremes of `buckets` equal-width x-buckets, for
|
|
160
|
+
* output only (plots, reports); never feed the result back into
|
|
161
|
+
* {@link compare}.
|
|
162
|
+
*
|
|
163
|
+
* The lowest and highest sample of each bucket are kept (first occurrence
|
|
164
|
+
* on ties, `NaN` y never selected), plus the first and last sample. Each
|
|
165
|
+
* finite value of `pinnedX` keeps the sample with the nearest x (ties go to
|
|
166
|
+
* the lower x) and every sample sharing that x; `NaN` pins are ignored. Pin
|
|
167
|
+
* the `worstX` of every interval of {@link summarize} so a plot never hides
|
|
168
|
+
* a violation.
|
|
169
|
+
*
|
|
170
|
+
* At most `min(n, 2 * buckets + 2 + M)` samples are returned (`M` = samples
|
|
171
|
+
* selected by pins); if `n <= 2 * buckets` every sample is returned.
|
|
172
|
+
* Computed by the Rust core, so results are identical to the Rust and
|
|
173
|
+
* Python APIs.
|
|
174
|
+
*
|
|
175
|
+
* @throws Error for a length mismatch, a non-finite or decreasing x, a
|
|
176
|
+
* non-integer `buckets` or `buckets < 1`.
|
|
177
|
+
*/
|
|
178
|
+
export declare function downsampleMinMax(x: ArrayLike<number> | Float64Array, y: ArrayLike<number> | Float64Array, buckets: number, pinnedX?: ArrayLike<number> | Float64Array): Downsampled;
|
|
179
|
+
/**
|
|
180
|
+
* Returns the default options with all six tolerances explicit
|
|
181
|
+
* (`rtolx = rtoly = 2e-3`, others `0`). Passing them to {@link compare}
|
|
182
|
+
* is identical to omitting `options`.
|
|
183
|
+
*/
|
|
184
|
+
export declare function defaultOptions(): ResolvedOptions;
|
|
50
185
|
/** Returns the core crate version. */
|
|
51
186
|
export declare function version(): string;
|
|
52
187
|
/**
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,9 @@ function toF64(v) {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Compare a test trajectory against a reference. Errors are signed
|
|
21
|
-
* (positive above upper, negative below lower).
|
|
21
|
+
* (positive above upper, negative below lower). Partially specified
|
|
22
|
+
* tolerances are resolved per axis (see {@link Tolerances}); `options`
|
|
23
|
+
* omitted means the defaults reported by {@link defaultOptions}.
|
|
22
24
|
*/
|
|
23
25
|
export function compare(referenceX, referenceY, testX, testY, options) {
|
|
24
26
|
const raw = wasm.compare(toF64(referenceX), toF64(referenceY), toF64(testX), toF64(testY),
|
|
@@ -35,7 +37,50 @@ export function compare(referenceX, referenceY, testX, testY, options) {
|
|
|
35
37
|
errorsY: Float64Array.from(r.errorsY),
|
|
36
38
|
};
|
|
37
39
|
}
|
|
38
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Summarize how much `result` violated its tolerances. `referenceX` and
|
|
42
|
+
* `options` must be the reference x-values and options passed to
|
|
43
|
+
* {@link compare} for `result` (`undefined` means the same defaults
|
|
44
|
+
* `compare` uses). Computed by the Rust core, so numbers are identical to
|
|
45
|
+
* the Rust and Python APIs.
|
|
46
|
+
*/
|
|
47
|
+
export function summarize(result, referenceX, options) {
|
|
48
|
+
return wasm.summarize(toF64(referenceX), result.status, result.lowerX, result.lowerY, result.upperX, result.upperY, result.errorsX, result.errorsY, options ?? null);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Reduce a signal to the extremes of `buckets` equal-width x-buckets, for
|
|
52
|
+
* output only (plots, reports); never feed the result back into
|
|
53
|
+
* {@link compare}.
|
|
54
|
+
*
|
|
55
|
+
* The lowest and highest sample of each bucket are kept (first occurrence
|
|
56
|
+
* on ties, `NaN` y never selected), plus the first and last sample. Each
|
|
57
|
+
* finite value of `pinnedX` keeps the sample with the nearest x (ties go to
|
|
58
|
+
* the lower x) and every sample sharing that x; `NaN` pins are ignored. Pin
|
|
59
|
+
* the `worstX` of every interval of {@link summarize} so a plot never hides
|
|
60
|
+
* a violation.
|
|
61
|
+
*
|
|
62
|
+
* At most `min(n, 2 * buckets + 2 + M)` samples are returned (`M` = samples
|
|
63
|
+
* selected by pins); if `n <= 2 * buckets` every sample is returned.
|
|
64
|
+
* Computed by the Rust core, so results are identical to the Rust and
|
|
65
|
+
* Python APIs.
|
|
66
|
+
*
|
|
67
|
+
* @throws Error for a length mismatch, a non-finite or decreasing x, a
|
|
68
|
+
* non-integer `buckets` or `buckets < 1`.
|
|
69
|
+
*/
|
|
70
|
+
export function downsampleMinMax(x, y, buckets, pinnedX) {
|
|
71
|
+
try {
|
|
72
|
+
return wasm.downsampleMinMax(toF64(x), toF64(y), buckets, toF64(pinnedX ?? []));
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
// The WASM glue throws the core's message as a plain string.
|
|
76
|
+
throw e instanceof Error ? e : new Error(String(e));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Returns the default options with all six tolerances explicit
|
|
81
|
+
* (`rtolx = rtoly = 2e-3`, others `0`). Passing them to {@link compare}
|
|
82
|
+
* is identical to omitting `options`.
|
|
83
|
+
*/
|
|
39
84
|
export function defaultOptions() {
|
|
40
85
|
return wasm.defaultOptions();
|
|
41
86
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,+BAA+B,CAAC;AAkEtD,2DAA2D;AAC3D,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC,CAAC;IACR,gBAAgB,EAAE,CAAC;IACnB,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,EAAE;IAClB,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,EAAE;IAClB,gBAAgB,EAAE,EAAE;CACZ,CAAC;AAcX,SAAS,KAAK,CAAC,CAAmC;IAChD,OAAO,CAAC,YAAY,YAAY;QAC9B,CAAC,CAAC,CAAC;QACH,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAsB,CAAC,CAAC;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CACrB,UAA4C,EAC5C,UAA4C,EAC5C,KAAuC,EACvC,KAAuC,EACvC,OAAiB;IAEjB,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CACtB,KAAK,CAAC,UAAU,CAAC,EACjB,KAAK,CAAC,UAAU,CAAC,EACjB,KAAK,CAAC,KAAK,CAAC,EACZ,KAAK,CAAC,KAAK,CAAC;IACZ,sEAAsE;IACtE,CAAC,OAAO,IAAI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EAAE,IAAI,EAAE,KAAK,EAAE;YACrB,IAAI,EAAE,SAAS;SAChB;QACD;YACE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACnC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YACnC,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;YACrB,IAAI,EAAE,SAAS;SAChB;QACD;YACE,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC;YACpC,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC5D,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,IAAI;SACZ;KACF,CAAC;IACF,MAAM,WAAW,GAAG;QAClB,KAAK,EAAE,mBAAmB;QAC1B,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;QACzB,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;QAC5D,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;KAClB,CAAC;IACF,OAAO,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -7,10 +7,25 @@
|
|
|
7
7
|
export function compare(reference_x: Float64Array, reference_y: Float64Array, test_x: Float64Array, test_y: Float64Array, options: any): any;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Returns default
|
|
10
|
+
* Returns the default options as a JS object with all six tolerance
|
|
11
|
+
* values explicit (`Options::default_options()` from the core).
|
|
11
12
|
*/
|
|
12
13
|
export function defaultOptions(): any;
|
|
13
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Min/max-per-bucket downsampling of a signal, computed by the core.
|
|
17
|
+
* Returns `{ indices: Uint32Array, x: Float64Array, y: Float64Array }`;
|
|
18
|
+
* invalid input throws with the core's error message.
|
|
19
|
+
*/
|
|
20
|
+
export function downsampleMinMax(x: Float64Array, y: Float64Array, buckets: number, pinned_x: Float64Array): any;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Violation summary of an existing comparison. The result arrays are
|
|
24
|
+
* marshalled back into a core `CompareResult`; the summary itself is
|
|
25
|
+
* computed by the Rust core. Absent values are `null`.
|
|
26
|
+
*/
|
|
27
|
+
export function summarize(reference_x: Float64Array, status: number, lower_x: Float64Array, lower_y: Float64Array, upper_x: Float64Array, upper_y: Float64Array, errors_x: Float64Array, errors_y: Float64Array, options: any): any;
|
|
28
|
+
|
|
14
29
|
/**
|
|
15
30
|
* Returns the core crate version.
|
|
16
31
|
*/
|
|
@@ -16,7 +16,8 @@ export function compare(reference_x, reference_y, test_x, test_y, options) {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
|
-
* Returns default
|
|
19
|
+
* Returns the default options as a JS object with all six tolerance
|
|
20
|
+
* values explicit (`Options::default_options()` from the core).
|
|
20
21
|
* @returns {any}
|
|
21
22
|
*/
|
|
22
23
|
export function defaultOptions() {
|
|
@@ -24,6 +25,47 @@ export function defaultOptions() {
|
|
|
24
25
|
return ret;
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
/**
|
|
29
|
+
* Min/max-per-bucket downsampling of a signal, computed by the core.
|
|
30
|
+
* Returns `{ indices: Uint32Array, x: Float64Array, y: Float64Array }`;
|
|
31
|
+
* invalid input throws with the core's error message.
|
|
32
|
+
* @param {Float64Array} x
|
|
33
|
+
* @param {Float64Array} y
|
|
34
|
+
* @param {number} buckets
|
|
35
|
+
* @param {Float64Array} pinned_x
|
|
36
|
+
* @returns {any}
|
|
37
|
+
*/
|
|
38
|
+
export function downsampleMinMax(x, y, buckets, pinned_x) {
|
|
39
|
+
const ret = wasm.downsampleMinMax(x, y, buckets, pinned_x);
|
|
40
|
+
if (ret[2]) {
|
|
41
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
42
|
+
}
|
|
43
|
+
return takeFromExternrefTable0(ret[0]);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Violation summary of an existing comparison. The result arrays are
|
|
48
|
+
* marshalled back into a core `CompareResult`; the summary itself is
|
|
49
|
+
* computed by the Rust core. Absent values are `null`.
|
|
50
|
+
* @param {Float64Array} reference_x
|
|
51
|
+
* @param {number} status
|
|
52
|
+
* @param {Float64Array} lower_x
|
|
53
|
+
* @param {Float64Array} lower_y
|
|
54
|
+
* @param {Float64Array} upper_x
|
|
55
|
+
* @param {Float64Array} upper_y
|
|
56
|
+
* @param {Float64Array} errors_x
|
|
57
|
+
* @param {Float64Array} errors_y
|
|
58
|
+
* @param {any} options
|
|
59
|
+
* @returns {any}
|
|
60
|
+
*/
|
|
61
|
+
export function summarize(reference_x, status, lower_x, lower_y, upper_x, upper_y, errors_x, errors_y, options) {
|
|
62
|
+
const ret = wasm.summarize(reference_x, status, lower_x, lower_y, upper_x, upper_y, errors_x, errors_y, options);
|
|
63
|
+
if (ret[2]) {
|
|
64
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
65
|
+
}
|
|
66
|
+
return takeFromExternrefTable0(ret[0]);
|
|
67
|
+
}
|
|
68
|
+
|
|
27
69
|
/**
|
|
28
70
|
* Returns the core crate version.
|
|
29
71
|
* @returns {string}
|
|
@@ -145,12 +187,24 @@ export function __wbg_new_cd4348290afae586() {
|
|
|
145
187
|
const ret = new Object();
|
|
146
188
|
return ret;
|
|
147
189
|
}
|
|
190
|
+
export function __wbg_new_from_slice_3512352010266e02(arg0, arg1) {
|
|
191
|
+
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
192
|
+
return ret;
|
|
193
|
+
}
|
|
194
|
+
export function __wbg_new_from_slice_aaf85a9746711968(arg0, arg1) {
|
|
195
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
196
|
+
return ret;
|
|
197
|
+
}
|
|
148
198
|
export function __wbg_prototypesetcall_13162965d1fe7aa3(arg0, arg1, arg2) {
|
|
149
199
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
150
200
|
}
|
|
151
201
|
export function __wbg_prototypesetcall_a366c038a3918afa(arg0, arg1, arg2) {
|
|
152
202
|
Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
|
|
153
203
|
}
|
|
204
|
+
export function __wbg_set_2793479888329cb6() { return handleError(function (arg0, arg1, arg2) {
|
|
205
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
206
|
+
return ret;
|
|
207
|
+
}, arguments); }
|
|
154
208
|
export function __wbg_set_d2d33b52458e984a(arg0, arg1, arg2) {
|
|
155
209
|
arg0[arg1 >>> 0] = arg2;
|
|
156
210
|
}
|
|
@@ -167,6 +221,11 @@ export function __wbindgen_generic_0000000000000002(arg0, arg1) {
|
|
|
167
221
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
168
222
|
return ret;
|
|
169
223
|
}
|
|
224
|
+
export function __wbindgen_generic_0000000000000003(arg0) {
|
|
225
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
226
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
227
|
+
return ret;
|
|
228
|
+
}
|
|
170
229
|
export function __wbindgen_init_externref_table() {
|
|
171
230
|
const table = wasm.__wbindgen_externrefs;
|
|
172
231
|
table.set(0, undefined);
|
|
@@ -175,6 +234,12 @@ export function __wbindgen_init_externref_table() {
|
|
|
175
234
|
table.set(1026, true);
|
|
176
235
|
table.set(1027, false);
|
|
177
236
|
}
|
|
237
|
+
function addToExternrefTable0(obj) {
|
|
238
|
+
const idx = wasm.__externref_table_alloc();
|
|
239
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
240
|
+
return idx;
|
|
241
|
+
}
|
|
242
|
+
|
|
178
243
|
function debugString(val) {
|
|
179
244
|
switch (typeof val) {
|
|
180
245
|
// primitive types
|
|
@@ -238,6 +303,11 @@ function getArrayF64FromWasm0(ptr, len) {
|
|
|
238
303
|
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
239
304
|
}
|
|
240
305
|
|
|
306
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
307
|
+
ptr = ptr >>> 0;
|
|
308
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
309
|
+
}
|
|
310
|
+
|
|
241
311
|
function getArrayU8FromWasm0(ptr, len) {
|
|
242
312
|
ptr = ptr >>> 0;
|
|
243
313
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -264,6 +334,14 @@ function getStringFromWasm0(ptr, len) {
|
|
|
264
334
|
return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
265
335
|
}
|
|
266
336
|
|
|
337
|
+
let cachedUint32ArrayMemory0 = null;
|
|
338
|
+
function getUint32ArrayMemory0() {
|
|
339
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
340
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
341
|
+
}
|
|
342
|
+
return cachedUint32ArrayMemory0;
|
|
343
|
+
}
|
|
344
|
+
|
|
267
345
|
let cachedUint8ArrayMemory0 = null;
|
|
268
346
|
function getUint8ArrayMemory0() {
|
|
269
347
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -272,6 +350,15 @@ function getUint8ArrayMemory0() {
|
|
|
272
350
|
return cachedUint8ArrayMemory0;
|
|
273
351
|
}
|
|
274
352
|
|
|
353
|
+
function handleError(f, args) {
|
|
354
|
+
try {
|
|
355
|
+
return f.apply(this, args);
|
|
356
|
+
} catch (e) {
|
|
357
|
+
const idx = addToExternrefTable0(e);
|
|
358
|
+
wasm.__wbindgen_exn_store(idx);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
275
362
|
function isLikeNone(x) {
|
|
276
363
|
return x === undefined || x === null;
|
|
277
364
|
}
|
|
Binary file
|
|
@@ -3,10 +3,14 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const compare: (a: any, b: any, c: any, d: any, e: any) => [number, number, number];
|
|
5
5
|
export const defaultOptions: () => any;
|
|
6
|
+
export const downsampleMinMax: (a: any, b: any, c: number, d: any) => [number, number, number];
|
|
7
|
+
export const summarize: (a: any, b: number, c: any, d: any, e: any, f: any, g: any, h: any, i: any) => [number, number, number];
|
|
6
8
|
export const version: () => [number, number];
|
|
7
9
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
8
10
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
9
11
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
13
|
+
export const __externref_table_alloc: () => number;
|
|
10
14
|
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
11
15
|
export const __externref_table_dealloc: (a: number) => void;
|
|
12
16
|
export const __wbindgen_start: () => void;
|