@platforma-open/milaboratories.immune-assay-data.model 1.5.0 → 1.5.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.
@@ -1,16 +1,16 @@
1
1
   WARN  Issue while reading "/home/runner/work/immune-assay-data/immune-assay-data/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.immune-assay-data.model@1.5.0 build /home/runner/work/immune-assay-data/immune-assay-data/model
3
+ > @platforma-open/milaboratories.immune-assay-data.model@1.5.1 build /home/runner/work/immune-assay-data/immune-assay-data/model
4
4
  > ts-builder build --target block-model && block-tools build-model
5
5
 
6
6
  Building block-model project...
7
- ↳ rollup -c /home/runner/work/immune-assay-data/immune-assay-data/node_modules/.pnpm/@milaboratories+ts-builder@1.2.1_@microsoft+api-extractor@7.55.2_@types+node@24.5.2__@types+n_etlbpp2v4tsetlkv2iymvvpayi/node_modules/@milaboratories/ts-builder/dist/configs/rollup.block-model.config.js
7
+ ↳ rollup -c /home/runner/work/immune-assay-data/immune-assay-data/node_modules/.pnpm/@milaboratories+ts-builder@1.2.2_@microsoft+api-extractor@7.55.2_@types+node@24.5.2__@types+n_h3g3jyrwpenqsg2d2jmxe4wjai/node_modules/@milaboratories/ts-builder/dist/configs/rollup.block-model.config.js
8
8
  
9
9
  ./src/index.ts → dist, dist...
10
- created dist, dist in 1s
10
+ created dist, dist in 1.1s
11
11
  
12
12
  ./src/index.ts → dist...
13
13
  (!) Circular dependency
14
- ../node_modules/.pnpm/@platforma-sdk+model@1.51.2/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js -> ../node_modules/.pnpm/@platforma-sdk+model@1.51.2/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js -> ../node_modules/.pnpm/@platforma-sdk+model@1.51.2/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
15
- created dist in 2.1s
14
+ ../node_modules/.pnpm/@platforma-sdk+model@1.51.6/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js -> ../node_modules/.pnpm/@platforma-sdk+model@1.51.6/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js -> ../node_modules/.pnpm/@platforma-sdk+model@1.51.6/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
15
+ created dist in 1.8s
16
16
  Build completed successfully
@@ -1,5 +1,5 @@
1
1
   WARN  Issue while reading "/home/runner/work/immune-assay-data/immune-assay-data/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.immune-assay-data.model@1.5.0 lint /home/runner/work/immune-assay-data/immune-assay-data/model
3
+ > @platforma-open/milaboratories.immune-assay-data.model@1.5.1 lint /home/runner/work/immune-assay-data/immune-assay-data/model
4
4
  > eslint .
5
5
 
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/immune-assay-data/immune-assay-data/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.immune-assay-data.model@1.5.0 type-check /home/runner/work/immune-assay-data/immune-assay-data/model
3
+ > @platforma-open/milaboratories.immune-assay-data.model@1.5.1 type-check /home/runner/work/immune-assay-data/immune-assay-data/model
4
4
  > ts-builder types --target block-model
5
5
 
6
6
  ↳ tsc --noEmit --project ./tsconfig.json --customConditions ,
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-open/milaboratories.immune-assay-data.model
2
2
 
3
+ ## 1.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - f10bacb: Labels migration
8
+
3
9
  ## 1.5.0
4
10
 
5
11
  ### Minor Changes
package/dist/bundle.js CHANGED
@@ -6100,6 +6100,25 @@
6100
6100
  }
6101
6101
  return result;
6102
6102
  };
