@datagrok/compute 1.43.10 → 1.44.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@datagrok/compute",
3
3
  "friendlyName": "Compute",
4
- "version": "1.43.10",
4
+ "version": "1.44.1",
5
5
  "author": {
6
6
  "name": "Andrey Sharapov",
7
7
  "email": "andrey.sharapov@softwarecountry.com"
@@ -13,22 +13,23 @@
13
13
  "directory": "packages/Compute"
14
14
  },
15
15
  "dependencies": {
16
- "@datagrok-libraries/compute-utils": "^1.43.9",
16
+ "@datagrok-libraries/compute-utils": "^1.44.0",
17
17
  "@datagrok-libraries/utils": "^4.5.7",
18
18
  "cash-dom": "^8.1.5",
19
- "datagrok-api": "^1.25.0",
19
+ "datagrok-api": "^1.26.0",
20
20
  "dayjs": "=1.11.10",
21
21
  "exceljs": "^4.3.0",
22
22
  "rxjs": "^6.6.7",
23
23
  "source-map-loader": "^5.0.0",
24
24
  "ts-loader": "^9.5.1",
25
- "typescript": "^5.6.3"
25
+ "typescript": "^5.8.3"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/lodash.clonedeepwith": "^4.5.9",
29
29
  "@typescript-eslint/eslint-plugin": "^8.8.1",
30
30
  "@typescript-eslint/parser": "^8.8.1",
31
31
  "css-loader": "^7.1.2",
32
+ "datagrok-tools": "^4.14.20",
32
33
  "eslint": "^8.0.1",
33
34
  "eslint-config-google": "^0.14.0",
34
35
  "style-loader": "^4.0.0",
@@ -42,7 +43,7 @@
42
43
  "debug-compute": "webpack & grok publish localhost --release",
43
44
  "release-compute": "webpack && grok publish localhost --release",
44
45
  "build-compute": "webpack",
45
- "build": "webpack",
46
+ "build": "grok api && grok check --soft && webpack",
46
47
  "lint": "eslint . --ext .ts,.tsx",
47
48
  "lint-fix": "eslint . --ext .ts,.tsx --fix",
48
49
  "build-compute-local": "npm --prefix ./../../js-api run build && npm --prefix ./../../libraries/utils run build && npm run build",
@@ -0,0 +1,119 @@
1
+ /**
2
+ This file is auto-generated by the grok api command.
3
+ If you notice any changes, please push them to the repository.
4
+ Do not edit this file manually.
5
+ */
6
+ import * as grok from 'datagrok-api/grok';
7
+ import * as DG from 'datagrok-api/dg';
8
+
9
+
10
+ export namespace scripts {
11
+ export async function fabArmExchange(meaConcentration: number , phOfFaeReaction: number , faeReactionTime: number , ionicStrenght: number , targetIgGConc: number , massOverload: number , P1MW: number , reactionVolume: number , partialPressureOfOxygen: number , doInitial: number , doBuffer: number , oxygenTransferRate: number , pressure: number , temperature: number , Lid: boolean , headSpace: number , dfVolume: number , filterateRateDF: number , phOfUfdfBuffer: number , phOfSecondUfdfBuffer: number , secondDfVolume: number , dfConcentration: number , filterateRateUf: number , holdTime: number , phDuringHoldTime: number , holdTime2: number , phDuringSecondHoldTime: number ): Promise<{c: number, d: number}> {
12
+ return await grok.functions.call('Compute:FabArmExchange', { meaConcentration, phOfFaeReaction, faeReactionTime, ionicStrenght, targetIgGConc, massOverload, P1MW, reactionVolume, partialPressureOfOxygen, doInitial, doBuffer, oxygenTransferRate, pressure, temperature, Lid, headSpace, dfVolume, filterateRateDF, phOfUfdfBuffer, phOfSecondUfdfBuffer, secondDfVolume, dfConcentration, filterateRateUf, holdTime, phDuringHoldTime, holdTime2, phDuringSecondHoldTime });
13
+ }
14
+
15
+ /**
16
+ Identify the beats in an ECG signal and compute the IBIs
17
+ */
18
+ export async function intervalsFromECG(samplingFrequency: number , bpmMax: number , delta: number , k: number ): Promise<any> {
19
+ return await grok.functions.call('Compute:IntervalsFromECG', { samplingFrequency, bpmMax, delta, k });
20
+ }
21
+
22
+ /**
23
+ Predict the minimum filter size required for the separation of effluent from bioreactors, given the constraints of batch size and total batch time based on a training dataset of time vs filtrate volume for a given filter type, filter area and pressure
24
+ */
25
+ export async function vmax(test_data: DG.DataFrame , test_area: number , vbatch: number , tbatch: number , sf: number ): Promise<{processedData: DG.DataFrame, vmax: number, q0: number, slope_est: number, slope_err: number, icept_est: number, icept_err: number, rsq: number, f_stat: number, df: number, sigma: number, resid_ss: number, expl_ss: number, ss_tot: number, amin: number}> {
26
+ return await grok.functions.call('Compute:Vmax', { test_data, test_area, vbatch, tbatch, sf });
27
+ }
28
+ }
29
+
30
+ export namespace funcs {
31
+ export async function openModelFromFuncall(funccall: any ): Promise<void> {
32
+ return await grok.functions.call('Compute:OpenModelFromFuncall', { funccall });
33
+ }
34
+
35
+ /**
36
+ Creates an outliers selection viewer
37
+ */
38
+ export async function outliersSelection(): Promise<any> {
39
+ return await grok.functions.call('Compute:OutliersSelection', {});
40
+ }
41
+
42
+ export async function richFunctionViewEditor(call: any ): Promise<DG.View> {
43
+ return await grok.functions.call('Compute:RichFunctionViewEditor', { call });
44
+ }
45
+
46
+ export async function pipelineStepEditor(call: any ): Promise<DG.View> {
47
+ return await grok.functions.call('Compute:PipelineStepEditor', { call });
48
+ }
49
+
50
+ export async function renderPanel(func: any ): Promise<any> {
51
+ return await grok.functions.call('Compute:RenderPanel', { func });
52
+ }
53
+
54
+ export async function init(): Promise<void> {
55
+ return await grok.functions.call('Compute:Init', {});
56
+ }
57
+
58
+ export async function modelCatalog(): Promise<DG.View> {
59
+ return await grok.functions.call('Compute:ModelCatalog', {});
60
+ }
61
+
62
+ export async function modelCatalogTreeBrowser(treeNode: any , browseView: DG.View ): Promise<void> {
63
+ return await grok.functions.call('Compute:ModelCatalogTreeBrowser', { treeNode, browseView });
64
+ }
65
+
66
+ export async function customDataUploader(func: any ): Promise<any> {
67
+ return await grok.functions.call('Compute:CustomDataUploader', { func });
68
+ }
69
+
70
+ export async function customUploader(params: any ): Promise<{uploadWidget: any, uploadFuncCall: any}> {
71
+ return await grok.functions.call('Compute:CustomUploader', { params });
72
+ }
73
+
74
+ export async function customCustomizer(params: any ): Promise<void> {
75
+ return await grok.functions.call('Compute:CustomCustomizer', { params });
76
+ }
77
+
78
+ export async function simTimeValidator(params: any ): Promise<any> {
79
+ return await grok.functions.call('Compute:SimTimeValidator', { params });
80
+ }
81
+
82
+ export async function desiredTempValidator(params: any ): Promise<any> {
83
+ return await grok.functions.call('Compute:DesiredTempValidator', { params });
84
+ }
85
+
86
+ export async function initialTempValidator(params: any ): Promise<any> {
87
+ return await grok.functions.call('Compute:InitialTempValidator', { params });
88
+ }
89
+
90
+ export async function ambTempValidator(params: any ): Promise<any> {
91
+ return await grok.functions.call('Compute:AmbTempValidator', { params });
92
+ }
93
+
94
+ export async function heatCapValidator(params: any ): Promise<any> {
95
+ return await grok.functions.call('Compute:HeatCapValidator', { params });
96
+ }
97
+
98
+ export async function customStringInput(params: any ): Promise<any> {
99
+ return await grok.functions.call('Compute:CustomStringInput', { params });
100
+ }
101
+
102
+ export async function objectCoolingSelector(params: any ): Promise<any> {
103
+ return await grok.functions.call('Compute:ObjectCoolingSelector', { params });
104
+ }
105
+
106
+ /**
107
+ Test for optimization: multiple scalars output
108
+ */
109
+ export async function fitTestFunc(x1: number , x2: number , y: DG.DataFrame , bool: boolean ): Promise<{integer: number, float1: number, float2: number, table1: DG.DataFrame, table2: DG.DataFrame}> {
110
+ return await grok.functions.call('Compute:FitTestFunc', { x1, x2, y, bool });
111
+ }
112
+
113
+ /**
114
+ Test for optimization: multiple scalars output
115
+ */
116
+ export async function testFittingOutputs(): Promise<void> {
117
+ return await grok.functions.call('Compute:TestFittingOutputs', {});
118
+ }
119
+ }
package/src/package.ts CHANGED
@@ -23,6 +23,8 @@ import {
23
23
  testPipeline as testPipelineInst,
24
24
  } from '@datagrok-libraries/compute-utils/shared-utils/function-views-testing';
25
25
 
26
+ import {FittingView} from '@datagrok-libraries/compute-utils/function-views/src/fitting-view';
27
+
26
28
  export const _package = new DG.Package();
27
29
 
28
30
  //name: openModelFromFuncall
@@ -73,7 +75,7 @@ const options = {
73
75
  funcName: 'modelCatalog',
74
76
  setStartUriLoaded: () => startUriLoaded = true,
75
77
  getStartUriLoaded: () => startUriLoaded,
76
- }
78
+ };
77
79
 
