Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parameter with strata suffixes #4370

Merged
merged 7 commits into from
Aug 7, 2024
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 Expand Up @@ -214,6 +207,7 @@ export const collapseTemplates = (miraModel: MiraModel) => {

// 1. Roll back to "original name" by trimming off modifiers
miraModel.templates.forEach((t) => {
console.log('..', t.name);
mwdchang marked this conversation as resolved.
Show resolved Hide resolved
const scrubbedTemplate: TemplateSummary = {
name: t.name,
expression: t.rate_law,
Expand Down
Loading