MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / reducerElementError

Function reducerElementError

src/compute-engine/library/arithmetic.ts:2601–2608  ·  view source on GitHub ↗

* Guard for `Sum`/`Product` accumulation over a collection: an already-failed * accumulator propagates, and a non-numeric (string) element is rejected with * an `incompatible-type` error rather than silently poisoning the result * (`Sum([a, b])` used to fold to `NaN`). Returns the error to short-

(
  acc: Expression,
  term: Expression
)

Source from the content-addressed store, hash-verified

2599 * types as — since each divides one point by one scalar.
2600 */
2601function divisorKeepsNumeratorShape(
2602 den: OperandDescriptor,
2603 admitMatrix = false
2604): boolean {
2605 const dt = den.type;
2606 if (typeCouldBeNumericTuple(dt)) return false;
2607 if (typeCouldBeNumericTupleCollection(dt)) return false;
2608 if (
2609 typeof dt !== 'string' &&
2610 dt.kind === 'broadcastable' &&
2611 typeCouldBeNumericTuple(dt.elements)

Callers 2

arithmetic.tsFile · 0.85
sumAccumulateFunction · 0.85

Calls 2

isStringFunction · 0.90
typeErrorMethod · 0.65

Tested by

no test coverage detected