78
80
  //tags: init
79
81
  export function init() {
@@ -284,3 +286,74 @@ export function ObjectCoolingSelector(params: any) {
284
286
  'ObjectCooling',
285
287
  );
286
288
  }
289
+
290
+ //name: fitTestFunc
291
+ //description: Test for optimization: multiple scalars output
292
+ //input: double x1 = 1 {caption: param1; min: -3; max: 3}
293
+ //input: double x2 = -1 {caption: param2; min: -3; max: 3}
294
+ //input: dataframe y {caption: table}
295
+ //input: bool bool
296
+ //output: int integer
297
+ //output: double float1
298
+ //output: double float2
299
+ //output: dataframe table1 {viewer: Line chart(block: 60) | Grid(block: 40) }
300
+ //output: dataframe table2 {viewer: Line chart(block: 60) | Grid(block: 40) }
301
+ //editor: Compute:RichFunctionViewEditor
302
+ //meta.features: {"fitting": true, "sens-analysis": true}
303
+ //meta.runOnOpen: true
304
+ //meta.runOnInput: true
305
+ export function fitTestFunc(x1: number, x2: number, y: DG.DataFrame, bool: boolean) {
306
+ return {
307
+ integer: x1**3 * (x1 - 1) * x2**3 * (x2 - 1),
308
+ float1: (x2 - 1)**2 + (x1 - 1)**2,
309
+ float2: (x2 - 1)**4 + (x1 - 1)**4,
310
+ table1: DG.DataFrame.fromColumns([
311
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'arg', [1, 2, 3, 4, 5]),
312
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'func', [x1 + x2 + 1, 4, 9, 16, 25]),
313
+ ]),
314
+ table2: DG.DataFrame.fromColumns([
315
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'arg', [1, 2, 3, 4, 5]),
316
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'func', [x1 + x2 + 1, 8, 27, 64, 125]),
317
+ ]),
318
+ };
319
+ }
320
+
321
+ //name: testFittingOutputs
322
+ //description: Test for optimization: multiple scalars output
323
+ export async function testFittingOutputs() {
324
+ const func = await grok.functions.find('Compute:fitTestFunc');
325
+
326
+ if (func === null) {
327
+ grok.shell.error('The function "Compute:fitTestFunc" not found!');
328
+ return;
329
+ }
330
+
331
+ const targetDf1 = DG.DataFrame.fromColumns([
332
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'arg', [1, 2, 3, 4, 5]),
333
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'func', [1, 4.3, 9.1, 16, 25]),
334
+ ]);
335
+ targetDf1.name = 'test-df1';
336
+
337
+ const targetDf2 = DG.DataFrame.fromColumns([
338
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'arg', [1, 2, 3, 4, 5]),
339
+ DG.Column.fromList(DG.COLUMN_TYPE.FLOAT, 'func', [1, 8.5, 27.6, 64.9, 125]),
340
+ ]);
341
+ targetDf2.name = 'test-df2';
342
+
343
+ await FittingView.fromEmpty(func, {
344
+ targets: {
345
+ integer: {default: 123, enabled: true},
346
+ float1: {default: 456.789, enabled: true},
347
+ table1: {
348
+ default: targetDf1,
349
+ enabled: true,
350
+ argumentCol: 'arg',
351
+ },
352
+ table2: {
353
+ default: targetDf2,
354
+ enabled: true,
355
+ argumentCol: 'arg',
356
+ },
357
+ },
358
+ });
359
+ }