@uwrl/qc-utils 0.0.18 → 0.0.19
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/dist/index.js +16 -16
- package/dist/index.umd.cjs +1 -1
- package/package.json +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/models/dataSource.d.ts +0 -173
- package/dist/models/index.d.ts +0 -2
- package/dist/models/payload.d.ts +0 -24
- package/dist/models/settings.d.ts +0 -65
- package/dist/models/timestamp.d.ts +0 -150
- package/dist/services/__tests__/createPatchObject.spec.d.ts +0 -1
- package/dist/services/__tests__/requestInterceptor.spec.d.ts +0 -1
- package/dist/services/__tests__/responseInterceptor.spec.d.ts +0 -1
- package/dist/services/api.d.ts +0 -147
- package/dist/services/apiMethods.d.ts +0 -8
- package/dist/services/createPatchObject.d.ts +0 -17
- package/dist/services/getCSRFToken.d.ts +0 -1
- package/dist/services/index.d.ts +0 -6
- package/dist/services/requestInterceptor.d.ts +0 -12
- package/dist/services/responseInterceptor.d.ts +0 -2
- package/dist/types/index.d.ts +0 -372
- package/dist/utils/__tests__/ellapsed-time.spec.d.ts +0 -1
- package/dist/utils/__tests__/format.spec.d.ts +0 -1
- package/dist/utils/__tests__/notifications.spec.d.ts +0 -1
- package/dist/utils/__tests__/observations.spec.d.ts +0 -1
- package/dist/utils/ellapsed-time.d.ts +0 -4
- package/dist/utils/format.d.ts +0 -4
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/notifications.d.ts +0 -46
- package/dist/utils/observations.d.ts +0 -5
- package/dist/utils/plotting/__tests__/calibration.spec.d.ts +0 -16
- package/dist/utils/plotting/__tests__/mock.d.ts +0 -4
- package/dist/utils/plotting/__tests__/observation-record-paths.spec.d.ts +0 -21
- package/dist/utils/plotting/__tests__/observation-record.spec.d.ts +0 -1
- package/dist/utils/plotting/__tests__/operation-cores.spec.d.ts +0 -12
- package/dist/utils/plotting/__tests__/workerMocks.d.ts +0 -119
- package/dist/utils/plotting/__tests__/workers.spec.d.ts +0 -18
- package/dist/utils/plotting/add-data.worker.d.ts +0 -1
- package/dist/utils/plotting/calibration.d.ts +0 -99
- package/dist/utils/plotting/change-values.worker.d.ts +0 -1
- package/dist/utils/plotting/change.worker.d.ts +0 -1
- package/dist/utils/plotting/delete-data.worker.d.ts +0 -1
- package/dist/utils/plotting/drift-correction.worker.d.ts +0 -1
- package/dist/utils/plotting/fill-gaps.worker.d.ts +0 -1
- package/dist/utils/plotting/find-gaps.worker.d.ts +0 -1
- package/dist/utils/plotting/interpolate.worker.d.ts +0 -1
- package/dist/utils/plotting/observation-record.d.ts +0 -281
- package/dist/utils/plotting/operation-cores.d.ts +0 -139
- package/dist/utils/plotting/persistence.worker.d.ts +0 -1
- package/dist/utils/plotting/rate-of-change.worker.d.ts +0 -1
- package/dist/utils/plotting/shift-datetimes.worker.d.ts +0 -1
- package/dist/utils/plotting/value-threshold.worker.d.ts +0 -1
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure, framework-free primitive kernels for each QC operation whose
|
|
3
|
-
* worker has a one-to-one inline equivalent. Shared by both the
|
|
4
|
-
* `?worker&inline` Vite workers and `ObservationRecord`'s non-worker
|
|
5
|
-
* fast paths so there's a single source of truth for each algorithm —
|
|
6
|
-
* if the worker's hot loop drifts from the main-thread loop we get
|
|
7
|
-
* silently wrong selections, which the calibration feature would make
|
|
8
|
-
* far easier to trigger.
|
|
9
|
-
*
|
|
10
|
-
* Keep these functions:
|
|
11
|
-
* - allocation-frugal (no unnecessary intermediate arrays),
|
|
12
|
-
* - free of module-level `self` / `postMessage` references (callable
|
|
13
|
-
* in either context),
|
|
14
|
-
* - deterministic given identical inputs (so worker output can be
|
|
15
|
-
* diffed against inline output when debugging drift).
|
|
16
|
-
*/
|
|
17
|
-
/** Opcode encoding used by `valueThresholdCore` (matches the worker). */
|
|
18
|
-
export declare const enum ThresholdOp {
|
|
19
|
-
LT = 0,
|
|
20
|
-
LTE = 1,
|
|
21
|
-
GT = 2,
|
|
22
|
-
GTE = 3,
|
|
23
|
-
E = 4
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Scan `[start, end)` of `arrayY` and collect every index where the
|
|
27
|
-
* value matches ANY of the supplied comparator/threshold pairs. Short-
|
|
28
|
-
* circuits on first match per element (matches worker semantics).
|
|
29
|
-
*/
|
|
30
|
-
export declare function valueThresholdCore(arrayY: Float32Array | Float32Array<SharedArrayBuffer>, start: number, end: number, ops: number[], values: number[]): number[];
|
|
31
|
-
/**
|
|
32
|
-
* First-difference filter: collect indexes in `[start, end)` where
|
|
33
|
-
* `Y[i] - Y[i-1]` satisfies the comparator. Comparator strings match
|
|
34
|
-
* the worker exactly (FilterOperation enum values).
|
|
35
|
-
*/
|
|
36
|
-
export declare function changeCore(arrayY: Float32Array | Float32Array<SharedArrayBuffer>, start: number, end: number, comparator: string, value: number): number[];
|
|
37
|
-
/**
|
|
38
|
-
* Relative rate-of-change: `(Y[i] - Y[i-1]) / |Y[i-1]|`. Same
|
|
39
|
-
* comparator semantics as `changeCore`.
|
|
40
|
-
*/
|
|
41
|
-
export declare function rateOfChangeCore(arrayY: Float32Array | Float32Array<SharedArrayBuffer>, start: number, end: number, comparator: string, value: number): number[];
|
|
42
|
-
/**
|
|
43
|
-
* Detect datetime gaps: returns a flat `[leftIdx, rightIdx, ...]`
|
|
44
|
-
* list for every pair whose datetime delta exceeds `threshold` ms.
|
|
45
|
-
* Scan covers `[start, endInclusive]`.
|
|
46
|
-
*/
|
|
47
|
-
export declare function findGapsCore(arrayX: Float64Array | Float64Array<SharedArrayBuffer>, start: number, endInclusive: number, threshold: number): number[];
|
|
48
|
-
/**
|
|
49
|
-
* Emit maximal runs of equal Y values in `[start, end)` as flat
|
|
50
|
-
* `[startIndex, length, value, ...]` triplets. Downstream stitches
|
|
51
|
-
* adjacent chunk triplets before applying the min-run-length filter.
|
|
52
|
-
*/
|
|
53
|
-
export declare function persistenceCore(arrayY: Float32Array | Float32Array<SharedArrayBuffer>, start: number, end: number): number[];
|
|
54
|
-
/**
|
|
55
|
-
* Copy `[start, end]` of `sourceX` / `sourceY` into `outX` / `outY`
|
|
56
|
-
* starting at `outStart`, inserting synthesized fill points after each
|
|
57
|
-
* gap whose left index falls in the read range. `gaps` is a list of
|
|
58
|
-
* `[leftIdx, rightIdx]` pairs, sorted by left index. `fillDelta` is
|
|
59
|
-
* the spacing between inserted points in the same unit as `sourceX`.
|
|
60
|
-
* When `interpolate` is true the filled Y values are linearly
|
|
61
|
-
* interpolated between the gap's endpoints; otherwise `fillValue` is
|
|
62
|
-
* written (used for "sentinel" -9999 fills).
|
|
63
|
-
*
|
|
64
|
-
* Shared by the `FillGapsWorker`'s per-segment write and the inline
|
|
65
|
-
* full-array path. Returns the number of elements written so callers
|
|
66
|
-
* can double-check contiguity against their pre-computed fill totals.
|
|
67
|
-
*/
|
|
68
|
-
export declare function fillGapsCore(sourceX: Float64Array | Float64Array<SharedArrayBuffer>, sourceY: Float32Array | Float32Array<SharedArrayBuffer>, gaps: ReadonlyArray<[number, number]>, outX: Float64Array | Float64Array<SharedArrayBuffer>, outY: Float32Array | Float32Array<SharedArrayBuffer>, start: number, end: number, outStart: number, fillDelta: number, interpolate: boolean, fillValue: number): number;
|
|
69
|
-
/**
|
|
70
|
-
* Merge a slice `[origStart, origEnd)` of `sourceX` / `sourceY` with
|
|
71
|
-
* a pre-sorted list of `(x, y)` insertions into `outX` / `outY`
|
|
72
|
-
* starting at `outStart`. Originals win on datetime ties so the
|
|
73
|
-
* merged order matches `findLastLessOrEqual` semantics (insertion
|
|
74
|
-
* lands after equal-valued originals). Writes in order; caller is
|
|
75
|
-
* responsible for pre-allocating output buffers sized to
|
|
76
|
-
* `origEnd - origStart + insertions.length`.
|
|
77
|
-
*
|
|
78
|
-
* Shared by the `AddDataWorker`'s segment merge and the inline
|
|
79
|
-
* full-array path. Returns the number of elements written so callers
|
|
80
|
-
* can double-check contiguity.
|
|
81
|
-
*/
|
|
82
|
-
export declare function addDataPointsCore(sourceX: Float64Array | Float64Array<SharedArrayBuffer>, sourceY: Float32Array | Float32Array<SharedArrayBuffer>, insertions: ReadonlyArray<[number, number]>, outX: Float64Array | Float64Array<SharedArrayBuffer>, outY: Float32Array | Float32Array<SharedArrayBuffer>, origStart: number, origEnd: number, outStart: number): number;
|
|
83
|
-
/**
|
|
84
|
-
* Copy `[readStart, readEnd]` of `sourceX` / `sourceY` into
|
|
85
|
-
* `outX` / `outY` starting at `outStart`, skipping any index that
|
|
86
|
-
* appears in `deleteIndices` (which must be sorted ascending and
|
|
87
|
-
* bounded to the read range). Shared by the worker's per-segment
|
|
88
|
-
* write path and the inline full-array path. Returns the number of
|
|
89
|
-
* elements written so callers can double-check contiguity.
|
|
90
|
-
*/
|
|
91
|
-
export declare function deleteDataPointsCore(sourceX: Float64Array | Float64Array<SharedArrayBuffer>, sourceY: Float32Array | Float32Array<SharedArrayBuffer>, deleteIndices: ArrayLike<number>, outX: Float64Array | Float64Array<SharedArrayBuffer>, outY: Float32Array | Float32Array<SharedArrayBuffer>, readStart: number, readEnd: number, outStart: number): number;
|
|
92
|
-
/** Params for `shiftDatetimesCollection`; mirrors the worker payload. */
|
|
93
|
-
export interface ShiftDatetimesParams {
|
|
94
|
-
amount: number;
|
|
95
|
-
isMonth: boolean;
|
|
96
|
-
isYear: boolean;
|
|
97
|
-
/** Precomputed scalar ms offset; unused when `isMonth || isYear`. */
|
|
98
|
-
deltaMs: number;
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Compute shifted `(x, y)` pairs for each index in `indexes` without
|
|
102
|
-
* allocating a `SharedArrayBuffer`. Mirrors the shift worker's branches
|
|
103
|
-
* for month / year / scalar units. Returned in the same order as
|
|
104
|
-
* `indexes` so the caller can hand the collection straight to
|
|
105
|
-
* `_addDataPoints` after a `_deleteDataPoints(indexes)`.
|
|
106
|
-
*/
|
|
107
|
-
export declare function shiftDatetimesCollection(arrayX: Float64Array | Float64Array<SharedArrayBuffer>, arrayY: Float32Array | Float32Array<SharedArrayBuffer>, indexes: ArrayLike<number>, params: ShiftDatetimesParams): [number, number][];
|
|
108
|
-
/** Prepared group shape shared by `_interpolate` and its worker. */
|
|
109
|
-
export interface InterpolateGroup {
|
|
110
|
-
indexes: number[];
|
|
111
|
-
lowerIdx: number;
|
|
112
|
-
upperIdx: number;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Linear-interpolate Y-values at each group's `indexes` between the
|
|
116
|
-
* anchor points at `lowerIdx` / `upperIdx`. Writes in place. Matches
|
|
117
|
-
* the worker's degenerate-span semantics: if `lowerIdx === upperIdx`
|
|
118
|
-
* (group sits at a buffer edge with no valid anchor on one side) we
|
|
119
|
-
* paste the lone anchor value for every point in the group.
|
|
120
|
-
*/
|
|
121
|
-
export declare function interpolateCore(arrayX: Float64Array | Float64Array<SharedArrayBuffer>, arrayY: Float32Array | Float32Array<SharedArrayBuffer>, groups: InterpolateGroup[]): void;
|
|
122
|
-
/**
|
|
123
|
-
* Apply linear drift correction over one or more `[start, end, value]`
|
|
124
|
-
* ranges in place on `arrayY`, using `arrayX` only to compute each
|
|
125
|
-
* range's time anchors. Per-point formula:
|
|
126
|
-
*
|
|
127
|
-
* y_i += value * (x_i - startDatetime) / extent
|
|
128
|
-
*
|
|
129
|
-
* where `startDatetime = x[start]` and `extent = x[end] - x[start]`.
|
|
130
|
-
* Ranges with non-positive extent are skipped to match the worker's
|
|
131
|
-
* behaviour. The whole operation is O(total range length) — no
|
|
132
|
-
* chunking or spawning, suitable for the inline calibration path.
|
|
133
|
-
*/
|
|
134
|
-
export declare function driftCorrectionCore(arrayX: Float64Array | Float64Array<SharedArrayBuffer>, arrayY: Float32Array | Float32Array<SharedArrayBuffer>, ranges: [number, number, number][]): void;
|
|
135
|
-
/**
|
|
136
|
-
* Apply an arithmetic operator to `arrayY` at each index in
|
|
137
|
-
* `indexes`. Operator strings match `Operator` enum values.
|
|
138
|
-
*/
|
|
139
|
-
export declare function changeValuesCore(arrayY: Float32Array | Float32Array<SharedArrayBuffer>, indexes: ArrayLike<number>, operator: string, value: number): void;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|