-
Notifications
You must be signed in to change notification settings - Fork 1
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
Feature 69 nested aggregators #52
Conversation
Implement the new concept in ScoreSource and WeightedMean.
Add additional max aggregator.
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.
Sieht sehr schick aus :)
*/ | ||
class Max { | ||
/** | ||
* Construct a Max Aggregator using an array of aggregatiors. |
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.
aggregators
} else if (!aggregator.combine) { | ||
throw new InvalidInputError(`Aggregator has no combine function`) | ||
} | ||
// if (typeof aggregator === 'string') { |
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.
Comments bitte entfernen
function getAggregator (aggregator) { | ||
return typeof aggregator === 'string' ? new aggregators[aggregator]() : aggregator | ||
} | ||
// /** |
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.
Comments bitte entfernen
@@ -1,6 +1,7 @@ | |||
const buster = require('buster') | |||
const scoreManager = require('../lib/score-manager') | |||
const aggregator = require('../lib/score-aggregator') | |||
// const aggregator = require('../lib/score-aggregator') |
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.
Comments bitte entfernen
buster.testCase('ScoreManager Integration', { | ||
buster.testCase('ScoreManager Plugin Integration', { | ||
setUp: function () { | ||
// this.stubAstEval = this.stub() |
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.
Comments bitte entfernen
/** | ||
* Return a WeightedMean Aggregator from an aggregator array. The parameters | ||
* will be forwarded to WeightedMean.constructor(). | ||
*/ |
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.
In Z.25 und 26 sollte wohl auch immer Max statt WeightedMead stehen.
@@ -260,7 +262,10 @@ class ScoreManager { | |||
|
|||
let successfulScores = {} | |||
successfulKeys.forEach(key => { successfulScores[key] = scores[key] }) | |||
return this.aggregator.combine(successfulScores) | |||
|
|||
let ast = aggregatorConfigParser.parse( |
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.
ast -> aggregatorSourceTree ?
Variable bitte umbenennen für besseres Verständnis
No description provided.