mirror of
https://github.com/nasa/openmct.git
synced 2025-03-10 22:43:55 +00:00
check if sample size greater than zero
This commit is contained in:
parent
3f92deb896
commit
c6806944eb
@ -1,3 +1,4 @@
|
||||
import { sampleSize } from 'lodash';
|
||||
import { evaluate } from 'mathjs';
|
||||
|
||||
// eslint-disable-next-line no-undef
|
||||
@ -83,7 +84,7 @@ function calculate(dataFrame, parameters, expression) {
|
||||
accumulatedData[referenceParameter.name].push(referenceValue);
|
||||
referenceValue = accumulatedData[referenceParameter.name];
|
||||
}
|
||||
if (referenceParameter.sampleSize) {
|
||||
if (referenceParameter.sampleSize && sampleSize > 0) {
|
||||
// enforce sample size by ensuring referenceValue has the latest n elements
|
||||
// if we don't have at least the sample size, skip this iteration
|
||||
if (referenceValue.length < referenceParameter.sampleSize) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user