fastlowess-wasm 0.99.8 → 0.99.9

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 CHANGED
@@ -7,6 +7,7 @@
7
7
  [![PyPI](https://img.shields.io/pypi/v/fastlowess.svg)](https://pypi.org/project/fastlowess/)
8
8
  [![Conda](https://anaconda.org/conda-forge/fastlowess/badges/version.svg)](https://anaconda.org/conda-forge/fastlowess)
9
9
  [![R-universe](https://thisisamirv.r-universe.dev/badges/rfastlowess)](https://thisisamirv.r-universe.dev/rfastlowess)
10
+ [![npm](https://img.shields.io/npm/v/fastlowess.svg)](https://www.npmjs.com/package/fastlowess)
10
11
 
11
12
  <p align="center">
12
13
  <img src="https://raw.githubusercontent.com/thisisamirv/lowess-project/main/dev/logo.png" alt="One LOWESS to Rule Them All" width="400">
@@ -226,7 +227,8 @@ library(rfastlowess)
226
227
  x <- c(1, 2, 3, 4, 5)
227
228
  y <- c(2.0, 4.1, 5.9, 8.2, 9.8)
228
229
 
229
- result <- fastlowess(x, y, fraction = 0.5, iterations = 3)
230
+ model <- Lowess(fraction = 0.5, iterations = 3)
231
+ result <- model$fit(x, y)
230
232
  print(result$y)
231
233
  ```
232
234
 
@@ -269,19 +271,20 @@ using fastlowess
269
271
  x = [1.0, 2.0, 3.0, 4.0, 5.0]
270
272
  y = [2.0, 4.1, 5.9, 8.2, 9.8]
271
273
 
272
- result = smooth(x, y, fraction=0.5, iterations=3)
274
+ result = fit(Lowess(fraction=0.5, iterations=3), x, y)
273
275
  println(result.y)
274
276
  ```
275
277
 
276
278
  **Node.js:**
277
279
 
278
280
  ```javascript
279
- const { smooth } = require('fastlowess');
281
+ const { Lowess } = require('fastlowess');
280
282
 
281
283
  const x = [1.0, 2.0, 3.0, 4.0, 5.0];
282
284
  const y = [2.0, 4.1, 5.9, 8.2, 9.8];
283
285
 
284
- const result = smooth(x, y, { fraction: 0.5, iterations: 3 });
286
+ const model = new Lowess({ fraction: 0.5, iterations: 3 });
287
+ const result = model.fit(x, y);
285
288
  console.log(result.y);
286
289
  ```
287
290
 
@@ -311,7 +314,9 @@ fastlowess::LowessOptions options;
311
314
  options.fraction = 0.5;
312
315
  options.iterations = 3;
313
316
 
314
- auto result = fastlowess::smooth(x, y, options);
317
+ fastlowess::Lowess model(options);
318
+ auto result = model.fit(x, y);
319
+
315
320
  for (double val : result.y_vector()) std::cout << val << " ";
316
321
  ```
317
322
 
@@ -322,8 +327,7 @@ for (double val : result.y_vector()) std::cout << val << " ";
322
327
  **R:**
323
328
 
324
329
  ```r
325
- fastlowess(
326
- x, y,
330
+ Lowess(
327
331
  fraction = 0.5,
328
332
  iterations = 3L,
329
333
  delta = 0.01,
@@ -341,7 +345,7 @@ fastlowess(
341
345
  cv_k = 5L,
342
346
  auto_converge = 1e-4,
343
347
  parallel = TRUE
344
- )
348
+ )$fit(x, y)
345
349
  ```
346
350
 
347
351
  **Python:**
@@ -396,8 +400,7 @@ Lowess::new()
396
400
  **Julia:**
397
401
 
398
402
  ```julia
399
- smooth(
400
- x, y,
403
+ Lowess(;
401
404
  fraction=0.5,
402
405
  iterations=3,
403
406
  delta=NaN, # NaN for auto
@@ -405,15 +408,15 @@ smooth(
405
408
  robustness_method="bisquare",
406
409
  zero_weight_fallback="use_local_mean",
407
410
  boundary_policy="extend",
408
- confidence_intervals=0.95,
409
- prediction_intervals=0.95,
411
+ confidence_intervals=NaN,
412
+ prediction_intervals=NaN,
410
413
  return_diagnostics=true,
411
414
  return_residuals=true,
412
415
  return_robustness_weights=true,
413
- cv_fractions=[0.3, 0.5, 0.7],
416
+ cv_fractions=Float64[], # e.g. [0.3, 0.5]
414
417
  cv_method="kfold",
415
418
  cv_k=5,
416
- auto_converge=1e-4,
419
+ auto_converge=NaN,
417
420
  parallel=true
418
421
  )
419
422
  ```
@@ -421,7 +424,7 @@ smooth(
421
424
  **Node.js:**
422
425
 
423
426
  ```javascript
424
- smooth(x, y, {
427
+ new Lowess({
425
428
  fraction: 0.5,
426
429
  iterations: 3,
427
430
  delta: 0.01,
@@ -439,7 +442,7 @@ smooth(x, y, {
439
442
  cvK: 5,
440
443
  autoConverge: 1e-4,
441
444
  parallel: true
442
- })
445
+ }).fit(x, y)
443
446
  ```
444
447
 
445
448
  **WebAssembly:**
@@ -487,7 +490,8 @@ options.cv_k = 5;
487
490
  options.auto_converge = 1e-4;
488
491
  options.parallel = true;
489
492
 
490
- auto result = fastlowess::smooth(x, y, options);
493
+ fastlowess::Lowess model(options);
494
+ auto result = model.fit(x, y);
491
495
  ```
492
496
 
493
497
  ## Result Structure
@@ -2,53 +2,53 @@
2
2
  /* eslint-disable */
3
3
 
4
4
  export class Diagnostics {
5
- private constructor();
6
- free(): void;
7
- [Symbol.dispose](): void;
8
- rmse: number;
9
- mae: number;
10
- rSquared: number;
11
- get aic(): number | undefined;
12
- set aic(value: number | null | undefined);
13
- get aicc(): number | undefined;
14
- set aicc(value: number | null | undefined);
15
- get effectiveDf(): number | undefined;
16
- set effectiveDf(value: number | null | undefined);
17
- residualSd: number;
5
+ private constructor();
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ get aic(): number | undefined;
9
+ set aic(value: number | null | undefined);
10
+ get aicc(): number | undefined;
11
+ set aicc(value: number | null | undefined);
12
+ get effectiveDf(): number | undefined;
13
+ set effectiveDf(value: number | null | undefined);
14
+ mae: number;
15
+ rSquared: number;
16
+ residualSd: number;
17
+ rmse: number;
18
18
  }
19
19
 
20
20
  export class LowessResultWasm {
21
- private constructor();
22
- free(): void;
23
- [Symbol.dispose](): void;
24
- readonly diagnostics: Diagnostics | undefined;
25
- readonly fractionUsed: number;
26
- readonly iterationsUsed: number | undefined;
27
- readonly standardErrors: Float64Array | undefined;
28
- readonly confidenceLower: Float64Array | undefined;
29
- readonly confidenceUpper: Float64Array | undefined;
30
- readonly predictionLower: Float64Array | undefined;
31
- readonly predictionUpper: Float64Array | undefined;
32
- readonly robustnessWeights: Float64Array | undefined;
33
- readonly x: Float64Array;
34
- readonly y: Float64Array;
35
- readonly cvScores: Float64Array | undefined;
36
- readonly residuals: Float64Array | undefined;
21
+ private constructor();
22
+ free(): void;
23
+ [Symbol.dispose](): void;
24
+ readonly confidenceLower: Float64Array | undefined;
25
+ readonly confidenceUpper: Float64Array | undefined;
26
+ readonly cvScores: Float64Array | undefined;
27
+ readonly diagnostics: Diagnostics | undefined;
28
+ readonly fractionUsed: number;
29
+ readonly iterationsUsed: number | undefined;
30
+ readonly predictionLower: Float64Array | undefined;
31
+ readonly predictionUpper: Float64Array | undefined;
32
+ readonly residuals: Float64Array | undefined;
33
+ readonly robustnessWeights: Float64Array | undefined;
34
+ readonly standardErrors: Float64Array | undefined;
35
+ readonly x: Float64Array;
36
+ readonly y: Float64Array;
37
37
  }
38
38
 
39
39
  export class OnlineLowessWasm {
40
- free(): void;
41
- [Symbol.dispose](): void;
42
- constructor(options: any, online_opts: any);
43
- update(x: number, y: number): number | undefined;
40
+ free(): void;
41
+ [Symbol.dispose](): void;
42
+ constructor(options: any, online_opts: any);
43
+ update(x: number, y: number): number | undefined;
44
44
  }
45
45
 
46
46
  export class StreamingLowessWasm {
47
- free(): void;
48
- [Symbol.dispose](): void;
49
- processChunk(x: Float64Array, y: Float64Array): LowessResultWasm;
50
- constructor(options: any, streaming_opts: any);
51
- finalize(): LowessResultWasm;
47
+ free(): void;
48
+ [Symbol.dispose](): void;
49
+ finalize(): LowessResultWasm;
50
+ constructor(options: any, streaming_opts: any);
51
+ processChunk(x: Float64Array, y: Float64Array): LowessResultWasm;
52
52
  }
53
53
 
54
54
  export function smooth(x: Float64Array, y: Float64Array, options: any): LowessResultWasm;
@@ -56,71 +56,71 @@ export function smooth(x: Float64Array, y: Float64Array, options: any): LowessRe
56
56
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
57
57
 
58
58
  export interface InitOutput {
59
- readonly memory: WebAssembly.Memory;
60
- readonly __wbg_diagnostics_free: (a: number, b: number) => void;
61
- readonly __wbg_get_diagnostics_aic: (a: number) => [number, number];
62
- readonly __wbg_get_diagnostics_aicc: (a: number) => [number, number];
63
- readonly __wbg_get_diagnostics_effectiveDf: (a: number) => [number, number];
64
- readonly __wbg_get_diagnostics_mae: (a: number) => number;
65
- readonly __wbg_get_diagnostics_rSquared: (a: number) => number;
66
- readonly __wbg_get_diagnostics_residualSd: (a: number) => number;
67
- readonly __wbg_get_diagnostics_rmse: (a: number) => number;
68
- readonly __wbg_lowessresultwasm_free: (a: number, b: number) => void;
69
- readonly __wbg_onlinelowesswasm_free: (a: number, b: number) => void;
70
- readonly __wbg_set_diagnostics_aic: (a: number, b: number, c: number) => void;
71
- readonly __wbg_set_diagnostics_aicc: (a: number, b: number, c: number) => void;
72
- readonly __wbg_set_diagnostics_effectiveDf: (a: number, b: number, c: number) => void;
73
- readonly __wbg_set_diagnostics_mae: (a: number, b: number) => void;
74
- readonly __wbg_set_diagnostics_rSquared: (a: number, b: number) => void;
75
- readonly __wbg_set_diagnostics_residualSd: (a: number, b: number) => void;
76
- readonly __wbg_set_diagnostics_rmse: (a: number, b: number) => void;
77
- readonly __wbg_streaminglowesswasm_free: (a: number, b: number) => void;
78
- readonly lowessresultwasm_confidenceLower: (a: number) => any;
79
- readonly lowessresultwasm_confidenceUpper: (a: number) => any;
80
- readonly lowessresultwasm_cvScores: (a: number) => any;
81
- readonly lowessresultwasm_diagnostics: (a: number) => number;
82
- readonly lowessresultwasm_fractionUsed: (a: number) => number;
83
- readonly lowessresultwasm_iterationsUsed: (a: number) => number;
84
- readonly lowessresultwasm_predictionLower: (a: number) => any;
85
- readonly lowessresultwasm_predictionUpper: (a: number) => any;
86
- readonly lowessresultwasm_residuals: (a: number) => any;
87
- readonly lowessresultwasm_robustnessWeights: (a: number) => any;
88
- readonly lowessresultwasm_standardErrors: (a: number) => any;
89
- readonly lowessresultwasm_x: (a: number) => any;
90
- readonly lowessresultwasm_y: (a: number) => any;
91
- readonly onlinelowesswasm_new: (a: any, b: any) => [number, number, number];
92
- readonly onlinelowesswasm_update: (a: number, b: number, c: number) => [number, number, number, number];
93
- readonly smooth: (a: any, b: any, c: any) => [number, number, number];
94
- readonly streaminglowesswasm_finalize: (a: number) => [number, number, number];
95
- readonly streaminglowesswasm_new: (a: any, b: any) => [number, number, number];
96
- readonly streaminglowesswasm_processChunk: (a: number, b: any, c: any) => [number, number, number];
97
- readonly __wbindgen_malloc: (a: number, b: number) => number;
98
- readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
99
- readonly __wbindgen_exn_store: (a: number) => void;
100
- readonly __externref_table_alloc: () => number;
101
- readonly __wbindgen_externrefs: WebAssembly.Table;
102
- readonly __externref_table_dealloc: (a: number) => void;
103
- readonly __wbindgen_start: () => void;
59
+ readonly memory: WebAssembly.Memory;
60
+ readonly __wbg_diagnostics_free: (a: number, b: number) => void;
61
+ readonly __wbg_get_diagnostics_aic: (a: number) => [number, number];
62
+ readonly __wbg_get_diagnostics_aicc: (a: number) => [number, number];
63
+ readonly __wbg_get_diagnostics_effectiveDf: (a: number) => [number, number];
64
+ readonly __wbg_get_diagnostics_mae: (a: number) => number;
65
+ readonly __wbg_get_diagnostics_rSquared: (a: number) => number;
66
+ readonly __wbg_get_diagnostics_residualSd: (a: number) => number;
67
+ readonly __wbg_get_diagnostics_rmse: (a: number) => number;
68
+ readonly __wbg_lowessresultwasm_free: (a: number, b: number) => void;
69
+ readonly __wbg_onlinelowesswasm_free: (a: number, b: number) => void;
70
+ readonly __wbg_set_diagnostics_aic: (a: number, b: number, c: number) => void;
71
+ readonly __wbg_set_diagnostics_aicc: (a: number, b: number, c: number) => void;
72
+ readonly __wbg_set_diagnostics_effectiveDf: (a: number, b: number, c: number) => void;
73
+ readonly __wbg_set_diagnostics_mae: (a: number, b: number) => void;
74
+ readonly __wbg_set_diagnostics_rSquared: (a: number, b: number) => void;
75
+ readonly __wbg_set_diagnostics_residualSd: (a: number, b: number) => void;
76
+ readonly __wbg_set_diagnostics_rmse: (a: number, b: number) => void;
77
+ readonly __wbg_streaminglowesswasm_free: (a: number, b: number) => void;
78
+ readonly lowessresultwasm_confidenceLower: (a: number) => any;
79
+ readonly lowessresultwasm_confidenceUpper: (a: number) => any;
80
+ readonly lowessresultwasm_cvScores: (a: number) => any;
81
+ readonly lowessresultwasm_diagnostics: (a: number) => number;
82
+ readonly lowessresultwasm_fractionUsed: (a: number) => number;
83
+ readonly lowessresultwasm_iterationsUsed: (a: number) => number;
84
+ readonly lowessresultwasm_predictionLower: (a: number) => any;
85
+ readonly lowessresultwasm_predictionUpper: (a: number) => any;
86
+ readonly lowessresultwasm_residuals: (a: number) => any;
87
+ readonly lowessresultwasm_robustnessWeights: (a: number) => any;
88
+ readonly lowessresultwasm_standardErrors: (a: number) => any;
89
+ readonly lowessresultwasm_x: (a: number) => any;
90
+ readonly lowessresultwasm_y: (a: number) => any;
91
+ readonly onlinelowesswasm_new: (a: any, b: any) => [number, number, number];
92
+ readonly onlinelowesswasm_update: (a: number, b: number, c: number) => [number, number, number, number];
93
+ readonly smooth: (a: any, b: any, c: any) => [number, number, number];
94
+ readonly streaminglowesswasm_finalize: (a: number) => [number, number, number];
95
+ readonly streaminglowesswasm_new: (a: any, b: any) => [number, number, number];
96
+ readonly streaminglowesswasm_processChunk: (a: number, b: any, c: any) => [number, number, number];
97
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
98
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
99
+ readonly __wbindgen_exn_store: (a: number) => void;
100
+ readonly __externref_table_alloc: () => number;
101
+ readonly __wbindgen_externrefs: WebAssembly.Table;
102
+ readonly __externref_table_dealloc: (a: number) => void;
103
+ readonly __wbindgen_start: () => void;
104
104
  }
105
105
 
106
106
  export type SyncInitInput = BufferSource | WebAssembly.Module;
107
107
 
108
108
  /**
109
- * Instantiates the given `module`, which can either be bytes or
110
- * a precompiled `WebAssembly.Module`.
111
- *
112
- * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
113
- *
114
- * @returns {InitOutput}
115
- */
109
+ * Instantiates the given `module`, which can either be bytes or
110
+ * a precompiled `WebAssembly.Module`.
111
+ *
112
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
113
+ *
114
+ * @returns {InitOutput}
115
+ */
116
116
  export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
117
117
 
118
118
  /**
119
- * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
120
- * for everything else, calls `WebAssembly.instantiate` directly.
121
- *
122
- * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
123
- *
124
- * @returns {Promise<InitOutput>}
125
- */
119
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
120
+ * for everything else, calls `WebAssembly.instantiate` directly.
121
+ *
122
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
123
+ *
124
+ * @returns {Promise<InitOutput>}
125
+ */
126
126
  export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
@@ -1,145 +1,4 @@
1
- let wasm;
2
-
3
- function addToExternrefTable0(obj) {
4
- const idx = wasm.__externref_table_alloc();
5
- wasm.__wbindgen_externrefs.set(idx, obj);
6
- return idx;
7
- }
8
-
9
- function getArrayF64FromWasm0(ptr, len) {
10
- ptr = ptr >>> 0;
11
- return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
12
- }
13
-
14
- let cachedDataViewMemory0 = null;
15
- function getDataViewMemory0() {
16
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
17
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
18
- }
19
- return cachedDataViewMemory0;
20
- }
21
-
22
- let cachedFloat64ArrayMemory0 = null;
23
- function getFloat64ArrayMemory0() {
24
- if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
25
- cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
26
- }
27
- return cachedFloat64ArrayMemory0;
28
- }
29
-
30
- function getStringFromWasm0(ptr, len) {
31
- ptr = ptr >>> 0;
32
- return decodeText(ptr, len);
33
- }
34
-
35
- let cachedUint8ArrayMemory0 = null;
36
- function getUint8ArrayMemory0() {
37
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
38
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
39
- }
40
- return cachedUint8ArrayMemory0;
41
- }
42
-
43
- function handleError(f, args) {
44
- try {
45
- return f.apply(this, args);
46
- } catch (e) {
47
- const idx = addToExternrefTable0(e);
48
- wasm.__wbindgen_exn_store(idx);
49
- }
50
- }
51
-
52
- function isLikeNone(x) {
53
- return x === undefined || x === null;
54
- }
55
-
56
- function passStringToWasm0(arg, malloc, realloc) {
57
- if (realloc === undefined) {
58
- const buf = cachedTextEncoder.encode(arg);
59
- const ptr = malloc(buf.length, 1) >>> 0;
60
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
61
- WASM_VECTOR_LEN = buf.length;
62
- return ptr;
63
- }
64
-
65
- let len = arg.length;
66
- let ptr = malloc(len, 1) >>> 0;
67
-
68
- const mem = getUint8ArrayMemory0();
69
-
70
- let offset = 0;
71
-
72
- for (; offset < len; offset++) {
73
- const code = arg.charCodeAt(offset);
74
- if (code > 0x7F) break;
75
- mem[ptr + offset] = code;
76
- }
77
- if (offset !== len) {
78
- if (offset !== 0) {
79
- arg = arg.slice(offset);
80
- }
81
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
82
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
83
- const ret = cachedTextEncoder.encodeInto(arg, view);
84
-
85
- offset += ret.written;
86
- ptr = realloc(ptr, len, offset, 1) >>> 0;
87
- }
88
-
89
- WASM_VECTOR_LEN = offset;
90
- return ptr;
91
- }
92
-
93
- function takeFromExternrefTable0(idx) {
94
- const value = wasm.__wbindgen_externrefs.get(idx);
95
- wasm.__externref_table_dealloc(idx);
96
- return value;
97
- }
98
-
99
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
100
- cachedTextDecoder.decode();
101
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
102
- let numBytesDecoded = 0;
103
- function decodeText(ptr, len) {
104
- numBytesDecoded += len;
105
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
106
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
107
- cachedTextDecoder.decode();
108
- numBytesDecoded = len;
109
- }
110
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
111
- }
112
-
113
- const cachedTextEncoder = new TextEncoder();
114
-
115
- if (!('encodeInto' in cachedTextEncoder)) {
116
- cachedTextEncoder.encodeInto = function (arg, view) {
117
- const buf = cachedTextEncoder.encode(arg);
118
- view.set(buf);
119
- return {
120
- read: arg.length,
121
- written: buf.length
122
- };
123
- }
124
- }
125
-
126
- let WASM_VECTOR_LEN = 0;
127
-
128
- const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
129
- ? { register: () => {}, unregister: () => {} }
130
- : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
131
-
132
- const LowessResultWasmFinalization = (typeof FinalizationRegistry === 'undefined')
133
- ? { register: () => {}, unregister: () => {} }
134
- : new FinalizationRegistry(ptr => wasm.__wbg_lowessresultwasm_free(ptr >>> 0, 1));
135
-
136
- const OnlineLowessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
137
- ? { register: () => {}, unregister: () => {} }
138
- : new FinalizationRegistry(ptr => wasm.__wbg_onlinelowesswasm_free(ptr >>> 0, 1));
139
-
140
- const StreamingLowessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
141
- ? { register: () => {}, unregister: () => {} }
142
- : new FinalizationRegistry(ptr => wasm.__wbg_streaminglowesswasm_free(ptr >>> 0, 1));
1
+ /* @ts-self-types="./fastlowess_wasm.d.ts" */
143
2
 
144
3
  export class Diagnostics {
145
4
  static __wrap(ptr) {
@@ -160,17 +19,25 @@ export class Diagnostics {
160
19
  wasm.__wbg_diagnostics_free(ptr, 0);
161
20
  }
162
21
  /**
163
- * @returns {number}
22
+ * @returns {number | undefined}
164
23
  */
165
- get rmse() {
166
- const ret = wasm.__wbg_get_diagnostics_rmse(this.__wbg_ptr);
167
- return ret;
24
+ get aic() {
25
+ const ret = wasm.__wbg_get_diagnostics_aic(this.__wbg_ptr);
26
+ return ret[0] === 0 ? undefined : ret[1];
168
27
  }
169
28
  /**
170
- * @param {number} arg0
29
+ * @returns {number | undefined}
171
30
  */
172
- set rmse(arg0) {
173
- wasm.__wbg_set_diagnostics_rmse(this.__wbg_ptr, arg0);
31
+ get aicc() {
32
+ const ret = wasm.__wbg_get_diagnostics_aicc(this.__wbg_ptr);
33
+ return ret[0] === 0 ? undefined : ret[1];
34
+ }
35
+ /**
36
+ * @returns {number | undefined}
37
+ */
38
+ get effectiveDf() {
39
+ const ret = wasm.__wbg_get_diagnostics_effectiveDf(this.__wbg_ptr);
40
+ return ret[0] === 0 ? undefined : ret[1];
174
41
  }
175
42
  /**
176
43
  * @returns {number}
@@ -179,12 +46,6 @@ export class Diagnostics {
179
46
  const ret = wasm.__wbg_get_diagnostics_mae(this.__wbg_ptr);
180
47
  return ret;
181
48
  }
182
- /**
183
- * @param {number} arg0
184
- */
185
- set mae(arg0) {
186
- wasm.__wbg_set_diagnostics_mae(this.__wbg_ptr, arg0);
187
- }
188
49
  /**
189
50
  * @returns {number}
190
51
  */
@@ -193,17 +54,18 @@ export class Diagnostics {
193
54
  return ret;
194
55
  }
195
56
  /**
196
- * @param {number} arg0
57
+ * @returns {number}
197
58
  */
198
- set rSquared(arg0) {
199
- wasm.__wbg_set_diagnostics_rSquared(this.__wbg_ptr, arg0);
59
+ get residualSd() {
60
+ const ret = wasm.__wbg_get_diagnostics_residualSd(this.__wbg_ptr);
61
+ return ret;
200
62
  }
201
63
  /**
202
- * @returns {number | undefined}
64
+ * @returns {number}
203
65
  */
204
- get aic() {
205
- const ret = wasm.__wbg_get_diagnostics_aic(this.__wbg_ptr);
206
- return ret[0] === 0 ? undefined : ret[1];
66
+ get rmse() {
67
+ const ret = wasm.__wbg_get_diagnostics_rmse(this.__wbg_ptr);
68
+ return ret;
207
69
  }
208
70
  /**
209
71
  * @param {number | null} [arg0]
@@ -211,26 +73,12 @@ export class Diagnostics {
211
73
  set aic(arg0) {
212
74
  wasm.__wbg_set_diagnostics_aic(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0);
213
75
  }
214
- /**
215
- * @returns {number | undefined}
216
- */
217
- get aicc() {
218
- const ret = wasm.__wbg_get_diagnostics_aicc(this.__wbg_ptr);
219
- return ret[0] === 0 ? undefined : ret[1];
220
- }
221
76
  /**
222
77
  * @param {number | null} [arg0]
223
78
  */
224
79
  set aicc(arg0) {
225
80
  wasm.__wbg_set_diagnostics_aicc(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0);
226
81
  }
227
- /**
228
- * @returns {number | undefined}
229
- */
230
- get effectiveDf() {
231
- const ret = wasm.__wbg_get_diagnostics_effectiveDf(this.__wbg_ptr);
232
- return ret[0] === 0 ? undefined : ret[1];
233
- }
234
82
  /**
235
83
  * @param {number | null} [arg0]
236
84
  */
@@ -238,11 +86,16 @@ export class Diagnostics {
238
86
  wasm.__wbg_set_diagnostics_effectiveDf(this.__wbg_ptr, !isLikeNone(arg0), isLikeNone(arg0) ? 0 : arg0);
239
87
  }
240
88
  /**
241
- * @returns {number}
89
+ * @param {number} arg0
242
90
  */
243
- get residualSd() {
244
- const ret = wasm.__wbg_get_diagnostics_residualSd(this.__wbg_ptr);
245
- return ret;
91
+ set mae(arg0) {
92
+ wasm.__wbg_set_diagnostics_mae(this.__wbg_ptr, arg0);
93
+ }
94
+ /**
95
+ * @param {number} arg0
96
+ */
97
+ set rSquared(arg0) {
98
+ wasm.__wbg_set_diagnostics_rSquared(this.__wbg_ptr, arg0);
246
99
  }
247
100
  /**
248
101
  * @param {number} arg0
@@ -250,6 +103,12 @@ export class Diagnostics {
250
103
  set residualSd(arg0) {
251
104
  wasm.__wbg_set_diagnostics_residualSd(this.__wbg_ptr, arg0);
252
105
  }
106
+ /**
107
+ * @param {number} arg0
108
+ */
109
+ set rmse(arg0) {
110
+ wasm.__wbg_set_diagnostics_rmse(this.__wbg_ptr, arg0);
111
+ }
253
112
  }
254
113
  if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
255
114
 
@@ -271,6 +130,27 @@ export class LowessResultWasm {
271
130
  const ptr = this.__destroy_into_raw();
272
131
  wasm.__wbg_lowessresultwasm_free(ptr, 0);
273
132
  }
133
+ /**
134
+ * @returns {Float64Array | undefined}
135
+ */
136
+ get confidenceLower() {
137
+ const ret = wasm.lowessresultwasm_confidenceLower(this.__wbg_ptr);
138
+ return ret;
139
+ }
140
+ /**
141
+ * @returns {Float64Array | undefined}
142
+ */
143
+ get confidenceUpper() {
144
+ const ret = wasm.lowessresultwasm_confidenceUpper(this.__wbg_ptr);
145
+ return ret;
146
+ }
147
+ /**
148
+ * @returns {Float64Array | undefined}
149
+ */
150
+ get cvScores() {
151
+ const ret = wasm.lowessresultwasm_cvScores(this.__wbg_ptr);
152
+ return ret;
153
+ }
274
154
  /**
275
155
  * @returns {Diagnostics | undefined}
276
156
  */
@@ -295,43 +175,36 @@ export class LowessResultWasm {
295
175
  /**
296
176
  * @returns {Float64Array | undefined}
297
177
  */
298
- get standardErrors() {
299
- const ret = wasm.lowessresultwasm_standardErrors(this.__wbg_ptr);
300
- return ret;
301
- }
302
- /**
303
- * @returns {Float64Array | undefined}
304
- */
305
- get confidenceLower() {
306
- const ret = wasm.lowessresultwasm_confidenceLower(this.__wbg_ptr);
178
+ get predictionLower() {
179
+ const ret = wasm.lowessresultwasm_predictionLower(this.__wbg_ptr);
307
180
  return ret;
308
181
  }
309
182
  /**
310
183
  * @returns {Float64Array | undefined}
311
184
  */
312
- get confidenceUpper() {
313
- const ret = wasm.lowessresultwasm_confidenceUpper(this.__wbg_ptr);
185
+ get predictionUpper() {
186
+ const ret = wasm.lowessresultwasm_predictionUpper(this.__wbg_ptr);
314
187
  return ret;
315
188
  }
316
189
  /**
317
190
  * @returns {Float64Array | undefined}
318
191
  */
319
- get predictionLower() {
320
- const ret = wasm.lowessresultwasm_predictionLower(this.__wbg_ptr);
192
+ get residuals() {
193
+ const ret = wasm.lowessresultwasm_residuals(this.__wbg_ptr);
321
194
  return ret;
322
195
  }
323
196
  /**
324
197
  * @returns {Float64Array | undefined}
325
198
  */
326
- get predictionUpper() {
327
- const ret = wasm.lowessresultwasm_predictionUpper(this.__wbg_ptr);
199
+ get robustnessWeights() {
200
+ const ret = wasm.lowessresultwasm_robustnessWeights(this.__wbg_ptr);
328
201
  return ret;
329
202
  }
330
203
  /**
331
204
  * @returns {Float64Array | undefined}
332
205
  */
333
- get robustnessWeights() {
334
- const ret = wasm.lowessresultwasm_robustnessWeights(this.__wbg_ptr);
206
+ get standardErrors() {
207
+ const ret = wasm.lowessresultwasm_standardErrors(this.__wbg_ptr);
335
208
  return ret;
336
209
  }
337
210
  /**
@@ -348,20 +221,6 @@ export class LowessResultWasm {
348
221
  const ret = wasm.lowessresultwasm_y(this.__wbg_ptr);
349
222
  return ret;
350
223
  }
351
- /**
352
- * @returns {Float64Array | undefined}
353
- */
354
- get cvScores() {
355
- const ret = wasm.lowessresultwasm_cvScores(this.__wbg_ptr);
356
- return ret;
357
- }
358
- /**
359
- * @returns {Float64Array | undefined}
360
- */
361
- get residuals() {
362
- const ret = wasm.lowessresultwasm_residuals(this.__wbg_ptr);
363
- return ret;
364
- }
365
224
  }
366
225
  if (Symbol.dispose) LowessResultWasm.prototype[Symbol.dispose] = LowessResultWasm.prototype.free;
367
226
 
@@ -416,12 +275,10 @@ export class StreamingLowessWasm {
416
275
  wasm.__wbg_streaminglowesswasm_free(ptr, 0);
417
276
  }
418
277
  /**
419
- * @param {Float64Array} x
420
- * @param {Float64Array} y
421
278
  * @returns {LowessResultWasm}
422
279
  */
423
- processChunk(x, y) {
424
- const ret = wasm.streaminglowesswasm_processChunk(this.__wbg_ptr, x, y);
280
+ finalize() {
281
+ const ret = wasm.streaminglowesswasm_finalize(this.__wbg_ptr);
425
282
  if (ret[2]) {
426
283
  throw takeFromExternrefTable0(ret[1]);
427
284
  }
@@ -441,10 +298,12 @@ export class StreamingLowessWasm {
441
298
  return this;
442
299
  }
443
300
  /**
301
+ * @param {Float64Array} x
302
+ * @param {Float64Array} y
444
303
  * @returns {LowessResultWasm}
445
304
  */
446
- finalize() {
447
- const ret = wasm.streaminglowesswasm_finalize(this.__wbg_ptr);
305
+ processChunk(x, y) {
306
+ const ret = wasm.streaminglowesswasm_processChunk(this.__wbg_ptr, x, y);
448
307
  if (ret[2]) {
449
308
  throw takeFromExternrefTable0(ret[1]);
450
309
  }
@@ -467,7 +326,236 @@ export function smooth(x, y, options) {
467
326
  return LowessResultWasm.__wrap(ret[0]);
468
327
  }
469
328
 
470
- const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
329
+ function __wbg_get_imports() {
330
+ const import0 = {
331
+ __proto__: null,
332
+ __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
333
+ const v = arg0;
334
+ const ret = typeof(v) === 'boolean' ? v : undefined;
335
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
336
+ },
337
+ __wbg___wbindgen_is_null_ac34f5003991759a: function(arg0) {
338
+ const ret = arg0 === null;
339
+ return ret;
340
+ },
341
+ __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
342
+ const ret = arg0 === undefined;
343
+ return ret;
344
+ },
345
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
346
+ const obj = arg1;
347
+ const ret = typeof(obj) === 'number' ? obj : undefined;
348
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
349
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
350
+ },
351
+ __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
352
+ const obj = arg1;
353
+ const ret = typeof(obj) === 'string' ? obj : undefined;
354
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
355
+ var len1 = WASM_VECTOR_LEN;
356
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
357
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
358
+ },
359
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
360
+ throw new Error(getStringFromWasm0(arg0, arg1));
361
+ },
362
+ __wbg_from_bddd64e7d5ff6941: function(arg0) {
363
+ const ret = Array.from(arg0);
364
+ return ret;
365
+ },
366
+ __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
367
+ const ret = arg0[arg1 >>> 0];
368
+ return ret;
369
+ },
370
+ __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
371
+ const ret = Reflect.get(arg0, arg1);
372
+ return ret;
373
+ }, arguments); },
374
+ __wbg_length_35a7bace40f36eac: function(arg0) {
375
+ const ret = arg0.length;
376
+ return ret;
377
+ },
378
+ __wbg_length_f7386240689107f3: function(arg0) {
379
+ const ret = arg0.length;
380
+ return ret;
381
+ },
382
+ __wbg_prototypesetcall_aefe6319f589ab4b: function(arg0, arg1, arg2) {
383
+ Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
384
+ },
385
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
386
+ // Cast intrinsic for `Ref(Slice(F64)) -> NamedExternref("Float64Array")`.
387
+ const ret = getArrayF64FromWasm0(arg0, arg1);
388
+ return ret;
389
+ },
390
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
391
+ // Cast intrinsic for `Ref(String) -> Externref`.
392
+ const ret = getStringFromWasm0(arg0, arg1);
393
+ return ret;
394
+ },
395
+ __wbindgen_init_externref_table: function() {
396
+ const table = wasm.__wbindgen_externrefs;
397
+ const offset = table.grow(4);
398
+ table.set(0, undefined);
399
+ table.set(offset + 0, undefined);
400
+ table.set(offset + 1, null);
401
+ table.set(offset + 2, true);
402
+ table.set(offset + 3, false);
403
+ },
404
+ };
405
+ return {
406
+ __proto__: null,
407
+ "./fastlowess_wasm_bg.js": import0,
408
+ };
409
+ }
410
+
411
+ const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
412
+ ? { register: () => {}, unregister: () => {} }
413
+ : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
414
+ const LowessResultWasmFinalization = (typeof FinalizationRegistry === 'undefined')
415
+ ? { register: () => {}, unregister: () => {} }
416
+ : new FinalizationRegistry(ptr => wasm.__wbg_lowessresultwasm_free(ptr >>> 0, 1));
417
+ const OnlineLowessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
418
+ ? { register: () => {}, unregister: () => {} }
419
+ : new FinalizationRegistry(ptr => wasm.__wbg_onlinelowesswasm_free(ptr >>> 0, 1));
420
+ const StreamingLowessWasmFinalization = (typeof FinalizationRegistry === 'undefined')
421
+ ? { register: () => {}, unregister: () => {} }
422
+ : new FinalizationRegistry(ptr => wasm.__wbg_streaminglowesswasm_free(ptr >>> 0, 1));
423
+
424
+ function addToExternrefTable0(obj) {
425
+ const idx = wasm.__externref_table_alloc();
426
+ wasm.__wbindgen_externrefs.set(idx, obj);
427
+ return idx;
428
+ }
429
+
430
+ function getArrayF64FromWasm0(ptr, len) {
431
+ ptr = ptr >>> 0;
432
+ return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
433
+ }
434
+
435
+ let cachedDataViewMemory0 = null;
436
+ function getDataViewMemory0() {
437
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
438
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
439
+ }
440
+ return cachedDataViewMemory0;
441
+ }
442
+
443
+ let cachedFloat64ArrayMemory0 = null;
444
+ function getFloat64ArrayMemory0() {
445
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
446
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
447
+ }
448
+ return cachedFloat64ArrayMemory0;
449
+ }
450
+
451
+ function getStringFromWasm0(ptr, len) {
452
+ ptr = ptr >>> 0;
453
+ return decodeText(ptr, len);
454
+ }
455
+
456
+ let cachedUint8ArrayMemory0 = null;
457
+ function getUint8ArrayMemory0() {
458
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
459
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
460
+ }
461
+ return cachedUint8ArrayMemory0;
462
+ }
463
+
464
+ function handleError(f, args) {
465
+ try {
466
+ return f.apply(this, args);
467
+ } catch (e) {
468
+ const idx = addToExternrefTable0(e);
469
+ wasm.__wbindgen_exn_store(idx);
470
+ }
471
+ }
472
+
473
+ function isLikeNone(x) {
474
+ return x === undefined || x === null;
475
+ }
476
+
477
+ function passStringToWasm0(arg, malloc, realloc) {
478
+ if (realloc === undefined) {
479
+ const buf = cachedTextEncoder.encode(arg);
480
+ const ptr = malloc(buf.length, 1) >>> 0;
481
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
482
+ WASM_VECTOR_LEN = buf.length;
483
+ return ptr;
484
+ }
485
+
486
+ let len = arg.length;
487
+ let ptr = malloc(len, 1) >>> 0;
488
+
489
+ const mem = getUint8ArrayMemory0();
490
+
491
+ let offset = 0;
492
+
493
+ for (; offset < len; offset++) {
494
+ const code = arg.charCodeAt(offset);
495
+ if (code > 0x7F) break;
496
+ mem[ptr + offset] = code;
497
+ }
498
+ if (offset !== len) {
499
+ if (offset !== 0) {
500
+ arg = arg.slice(offset);
501
+ }
502
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
503
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
504
+ const ret = cachedTextEncoder.encodeInto(arg, view);
505
+
506
+ offset += ret.written;
507
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
508
+ }
509
+
510
+ WASM_VECTOR_LEN = offset;
511
+ return ptr;
512
+ }
513
+
514
+ function takeFromExternrefTable0(idx) {
515
+ const value = wasm.__wbindgen_externrefs.get(idx);
516
+ wasm.__externref_table_dealloc(idx);
517
+ return value;
518
+ }
519
+
520
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
521
+ cachedTextDecoder.decode();
522
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
523
+ let numBytesDecoded = 0;
524
+ function decodeText(ptr, len) {
525
+ numBytesDecoded += len;
526
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
527
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
528
+ cachedTextDecoder.decode();
529
+ numBytesDecoded = len;
530
+ }
531
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
532
+ }
533
+
534
+ const cachedTextEncoder = new TextEncoder();
535
+
536
+ if (!('encodeInto' in cachedTextEncoder)) {
537
+ cachedTextEncoder.encodeInto = function (arg, view) {
538
+ const buf = cachedTextEncoder.encode(arg);
539
+ view.set(buf);
540
+ return {
541
+ read: arg.length,
542
+ written: buf.length
543
+ };
544
+ };
545
+ }
546
+
547
+ let WASM_VECTOR_LEN = 0;
548
+
549
+ let wasmModule, wasm;
550
+ function __wbg_finalize_init(instance, module) {
551
+ wasm = instance.exports;
552
+ wasmModule = module;
553
+ cachedDataViewMemory0 = null;
554
+ cachedFloat64ArrayMemory0 = null;
555
+ cachedUint8ArrayMemory0 = null;
556
+ wasm.__wbindgen_start();
557
+ return wasm;
558
+ }
471
559
 
472
560
  async function __wbg_load(module, imports) {
473
561
  if (typeof Response === 'function' && module instanceof Response) {
@@ -475,14 +563,12 @@ async function __wbg_load(module, imports) {
475
563
  try {
476
564
  return await WebAssembly.instantiateStreaming(module, imports);
477
565
  } catch (e) {
478
- const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
566
+ const validResponse = module.ok && expectedResponseType(module.type);
479
567
 
480
568
  if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
481
569
  console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
482
570
 
483
- } else {
484
- throw e;
485
- }
571
+ } else { throw e; }
486
572
  }
487
573
  }
488
574
 
@@ -497,104 +583,20 @@ async function __wbg_load(module, imports) {
497
583
  return instance;
498
584
  }
499
585
  }
500
- }
501
-
502
- function __wbg_get_imports() {
503
- const imports = {};
504
- imports.wbg = {};
505
- imports.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
506
- const v = arg0;
507
- const ret = typeof(v) === 'boolean' ? v : undefined;
508
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
509
- };
510
- imports.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5 = function(arg0) {
511
- const ret = arg0 === null;
512
- return ret;
513
- };
514
- imports.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
515
- const ret = arg0 === undefined;
516
- return ret;
517
- };
518
- imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
519
- const obj = arg1;
520
- const ret = typeof(obj) === 'number' ? obj : undefined;
521
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
522
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
523
- };
524
- imports.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
525
- const obj = arg1;
526
- const ret = typeof(obj) === 'string' ? obj : undefined;
527
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
528
- var len1 = WASM_VECTOR_LEN;
529
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
530
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
531
- };
532
- imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
533
- throw new Error(getStringFromWasm0(arg0, arg1));
534
- };
535
- imports.wbg.__wbg_from_29a8414a7a7cd19d = function(arg0) {
536
- const ret = Array.from(arg0);
537
- return ret;
538
- };
539
- imports.wbg.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
540
- const ret = arg0[arg1 >>> 0];
541
- return ret;
542
- };
543
- imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
544
- const ret = Reflect.get(arg0, arg1);
545
- return ret;
546
- }, arguments) };
547
- imports.wbg.__wbg_length_406f6daaaa453057 = function(arg0) {
548
- const ret = arg0.length;
549
- return ret;
550
- };
551
- imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
552
- const ret = arg0.length;
553
- return ret;
554
- };
555
- imports.wbg.__wbg_prototypesetcall_d3c4edbb4ef96ca1 = function(arg0, arg1, arg2) {
556
- Float64Array.prototype.set.call(getArrayF64FromWasm0(arg0, arg1), arg2);
557
- };
558
- imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
559
- // Cast intrinsic for `Ref(String) -> Externref`.
560
- const ret = getStringFromWasm0(arg0, arg1);
561
- return ret;
562
- };
563
- imports.wbg.__wbindgen_cast_4af8e60a922bcf35 = function(arg0, arg1) {
564
- // Cast intrinsic for `Ref(Slice(F64)) -> NamedExternref("Float64Array")`.
565
- const ret = getArrayF64FromWasm0(arg0, arg1);
566
- return ret;
567
- };
568
- imports.wbg.__wbindgen_init_externref_table = function() {
569
- const table = wasm.__wbindgen_externrefs;
570
- const offset = table.grow(4);
571
- table.set(0, undefined);
572
- table.set(offset + 0, undefined);
573
- table.set(offset + 1, null);
574
- table.set(offset + 2, true);
575
- table.set(offset + 3, false);
576
- };
577
-
578
- return imports;
579
- }
580
586
 
