@milaboratories/pl-model-common 1.7.0 → 1.8.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/dist/drivers/pframe/column_filter.d.ts +2 -0
- package/dist/drivers/pframe/column_filter.d.ts.map +1 -1
- package/dist/drivers/pframe/data.d.ts +45 -0
- package/dist/drivers/pframe/data.d.ts.map +1 -1
- package/dist/drivers/pframe/table_calculate.d.ts +1 -34
- package/dist/drivers/pframe/table_calculate.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +216 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/drivers/pframe/column_filter.ts +3 -0
- package/src/drivers/pframe/data.ts +160 -0
- package/src/drivers/pframe/table_calculate.ts +1 -56
package/dist/index.mjs
CHANGED
|
@@ -1,198 +1,284 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
}
|
|
5
|
-
function c(
|
|
6
|
-
throw new Error("Unexpected object: " +
|
|
7
|
-
}
|
|
8
|
-
const
|
|
9
|
-
function
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
}
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
return JSON.parse(decodeURIComponent(
|
|
19
|
-
} else if (
|
|
20
|
-
const
|
|
21
|
-
return JSON.parse(decodeURIComponent(
|
|
1
|
+
import { z as i } from "zod";
|
|
2
|
+
function B(t) {
|
|
3
|
+
return t !== void 0 && t.startsWith("log+live://log/");
|
|
4
|
+
}
|
|
5
|
+
function c(t) {
|
|
6
|
+
throw new Error("Unexpected object: " + t);
|
|
7
|
+
}
|
|
8
|
+
const d = "upload://upload/", m = "index://index/";
|
|
9
|
+
function y(t) {
|
|
10
|
+
return t.startsWith(d);
|
|
11
|
+
}
|
|
12
|
+
function b(t) {
|
|
13
|
+
return t.startsWith(m);
|
|
14
|
+
}
|
|
15
|
+
function g(t) {
|
|
16
|
+
if (b(t)) {
|
|
17
|
+
const n = t.slice(m.length);
|
|
18
|
+
return JSON.parse(decodeURIComponent(n)).path;
|
|
19
|
+
} else if (y(t)) {
|
|
20
|
+
const n = t.slice(d.length);
|
|
21
|
+
return JSON.parse(decodeURIComponent(n)).localPath;
|
|
22
|
+
}
|
|
23
|
+
c(t);
|
|
24
|
+
}
|
|
25
|
+
function w(t) {
|
|
26
|
+
return t.replace(/^.*[\\/]/, "");
|
|
27
|
+
}
|
|
28
|
+
function D(t) {
|
|
29
|
+
return w(g(t));
|
|
30
|
+
}
|
|
31
|
+
const N = -2147483648, a = -9007199254740991n, P = NaN, h = NaN, x = null, E = null;
|
|
32
|
+
function f(t, n) {
|
|
33
|
+
switch (n) {
|
|
34
|
+
case "Int":
|
|
35
|
+
return t === N;
|
|
36
|
+
case "Long":
|
|
37
|
+
return t === Number(a) || t === a;
|
|
38
|
+
case "Float":
|
|
39
|
+
return t === P;
|
|
40
|
+
case "Double":
|
|
41
|
+
return t === h;
|
|
42
|
+
case "String":
|
|
43
|
+
return t === x;
|
|
44
|
+
case "Bytes":
|
|
45
|
+
return t === E;
|
|
46
|
+
default:
|
|
47
|
+
throw Error(`unsupported data type: ${n}`);
|
|
22
48
|
}
|
|
23
|
-
c(n);
|
|
24
49
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
50
|
+
function R(t) {
|
|
51
|
+
if (!V(t)) throw new Error(`Expected not-NA PValue, got ${t}`);
|
|
52
|
+
return t;
|
|
27
53
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
54
|
+
function V(t, n) {
|
|
55
|
+
if (!n)
|
|
56
|
+
return typeof t == "string" || typeof t == "number" && isFinite(t) || typeof t == "bigint";
|
|
57
|
+
if (f(t, n)) return !1;
|
|
58
|
+
switch (n) {
|
|
59
|
+
case "Int":
|
|
60
|
+
return typeof t == "number";
|
|
61
|
+
case "Long":
|
|
62
|
+
return typeof t == "number" || typeof t == "bigint";
|
|
63
|
+
case "Float":
|
|
64
|
+
return typeof t == "number";
|
|
65
|
+
case "Double":
|
|
66
|
+
return typeof t == "number";
|
|
67
|
+
case "String":
|
|
68
|
+
return typeof t == "string";
|
|
69
|
+
case "Bytes":
|
|
70
|
+
throw Error("Bytes not yet supported");
|
|
71
|
+
default:
|
|
72
|
+
throw Error(`unsupported data type: ${n}`);
|
|
73
|
+
}
|
|
30
74
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
75
|
+
function I(t, n) {
|
|
76
|
+
if (!n)
|
|
77
|
+
return t === null || typeof t == "string" || typeof t == "number" || typeof t == "bigint";
|
|
78
|
+
if (f(t, n)) return !0;
|
|
79
|
+
switch (n) {
|
|
34
80
|
case "Int":
|
|
35
|
-
return
|
|
81
|
+
return typeof t == "number";
|
|
36
82
|
case "Long":
|
|
37
|
-
return
|
|
83
|
+
return typeof t == "number" || typeof t == "bigint";
|
|
38
84
|
case "Float":
|
|
39
|
-
return
|
|
85
|
+
return typeof t == "number";
|
|
40
86
|
case "Double":
|
|
41
|
-
return
|
|
87
|
+
return typeof t == "number";
|
|
42
88
|
case "String":
|
|
43
|
-
return
|
|
89
|
+
return typeof t == "string";
|
|
44
90
|
case "Bytes":
|
|
45
|
-
|
|
91
|
+
throw Error("Bytes not yet supported");
|
|
46
92
|
default:
|
|
47
|
-
throw Error(`unsupported data type: ${
|
|
93
|
+
throw Error(`unsupported data type: ${n}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
function L(t) {
|
|
97
|
+
if (t === null || typeof t == "string" || typeof t == "number") return t;
|
|
98
|
+
if (typeof t == "bigint") return { bigint: t.toString() };
|
|
99
|
+
throw new Error(`Type ${typeof t} (value ${t}) not yet supported.`);
|
|
100
|
+
}
|
|
101
|
+
function $(t, n) {
|
|
102
|
+
if (t === null || typeof t == "string" || typeof t == "number" || typeof t == "bigint") {
|
|
103
|
+
if (n && !f(t, n) && !I(t, n))
|
|
104
|
+
throw new Error(`Unexpected value type, got ${typeof t}, expected ${n}`);
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
if (typeof t == "object" && t !== null && "bigint" in t && typeof t.bigint == "string") {
|
|
108
|
+
if (n && n !== "Long")
|
|
109
|
+
throw new Error(`Unexpected value type, got serialized bigint, expected ${n}`);
|
|
110
|
+
return BigInt(t.bigint);
|
|
111
|
+
}
|
|
112
|
+
throw new Error(`Unsupported type ${typeof t} (value ${t}).`);
|
|
113
|
+
}
|
|
114
|
+
function O(t) {
|
|
115
|
+
if (t = k(t), t === null) throw new Error("Value is null");
|
|
116
|
+
return t;
|
|
117
|
+
}
|
|
118
|
+
function k(t) {
|
|
119
|
+
if (t = $(t), t === null) return null;
|
|
120
|
+
if (typeof t == "string") return t;
|
|
121
|
+
if (typeof t == "number") {
|
|
122
|
+
if (!isFinite(t)) throw new Error(`Value is not finite (${t})`);
|
|
123
|
+
return t;
|
|
48
124
|
}
|
|
125
|
+
if (typeof t == "bigint")
|
|
126
|
+
return Number(t);
|
|
127
|
+
throw new Error(`Unexpected value type: ${typeof t}`);
|
|
49
128
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
return (
|
|
129
|
+
function _(t, n) {
|
|
130
|
+
const r = Math.floor(n / 8), e = 1 << 7 - n % 8;
|
|
131
|
+
return (t[r] & e) > 0;
|
|
53
132
|
}
|
|
54
|
-
function
|
|
55
|
-
const { type:
|
|
56
|
-
return { type:
|
|
133
|
+
function A(t) {
|
|
134
|
+
const { type: n, name: r, domain: e } = t;
|
|
135
|
+
return { type: n, name: r, ...e && { domain: e } };
|
|
57
136
|
}
|
|
58
|
-
function
|
|
59
|
-
return
|
|
137
|
+
function j(t) {
|
|
138
|
+
return t.map(A);
|
|
60
139
|
}
|
|
61
|
-
function
|
|
62
|
-
if (
|
|
63
|
-
if (
|
|
64
|
-
for (const
|
|
65
|
-
if (
|
|
140
|
+
function F(t, n) {
|
|
141
|
+
if (t === void 0) return n === void 0;
|
|
142
|
+
if (n === void 0) return !0;
|
|
143
|
+
for (const r in n)
|
|
144
|
+
if (t[r] !== n[r]) return !1;
|
|
66
145
|
return !0;
|
|
67
146
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
147
|
+
function H(t, n) {
|
|
148
|
+
return t.name === n.name && F(t.domain, n.domain);
|
|
70
149
|
}
|
|
71
|
-
function
|
|
72
|
-
return { ...
|
|
150
|
+
function J(t, n) {
|
|
151
|
+
return { ...t, src: s(t.src, n) };
|
|
73
152
|
}
|
|
74
|
-
function
|
|
75
|
-
switch (
|
|
153
|
+
function s(t, n) {
|
|
154
|
+
switch (t.type) {
|
|
76
155
|
case "column":
|
|
77
156
|
return {
|
|
78
157
|
type: "column",
|
|
79
|
-
column: t
|
|
158
|
+
column: n(t.column)
|
|
80
159
|
};
|
|
81
160
|
case "inner":
|
|
82
161
|
case "full":
|
|
83
162
|
return {
|
|
84
|
-
type:
|
|
85
|
-
entries:
|
|
163
|
+
type: t.type,
|
|
164
|
+
entries: t.entries.map((r) => s(r, n))
|
|
86
165
|
};
|
|
87
166
|
case "outer":
|
|
88
167
|
return {
|
|
89
168
|
type: "outer",
|
|
90
|
-
primary:
|
|
91
|
-
secondary:
|
|
169
|
+
primary: s(t.primary, n),
|
|
170
|
+
secondary: t.secondary.map((r) => s(r, n))
|
|
92
171
|
};
|
|
93
172
|
default:
|
|
94
|
-
c(
|
|
173
|
+
c(t);
|
|
95
174
|
}
|
|
96
175
|
}
|
|
97
|
-
const
|
|
98
|
-
__isRef:
|
|
99
|
-
blockId:
|
|
100
|
-
name:
|
|
176
|
+
const W = { href: "/" }, z = i.object({
|
|
177
|
+
__isRef: i.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
178
|
+
blockId: i.string().describe("Upstream block id"),
|
|
179
|
+
name: i.string().describe("Name of the output provided to the upstream block's output context")
|
|
101
180
|
}).describe(
|
|
102
181
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
103
182
|
).strict().readonly();
|
|
104
|
-
function
|
|
105
|
-
return
|
|
183
|
+
function M(t, n) {
|
|
184
|
+
return t.blockId === n.blockId && t.name === n.name;
|
|
106
185
|
}
|
|
107
|
-
function
|
|
108
|
-
return
|
|
186
|
+
function o(t) {
|
|
187
|
+
return t.kind === "PColumn";
|
|
109
188
|
}
|
|
110
|
-
function
|
|
111
|
-
return
|
|
189
|
+
function S(t) {
|
|
190
|
+
return o(t.spec);
|
|
112
191
|
}
|
|
113
|
-
function
|
|
114
|
-
return
|
|
192
|
+
function q(t) {
|
|
193
|
+
return o(t.obj);
|
|
115
194
|
}
|
|
116
|
-
function
|
|
117
|
-
return
|
|
195
|
+
function G(t) {
|
|
196
|
+
return o(t.obj.spec);
|
|
118
197
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
121
|
-
return
|
|
198
|
+
function K(t) {
|
|
199
|
+
if (!S(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
|
|
200
|
+
return t;
|
|
122
201
|
}
|
|
123
|
-
function
|
|
124
|
-
return
|
|
125
|
-
...
|
|
126
|
-
data: t
|
|
202
|
+
function Q(t, n) {
|
|
203
|
+
return t === void 0 ? void 0 : {
|
|
204
|
+
...t,
|
|
205
|
+
data: n(t.data)
|
|
127
206
|
};
|
|
128
207
|
}
|
|
129
|
-
function
|
|
130
|
-
throw new Error("Unexpected object: " +
|
|
208
|
+
function C(t) {
|
|
209
|
+
throw new Error("Unexpected object: " + t);
|
|
131
210
|
}
|
|
132
|
-
function u(
|
|
133
|
-
switch (
|
|
211
|
+
function u(t, n) {
|
|
212
|
+
switch (t.type) {
|
|
134
213
|
case "and":
|
|
135
|
-
for (const
|
|
136
|
-
if (!u(
|
|
214
|
+
for (const r of t.operands)
|
|
215
|
+
if (!u(r, n)) return !1;
|
|
137
216
|
return !0;
|
|
138
217
|
case "or":
|
|
139
|
-
for (const
|
|
140
|
-
if (u(
|
|
218
|
+
for (const r of t.operands)
|
|
219
|
+
if (u(r, n)) return !0;
|
|
141
220
|
return !1;
|
|
142
221
|
case "not":
|
|
143
|
-
return !u(
|
|
222
|
+
return !u(t.operand, n);
|
|
144
223
|
case "name":
|
|
145
|
-
return
|
|
224
|
+
return o(n) && n.name === t.name;
|
|
146
225
|
case "name_pattern":
|
|
147
|
-
return
|
|
226
|
+
return o(n) && !!n.name.match(t.pattern);
|
|
148
227
|
case "annotation":
|
|
149
|
-
return
|
|
228
|
+
return o(n) && n.annotations !== void 0 && n.annotations[t.annotation] === t.value;
|
|
150
229
|
case "annotation_pattern":
|
|
151
|
-
return
|
|
230
|
+
return o(n) && n.annotations !== void 0 && n.annotations[t.annotation] !== void 0 && !!n.annotations[t.annotation].match(t.pattern);
|
|
152
231
|
case "has_axes":
|
|
153
|
-
return
|
|
154
|
-
(
|
|
155
|
-
(
|
|
156
|
-
([
|
|
232
|
+
return o(n) && t.axes.every(
|
|
233
|
+
(r) => n.axesSpec.some(
|
|
234
|
+
(e) => (r.type === void 0 || r.type === e.type) && (r.name === void 0 || r.name === e.name) && (r.domain === void 0 || Object.keys(r.domain).length === 0 || e.domain !== void 0 && Object.entries(r.domain).every(
|
|
235
|
+
([p, l]) => e.domain[p] === l
|
|
157
236
|
))
|
|
158
237
|
)
|
|
159
238
|
);
|
|
160
239
|
default:
|
|
161
|
-
|
|
240
|
+
C(t);
|
|
162
241
|
}
|
|
163
242
|
}
|
|
164
|
-
function
|
|
165
|
-
return
|
|
243
|
+
function X(t, n) {
|
|
244
|
+
return t.ok ? { ok: !0, value: n(t.value) } : t;
|
|
166
245
|
}
|
|
167
246
|
export {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
247
|
+
W as DefaultNavigationState,
|
|
248
|
+
E as PValueBytesNA,
|
|
249
|
+
h as PValueDoubleNA,
|
|
250
|
+
P as PValueFloatNA,
|
|
251
|
+
N as PValueIntNA,
|
|
252
|
+
a as PValueLongNA,
|
|
253
|
+
x as PValueStringNA,
|
|
254
|
+
z as PlRef,
|
|
255
|
+
R as ensureNotNAPValue,
|
|
256
|
+
K as ensurePColumn,
|
|
177
257
|
u as executePSpecPredicate,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
258
|
+
j as getAxesId,
|
|
259
|
+
A as getAxisId,
|
|
260
|
+
D as getFileNameFromHandle,
|
|
261
|
+
g as getFilePathFromHandle,
|
|
262
|
+
b as isImportFileHandleIndex,
|
|
263
|
+
y as isImportFileHandleUpload,
|
|
264
|
+
B as isLiveLog,
|
|
265
|
+
V as isNotNAPValue,
|
|
266
|
+
S as isPColumn,
|
|
267
|
+
G as isPColumnResult,
|
|
268
|
+
o as isPColumnSpec,
|
|
269
|
+
q as isPColumnSpecResult,
|
|
270
|
+
I as isPValue,
|
|
271
|
+
_ as isValueAbsent,
|
|
272
|
+
f as isValueNA,
|
|
273
|
+
s as mapJoinEntry,
|
|
274
|
+
Q as mapPObjectData,
|
|
275
|
+
J as mapPTableDef,
|
|
276
|
+
X as mapValueInVOE,
|
|
277
|
+
H as matchAxisId,
|
|
278
|
+
O as pValueToStringOrNumber,
|
|
279
|
+
k as pValueToStringOrNumberOrNull,
|
|
280
|
+
M as plRefsEqual,
|
|
281
|
+
$ as safeConvertToPValue,
|
|
282
|
+
L as toJsonSafePValue
|
|
197
283
|
};
|
|
198
284
|
//# sourceMappingURL=index.mjs.map
|