Skip to content

lib-greenButton 库参考 ​

原文: https://finproducts.atlassian.net/wiki/spaces/JIDD3/pages/34794176517/FIN+5.3.1+lib-greenButton 中文整理基于 FIN 5.3.1

导读: 绿色按钮功能库

以下为 API 参考,保留英文以便对照源码;目录已列出(英文标题便于检索);概述已尽量中译。


目录(导读) ​


概述(中译) ​

绿色按钮功能库


API 正文(英文) ​

funcs ​

greenButtonReadUsageParse a Green Button XML file into a grid of usage data from any IO handle


def ​

func:greenButtonReadUsage ​

greenButtonReadUsage(handle, opts: null) ​

Parse a Green Button XML file into a grid of usage data from any IO handle. The results are returned as grid with following columns:

  • ts: DateTime of interval ending timestamp in UTC
  • val: usage value in native Green Button uom (unit of measurement)
  • cost: cost in USD

Options may be used to implictly map the data:

  • tz: Str timezone name to convert from UTC
  • unit: Str unit name to convert from

Currently this function requires there to be exactly one entry with a <ReadingType>. If there is only one <IntervalBlock> then we return a single grid of the usage data. If there are multiple <IntervalBlock> entries, the we return a list of grids.

Examples:

// read in UTC and Wh
greenButtonReadUsage(`http://www.greenbuttondata.org/data/15minLP_15Days.xml`)

// read in New_York and kWh
greenButtonReadUsage(`http://www.greenbuttondata.org/data/15minLP_15Days.xml`,
    {tz:"New_York", unit:"kWh"})

meta ​

deffunc:greenButtonReadUsage
isfunc
liblib:greenButton
namegreenButtonReadUsage

supertypes ​

featureFeature namespace of definitions formatted as feature:name
funcAxon function