Skip to content

Commit

Permalink
chore: code review tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kswenson committed Oct 29, 2024
1 parent af00d85 commit c9203da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions v3/src/assets/json/function-strings.json5
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@
"examples": [
"first(age) returns the first value of the attribute age",
"first(age,sex=\"female\") returns the first value for the attribute age for which the attribute sex is female",
"first(age,height>68) returns the first value for the attribute age for which the the value of the attribute height is greater than 68"
"first(age,height>68) returns the first value for the attribute age for which the value of the attribute height is greater than 68"
]
},
{ "displayName": "last",
Expand Down Expand Up @@ -1046,7 +1046,7 @@
}
],
"examples": [
"rollingMean(Height, 5) computes the rolling mean of the attribute Height, including the the current value and the two preceding and following values",
"rollingMean(Height, 5) computes the rolling mean of the attribute Height, including the current value and the two preceding and following values",
"rollingMean(Height, 5, Habitat!=\"water\") computes the rolling mean of Height, excluding water dwelling Mammals"
]
},
Expand Down Expand Up @@ -1325,7 +1325,7 @@
}
],
"examples": [
"linRegrPredicted(horsepower, mpg) returns, for each value of horsepower, the the predicted value of mpg."
"linRegrPredicted(horsepower, mpg) returns, for each value of horsepower, the predicted value of mpg."
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion v3/src/models/formula/functions/aggregate-functions.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { MathNode } from "mathjs"
import { checkNumber } from "../../../utilities/math-utils"
import { IValueType } from "../../data/attribute-types"
import { CurrentScope, FValue, FValueOrArray } from "../formula-types"
import { UNDEF_RESULT, evaluateNode, getRootScope, isNumber, isValueNonEmpty, isValueTruthy } from "./function-utils"
import { FormulaMathJsScope } from "../formula-mathjs-scope"
import { checkNumber } from "../../../utilities/math-utils"

// Almost every aggregate function can be cached in the same way.
export const cachedAggregateFnFactory =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { mad, MathNode, max, mean, median, min, std, sum } from "mathjs"
import { IValueType } from "../../data/attribute-types"
import { CurrentScope, FValue, IFormulaMathjsFunction } from "../formula-types"
import { evaluateNode, getRootScope, isValueNonEmpty, isValueTruthy, UNDEF_RESULT } from "./function-utils"
import {
aggregateFnWithFilterFactory, aggregateNumericFnWithFilterFactory, cachedAggregateFnFactory
} from "./aggregate-functions"
import { IValueType } from "../../data/attribute-types"

export const univariateStatsFunctions: Record<string, IFormulaMathjsFunction> = {

Expand Down

0 comments on commit c9203da

Please sign in to comment.