Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolotin committed Aug 18, 2024
1 parent 6a8a046 commit 758a0cf
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 70 deletions.
48 changes: 24 additions & 24 deletions model/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,30 @@ export const platforma = BlockModel.create<BlockArgs>('Heavy')
ctx.precalc?.resolve({ field: 'presets', assertFieldType: 'Input' })?.getFileHandle()
)

.output('inputOptions', (ctx) =>
ctx.resultPool
.getSpecsFromResultPool()
.entries.filter((v) => {
if (!isPColumnSpec(v.obj)) return false;
const domain = v.obj.domain;
return (
v.obj.name === 'pl7.app/data/sequencing' &&
((v.obj.valueType as string) === 'blob' || (v.obj.valueType as string) === 'file') &&
domain !== undefined &&
(domain['pl7.app/fileExtension'] === 'fastq' ||
domain['pl7.app/fileExtension'] === 'fastq.gz')
);
})
.map(
(v) =>
({
ref: v.ref,
label: `${ctx.getBlockLabel(v.ref.blockId)} / ${
v.obj.annotations?.['pl7.app/label'] ?? `unlabelled`
}`
} satisfies Option)
)
)
.output('inputOptions', (ctx) => [])
// ctx.resultPool
// .getSpecsFromResultPool()
// .entries.filter((v) => {
// if (!isPColumnSpec(v.obj)) return false;
// const domain = v.obj.domain;
// return (
// v.obj.name === 'pl7.app/data/sequencing' &&
// ((v.obj.valueType as string) === 'blob' || (v.obj.valueType as string) === 'file') &&
// domain !== undefined &&
// (domain['pl7.app/fileExtension'] === 'fastq' ||
// domain['pl7.app/fileExtension'] === 'fastq.gz')
// );
// })
// .map(
// (v) =>
// ({
// ref: v.ref,
// label: `${ctx.getBlockLabel(v.ref.blockId)} / ${
// v.obj.annotations?.['pl7.app/label'] ?? `unlabelled`
// }`
// } satisfies Option)
// )
// )

.sections((ctx) => {
return [{ type: 'link', href: '/', label: 'Settings' }];
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"pnpm": {
"overrides": {
"@milaboratory/pl-middle-layer": "file:/Volumes/Data/Projects/MiLaboratory/platforma/ts-pl-middle-layer/milaboratory-pl-middle-layer-1.9.27.tgz"
"@milaboratory/pl-middle-layer": "file:/Volumes/Data/Projects/MiLaboratory/platforma/ts-pl-middle-layer/milaboratory-pl-middle-layer-1.9.29.tgz"
}
}
}
77 changes: 36 additions & 41 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ catalog:
'@milaboratory/block-builder': ^1.2.3

'@milaboratory/sdk-ui': ^0.12.18
'@milaboratory/sdk-test': ^1.4.8
'@milaboratory/sdk-test': ^1.4.9

'@milaboratory/tengo-sdk': ^1.0.8
'@milaboratory/tengo-sdk': ^1.0.9

'@milaboratory/platforma-uikit': ^1.0.24
'@milaboratory/sdk-vue': ^1.0.33
Expand Down
6 changes: 5 additions & 1 deletion test/src/wf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { blockSpec as samplesAndDataBlockSpec } from '@milaboratory/milaboratori
import { BlockArgs as SamplesAndDataBlockArgs } from '@milaboratory/milaboratories.samples-and-data.model';
import { blockSpec as myBlockSpec } from 'this-block';
import { wrapOutputs } from '@milaboratory/sdk-ui';
import * as tp from 'node:timers/promises';

blockTest('empty imputs', { timeout: 5000 }, async ({ rawPrj: project, ml, helpers, expect }) => {
const blockId = await project.addBlock('Block', myBlockSpec);
Expand All @@ -22,7 +23,7 @@ blockTest('empty imputs', { timeout: 5000 }, async ({ rawPrj: project, ml, helpe
await ml.driverKit.blobDriver.getContent(presetsOutput!.handle)
).toString();
const presets = JSON.parse(presetsStr);
console.dir(presets, { depth: 5 });
expect(presets).length.gt(10);
});

blockTest(
Expand Down Expand Up @@ -82,6 +83,9 @@ blockTest(
fileImports: { ok: true, value: { [r1Handle]: { done: true }, [r2Handle]: { done: true } } }
});

console.dir(await clonotypingBlockState.getFullValue(), { depth: 5 });
await tp.setTimeout(2000);
console.dir(await clonotypingBlockState.getFullValue(), { depth: 5 });
const clonotypingStableState1 = await awaitStableState(clonotypingBlockState, 5000);
expect(clonotypingStableState1.outputs).toMatchObject({
inputOptions: {
Expand Down
2 changes: 1 addition & 1 deletion workflow/src/prerun.tpl.tengo
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ wf.body(func(args) {
cmd("mixcr").
arg("listPresetSpecificationsForUI").
arg("presets.json").
saveFile("presets.json").
cache(24 * 60 * 60 * 1000).
saveFile("presets.json").
run()

return {
Expand Down

0 comments on commit 758a0cf

Please sign in to comment.