Skip to content

Commit

Permalink
parameter with strata suffixes (#4370)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwdchang authored Aug 7, 2024
1 parent 1c94c5b commit 2a0bbc1
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions packages/client/hmi-client/src/model-representation/mira/mira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,11 @@ 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 (tokens.length > 1 && displayName === key) {
map.set(name, [name]);
continue;
}

if (map.has(rootName)) {
Expand Down

0 comments on commit 2a0bbc1

Please sign in to comment.