6103
+ // Checks if a result has all unique labels
6104
+ const hasUniqueLabels = (result) => result !== undefined && new Set(result.map((c) => c.label)).size === values.length;
6105
+ // Post-processing: try removing types one by one (lowest importance first) to minimize the label set
6106
+ const minimizeTypeSet = (typeSet) => {
6107
+ // Get types sorted by importance ascending (lowest first), excluding forced elements
6108
+ const removableSorted = [...typeSet]
6109
+ .filter((t) => !forceTraceElements?.has(t.split('@')[0])
6110
+ && !(ops.includeNativeLabel && t === LabelTypeFull))
6111
+ .sort((a, b) => (importances.get(a) ?? 0) - (importances.get(b) ?? 0));
6112
+ for (const typeToRemove of removableSorted) {
6113
+ const reducedSet = new Set(typeSet);
6114
+ reducedSet.delete(typeToRemove);
6115
+ const candidateResult = calculate(reducedSet);
6116
+ if (hasUniqueLabels(candidateResult)) {
6117
+ typeSet.delete(typeToRemove);
6118
+ }
6119
+ }
6120
+ return typeSet;
6121
+ };
6103
6122
  if (mainTypes.length === 0) {
6104
6123
  if (secondaryTypes.length !== 0)
6105
6124
  throw new Error('Non-empty secondary types list while main types list is empty.');
@@ -6125,16 +6144,20 @@
6125
6144
  if (additionalType >= 0)
6126
6145
  currentSet.add(mainTypes[additionalType]);
6127
6146
  const candidateResult = calculate(currentSet);
6128
- // checking if labels uniquely separate our records
6129
- if (candidateResult !== undefined && new Set(candidateResult.map((c) => c.label)).size === values.length)
6130
- return candidateResult;
6147
+ if (hasUniqueLabels(candidateResult)) {
6148
+ minimizeTypeSet(currentSet);
6149
+ return calculate(currentSet);
6150
+ }
6131
6151
  additionalType++;
6132
6152
  if (additionalType >= mainTypes.length) {
6133
6153
  includedTypes++;
6134
6154
  additionalType = includedTypes;
6135
6155
  }
6136
6156
  }
6137
- return calculate(new Set([...mainTypes, ...secondaryTypes]), true);
6157
+ // Fallback: include all types, then try to minimize
6158
+ const fallbackSet = new Set([...mainTypes, ...secondaryTypes]);
6159
+ minimizeTypeSet(fallbackSet);
6160
+ return calculate(fallbackSet, true);
6138
6161
  }
6139
6162
 
6140
6163
  const PCD_PREFIX = 'PColumnData/';
@@ -7370,7 +7393,7 @@
7370
7393
  }
7371
7394
  }
7372
7395
 
7373
- var version = "1.51.2";
7396
+ var version = "1.51.6";
7374
7397
 
7375
7398
  const PlatformaSDKVersion = version;
7376
7399
 
@@ -7821,13 +7844,13 @@
7821
7844
  ctx.logWarn(`Partition filter ${JSON.stringify(f)} does not match provided columns, skipping`);
7822
7845
  return valid;
7823
7846
  });
7824
- const filters = uniqueBy([...([]), ...tableStateNormalized.pTableParams.filters], (f) => canonicalizeJson(f.column)).filter((f) => {
7847
+ const filters = uniqueBy([...tableStateNormalized.pTableParams.filters, ...([])], (f) => canonicalizeJson(f.column)).filter((f) => {
7825
7848
  const valid = isValidColumnId(f.column);
7826
7849
  if (!valid)
7827
7850
  ctx.logWarn(`Filter ${JSON.stringify(f)} does not match provided columns, skipping`);
7828
7851
  return valid;
7829
7852
  });
7830
- const sorting = uniqueBy([...([]), ...tableStateNormalized.pTableParams.sorting], (s) => canonicalizeJson(s.column)).filter((s) => {
7853
+ const sorting = uniqueBy([...tableStateNormalized.pTableParams.sorting, ...([])], (s) => canonicalizeJson(s.column)).filter((s) => {
7831
7854
  const valid = isValidColumnId(s.column);
7832
7855
  if (!valid)
7833
7856
  ctx.logWarn(`Sorting ${JSON.stringify(s)} does not match provided columns, skipping`);