From 1ef7a0c1c151bad972c7d8d119155a65225926e4 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Tue, 6 Aug 2024 14:58:29 -0400 Subject: [PATCH 1/4] parameter with strata suffixes --- .../workflow/ops/stratify-mira/tera-stratify-mira.vue | 3 ++- .../hmi-client/src/model-representation/mira/mira.ts | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue b/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue index 339fcf4d58..a4fd207585 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue @@ -254,7 +254,8 @@ const stratifyRequest = () => { concepts_to_stratify: conceptsToStratify, params_to_stratify: parametersToStratify, cartesian_control: strataOption.cartesianProduct, - structure: strataOption.useStructure === true ? null : [] + structure: strataOption.useStructure === true ? null : [], + param_renaming_uses_strata_name: true }; kernelManager.sendMessage('reset_request', {}).register('reset_response', () => { kernelManager diff --git a/packages/client/hmi-client/src/model-representation/mira/mira.ts b/packages/client/hmi-client/src/model-representation/mira/mira.ts index 28c131ad19..f1304b8a9c 100644 --- a/packages/client/hmi-client/src/model-representation/mira/mira.ts +++ b/packages/client/hmi-client/src/model-representation/mira/mira.ts @@ -101,6 +101,7 @@ export const collapseParameters = (miraModel: MiraModel, miraTemplateParams: Mir const rootName = _.first(tokens) as string; // Ignore non-numerics + /* if (tokens.length > 1) { let numerical = true; for (let j = 1; j < tokens.length; j++) { @@ -113,6 +114,13 @@ export const collapseParameters = (miraModel: MiraModel, miraTemplateParams: Mir continue; } } + */ + + const displayName = miraModel.parameters[key].display_name; + if (displayName === null || displayName === key) { + map.set(name, [name]); + continue; + } if (map.has(rootName)) { map.get(rootName)?.push(name); @@ -214,6 +222,7 @@ export const collapseTemplates = (miraModel: MiraModel) => { // 1. Roll back to "original name" by trimming off modifiers miraModel.templates.forEach((t) => { + console.log('..', t.name); const scrubbedTemplate: TemplateSummary = { name: t.name, expression: t.rate_law, From 977120cd056cf6b20fd11486e1b2b86c582be551 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Wed, 7 Aug 2024 11:24:59 -0400 Subject: [PATCH 2/4] update parameter collapse --- .../src/model-representation/mira/mira.ts | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/packages/client/hmi-client/src/model-representation/mira/mira.ts b/packages/client/hmi-client/src/model-representation/mira/mira.ts index ddfdb49741..c8be24062a 100644 --- a/packages/client/hmi-client/src/model-representation/mira/mira.ts +++ b/packages/client/hmi-client/src/model-representation/mira/mira.ts @@ -100,24 +100,9 @@ export const collapseParameters = (miraModel: MiraModel, miraTemplateParams: Mir const tokens = key.split('_') as string[]; const rootName = _.first(tokens) as string; - // Ignore non-numerics - /* - if (tokens.length > 1) { - let numerical = true; - for (let j = 1; j < tokens.length; j++) { - if (Number.isNaN(parseInt(tokens[j], 10))) { - numerical = false; - } - } - if (!numerical) { - map.set(name, [name]); - continue; - } - } - */ - + // There are some cases where parameter names have underscores but are not stratified const displayName = miraModel.parameters[key].display_name; - if (displayName === null || displayName === key) { + if (tokens.length > 1 && displayName === key) { map.set(name, [name]); continue; } From 0b8677f9a658fd8fe2a9421e1143eadca1258c27 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Wed, 7 Aug 2024 11:25:52 -0400 Subject: [PATCH 3/4] remove defaulted option --- .../workflow/ops/stratify-mira/tera-stratify-mira.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue b/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue index f9535329d9..b920e887b0 100644 --- a/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue +++ b/packages/client/hmi-client/src/components/workflow/ops/stratify-mira/tera-stratify-mira.vue @@ -252,8 +252,7 @@ const stratifyRequest = () => { concepts_to_stratify: conceptsToStratify, params_to_stratify: parametersToStratify, cartesian_control: strataOption.cartesianProduct, - structure: strataOption.useStructure === true ? null : [], - param_renaming_uses_strata_name: true + structure: strataOption.useStructure === true ? null : [] }; kernelManager.sendMessage('reset_request', {}).register('reset_response', () => { kernelManager From dcf6677c9c4e7c776f8a9b90a13d2d0a3ee46bb5 Mon Sep 17 00:00:00 2001 From: Daniel Chang Date: Wed, 7 Aug 2024 12:57:06 -0400 Subject: [PATCH 4/4] console.log --- packages/client/hmi-client/src/model-representation/mira/mira.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/client/hmi-client/src/model-representation/mira/mira.ts b/packages/client/hmi-client/src/model-representation/mira/mira.ts index c8be24062a..e53f06821f 100644 --- a/packages/client/hmi-client/src/model-representation/mira/mira.ts +++ b/packages/client/hmi-client/src/model-representation/mira/mira.ts @@ -207,7 +207,6 @@ export const collapseTemplates = (miraModel: MiraModel) => { // 1. Roll back to "original name" by trimming off modifiers miraModel.templates.forEach((t) => { - console.log('..', t.name); const scrubbedTemplate: TemplateSummary = { name: t.name, expression: t.rate_law,