How to Convert an Array of 12 doubles into a Timeseries?


#1

What’s the best practice for converting an array of 12 doubles into a Timeseries (for implementation in a Type’s method)?

Background:
For a implementing a Facility’s method, I’m grabbing values from running BenchmarkingModel.getMonthlyAverageAndEfficientBenchmarking(“facility_id”, “BenchmarkingElectricityConsumption”, “2018-01-01T00:00:00”, “2019-01-01T00:00:00”) and am looking to convert each of the averageBenchmarking and efficientBenchmarking fields into their own Timeseries.

I see functions such as Timeseries.fromObjs or Timeseries.fromObjsstream, or maybe doing a Timeseries.makeNorm (in Javascript) and manually inserting the array of 12 into the “data” field, like below,.

Timeseries.makeNorm(NormTimeseriesDoubleSpec.make({
requiredFields
data: “insert averageBenchmarking or efficientBenchmarking here”
}));

Any advice on best practices here would be appreciated!


#2

Timeseries.makeNorm() is what i would use.