-
Notifications
You must be signed in to change notification settings - Fork 0
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
mrc-4522 Allow user-specified parameter values in Sensitivity #176
Changes from 16 commits
bda7c21
efab479
c9a3642
004be28
4e215cf
e4b424f
5c42f84
f12f236
0783bee
13ad200
271eed2
864cf95
b783bb8
4f6621f
20f33bb
b419569
7d45e46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,18 +5,25 @@ | |
<button class="btn btn-primary mb-4 float-end" @click="toggleEdit(true)">Edit</button> | ||
<ul> | ||
<li><strong>Parameter:</strong> {{settings.parameterToVary}}</li> | ||
<li><strong>Scale Type:</strong> {{ settings.scaleType }}</li> | ||
<li><strong>Variation Type:</strong> {{ settings.variationType }}</li> | ||
<li v-if="settings.variationType !== 'Custom'"><strong>Scale Type:</strong> {{ settings.scaleType }}</li> | ||
<li v-if="settings.variationType === 'Percentage'"> | ||
<strong>Variation (%):</strong> {{ settings.variationPercentage }} | ||
</li> | ||
<template v-else> | ||
<template v-if="settings.variationType === 'Range'"> | ||
<li><strong>From:</strong> {{ settings.rangeFrom }}</li> | ||
<li><strong>To:</strong> {{ settings.rangeTo }}</li> | ||
</template> | ||
<li><strong>Number of runs:</strong> {{ settings.numberOfRuns}}</li> | ||
<li v-if="settings.variationType === 'Custom'"> | ||
<strong>Values:</strong> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was looking for some hint as to what my central value was. Do we want to encourage the users to bracket it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, I wondered about that. Do we want to enforce or just encourage? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. encourage seems enough - just knowing where it is would be nice |
||
{{ settings.customValues.join(", ") }} | ||
</li> | ||
<li v-if="settings.variationType !== 'Custom'"> | ||
<strong>Number of runs:</strong> {{ settings.numberOfRuns}} | ||
</li> | ||
</ul> | ||
<sensitivity-param-values :batch-pars="batchPars"></sensitivity-param-values> | ||
<sensitivity-param-values v-if="settings.variationType !== 'Custom'" :batch-pars="batchPars"> | ||
</sensitivity-param-values> | ||
</div> | ||
<hr/> | ||
<sensitivity-plot-options></sensitivity-plot-options> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,12 @@ export default defineComponent({ | |
VueTagsInput | ||
}, | ||
props: { | ||
tags: Array as PropType<Tag[] | null> | ||
tags: Array as PropType<Tag[] | null>, | ||
numericOnly: { | ||
type: Boolean, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a difference between Boolean and bool? Or am I getting confused with different languages? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's how Vue defines the types of its props, not quite the same as the Typescript types |
||
required: false, | ||
default: false | ||
} | ||
}, | ||
setup(props, { emit }) { | ||
const store = useStore(); | ||
|
@@ -39,7 +44,7 @@ export default defineComponent({ | |
} | ||
const cleanTags = props.tags.filter((tag) => { | ||
if (typeof tag === "number") return true; | ||
return paramValues.value[tag] !== undefined; | ||
return !props.numericOnly && paramValues.value[tag] !== undefined; | ||
}); | ||
return cleanTags.map((tag) => { | ||
if (typeof tag === "number") return `${tag}`; | ||
|
@@ -61,14 +66,16 @@ export default defineComponent({ | |
if (isNumeric(tag)) { | ||
return parseFloat(tag); | ||
} | ||
if (tag.includes(":")) { | ||
const variableTag = tag.split(":"); | ||
const varId = variableTag[0]; | ||
if (isParameterName(varId)) { | ||
return varId; | ||
if (!props.numericOnly) { | ||
if (tag.includes(":")) { | ||
const variableTag = tag.split(":"); | ||
const varId = variableTag[0]; | ||
if (isParameterName(varId)) { | ||
return varId; | ||
} | ||
} else if (isParameterName(tag)) { | ||
return tag; | ||
} | ||
} else if (isParameterName(tag)) { | ||
return tag; | ||
} | ||
return undefined; | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I entered a duplciate it ended up with a red underline and was not included but no error displayed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also wonder about deferring sort until save? it's a bit alarming atm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The red underline seems to be a bit of a feature of the third party tags input, I think it can happen in the advanced settings too, I'll see if I can get rid of it, and defer sorting