581
- function __wbg_finalize_init(instance, module) {
582
- wasm = instance.exports;
583
- __wbg_init.__wbindgen_wasm_module = module;
584
- cachedDataViewMemory0 = null;
585
- cachedFloat64ArrayMemory0 = null;
586
- cachedUint8ArrayMemory0 = null;
587
-
588
-
589
- wasm.__wbindgen_start();
590
- return wasm;
587
+ function expectedResponseType(type) {
588
+ switch (type) {
589
+ case 'basic': case 'cors': case 'default': return true;
590
+ }
591
+ return false;
592
+ }
591
593
  }
592
594
 
593
595
  function initSync(module) {
594
596
  if (wasm !== undefined) return wasm;
595
597
 
596
598
 
597
- if (typeof module !== 'undefined') {
599
+ if (module !== undefined) {
598
600
  if (Object.getPrototypeOf(module) === Object.prototype) {
599
601
  ({module} = module)
600
602
  } else {
@@ -614,7 +616,7 @@ async function __wbg_init(module_or_path) {
614
616
  if (wasm !== undefined) return wasm;
615
617
 
616
618
 
617
- if (typeof module_or_path !== 'undefined') {
619
+ if (module_or_path !== undefined) {
618
620
  if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
619
621
  ({module_or_path} = module_or_path)
620
622
  } else {
@@ -622,7 +624,7 @@ async function __wbg_init(module_or_path) {
622
624
  }
623
625
  }
624
626
 
625
- if (typeof module_or_path === 'undefined') {
627
+ if (module_or_path === undefined) {
626
628
  module_or_path = new URL('fastlowess_wasm_bg.wasm', import.meta.url);
627
629
  }
628
630
  const imports = __wbg_get_imports();
@@ -636,5 +638,4 @@ async function __wbg_init(module_or_path) {
636
638
  return __wbg_finalize_init(instance, module);
637
639
  }
638
640
 
639
- export { initSync };
640
- export default __wbg_init;
641
+ export { initSync, __wbg_init as default };
Binary file
package/package.json CHANGED
@@ -1,16 +1,32 @@
1
1
  {
2
2
  "name": "fastlowess-wasm",
3
3
  "type": "module",
4
- "version": "0.99.8",
4
+ "collaborators": [
5
+ "Amir Valizadeh <thisisamirv@gmail.com>"
6
+ ],
7
+ "description": "High-performance LOWESS (Locally Weighted Scatterplot Smoothing)",
8
+ "version": "0.99.9",
5
9
  "license": "MIT OR Apache-2.0",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/thisisamirv/lowess-project"
13
+ },
6
14
  "files": [
7
15
  "fastlowess_wasm_bg.wasm",
8
16
  "fastlowess_wasm.js",
9
17
  "fastlowess_wasm.d.ts"
10
18
  ],
11
19
  "main": "fastlowess_wasm.js",
20
+ "homepage": "https://github.com/thisisamirv/lowess-project",
12
21
  "types": "fastlowess_wasm.d.ts",
13
22
  "sideEffects": [
14
23
  "./snippets/*"
24
+ ],
25
+ "keywords": [
26
+ "lowess",
27
+ "smoothing",
28
+ "statistics",
29
+ "regression",
30
+ "bioinformatics"
15
31
  ]
16
32
  }