industrial-model 0.11.3 → 0.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -745,6 +745,12 @@ urls[0]?.externalId;
745
745
 
746
746
  The returned array preserves the input order. Passing an empty array returns `[]` without calling Cognite.
747
747
 
748
+ ## Calculator
749
+
750
+ Use the `Calculator` (from the `industrial-model/calculator` subpath) to compute derived time series — like KPIs and other formula-based metrics — from one or more source time series in Cognite. Each query pairs a `formula` (e.g. `"{power} / {flow} if {flow} != 0 else 0"`) with the parameters its `{alias}` placeholders resolve to; the calculator fetches every parameter's datapoints in a single de-duplicated round trip and evaluates the formula element-by-element. The underlying formula engine (`evaluate`) is also available on its own, for evaluating formulas over in-memory numeric series with no Cognite dependency.
751
+
752
+ See the [Calculator documentation](./src/calculator/README.md) for a quick start, aggregated parameters, batching multiple queries, a full OEE example, supported operators, and error handling.
753
+
748
754
  ## Aggregation
749
755
 
750
756
  Use `aggregate()` when you need grouped counts, distinct values, or numeric summaries without loading every instance.
@@ -1333,6 +1339,17 @@ Logical combinators `AND`, `OR`, and `NOT` are supported at any nesting level, i
1333
1339
  | `Cognite360Image`, `Cognite360ImageModel`, `Cognite360ImageCollection`, `Cognite360ImageStation`, `Cognite360ImageAnnotation` | 360 image views. |
1334
1340
  | `CogniteCubeMap` | Cube map view. |
1335
1341
 
1342
+ **Calculator** (imported from `industrial-model/calculator`)
1343
+
1344
+ | Symbol | Description |
1345
+ | --- | --- |
1346
+ | `Calculator` | Computes derived time series from formulas over Cognite datapoints. |
1347
+ | `CalculatorQuery`, `CalculatorParameter`, `CalculationResult`, `DataPoint` | Calculator input and output types. |
1348
+ | `evaluate`, `compileFormula`, `clearCache` | Formula engine for evaluating formulas over in-memory numeric series. |
1349
+ | `EvaluationResult`, `Parameters`, `ParameterValue`, `CompiledFormula` | Formula engine types. |
1350
+ | `FormulaError`, `InvalidFormulaError`, `MissingParameterError`, `ParameterError`, `ParameterLengthError` | Structural formula errors. |
1351
+ | `ArithmeticError`, `ZeroDivisionError`, `OverflowError` | Value-dependent arithmetic errors. |
1352
+
1336
1353
  ## Code Generator
1337
1354
 
1338
1355
  The package includes a CLI to generate typed models and client code from a Cognite data model. See the [CLI documentation](./src/cli/README.md).