-
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-4455 Support multiple varying parameters in batches #27
Conversation
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
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.
This is great, and less disruptive than expected. One suggestion about making the expansion part more resable.
@@ -67,14 +79,14 @@ export class Batch { | |||
*/ | |||
public compute(): boolean { | |||
if (this._pending.length > 0) { | |||
const value = this._pending[0]; | |||
const values = this._pending[0]; |
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.
oh did we make this already non blocking? that was good of us
src/batch.ts
Outdated
* represents a single combination of values for the varying parameters. We will combine these with the base | ||
* pars for each run. | ||
*/ | ||
private expandVaryingParams(varyingPars: VaryingPar[]): UserType[] { |
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.
this could be a free function rather than a method, and then would be easier to put a few unit tests on. I'd not be surprised if we use this elsewhere (in this project or adapt to another) so might be worthwhile.
Adds support for multiple varying parameters in the running of sensitivity. For consistency, running single parameter sensitivity is now done in the same way, with just a single varying parameter defined.
Key changes:
BatchPars
, thename
andvalues
props have been replaced by an array ofVaryingPar
s (each of which has a parameter name and array of values).expandVaryingParams
method is used to generate all combinations of varying params values (as an array ofUserType
s) -batchRun
iterates through this array and computes for each of these combinationsBatchError
has been replaced byRunStatus
which is recorded for each combination of varying parameter values and includessuccess
boolean. the varying parameter values and any error strings.x
values, now needs to specify the multiple varying parameter values, so there's now aUserTypeSeriesSet
type wherex
is an array of UserTypes specifying these multiple values. (Maybex
isn't a sensible name for this any more!)