Skip to content

Instantly share code, notes, and snippets.

@mastbaum
Last active December 21, 2015 11:39
Show Gist options
  • Save mastbaum/6300550 to your computer and use it in GitHub Desktop.
Save mastbaum/6300550 to your computer and use it in GitHub Desktop.
Specification for ln Backends
Backend.get_data_source_list()
Returns: list of data source names
Backend.create_data_source(name, type, reduction, interpolation, unit, description)
Returns: None
Backend.add_data(source_name, time, value)
Returns: (index, url) tuple, where index is index of data point and url is an image URL or None
Raises:
- TimeOrderError: The timestamp for the data point is before the last recorded data point
- BadTypeError: The value does not match the data type of the source or has the wrong dimensions for array types
Backend.get_data(source_name, offset=None, limit=None)
Returns: (times, values, resume) where times and values are arrays, resume is last returned index for pagination or None
Backend.update_config(source_name, unit='', description='')
Returns: None
Backend.get_config(source_name)
Returns: dict-like data source configuration
Backend.query(selectors, first, last, npoints)
Returns: (times, values) tuple, times and values are arrays
Backend.query_continuous(selectors, first, npoints)
Returns: Generator of (time, value) tuples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment