The blitz.data module provides database utilities and models for both the client and server
Additionally, it provides some classes for storing and manipulating data that are used by user interfaces.
A class for saving and managing data that can be used in the interface. It also provides an interface for adding DataTransform objects which can be used to apply filters (i.e. moving average, multiplication, etc) to the data
Parameters: | persistent – Indicates if all data is kept, (True) or only 200 values for each series (False, default) |
---|
A generator which yields the series x, y values :returns: generated [x, y] value lists
Checks if a DataContainer is empty. An empty data container has no data series. A container with data series but no data values is NOT empty
Returns: | True if there are no data series, False otherwise |
---|
Gets the latest readings for each variable type and returns them in a pair of variable name / value pairs
Parameters: | named – If False (default), the variables will be indexed by variable name, otherwise by series name |
---|---|
Returns: | A list of tuples. Each tuple is in the form (variable_name, value) |
Returns the name of a series in the DataContainer with the given series ID
Parameters: | series_id – the series name to return |
---|---|
Returns: | The name of the series if it is in the Container, otherwise the series ID |
Gets a single series and returns a list of [x,y] values
Parameters: | series_id – The name of the series to return |
---|---|
Returns: | A list of [x,y] values for the given series, or empty lists if the series doesn’t exist |
Gets the index for a given series, or returns None if the series is not found
Parameters: | series_id – The name of the series to find the index for |
---|---|
Returns: | An integer representing the 0 based index of this series name in the series dictionary |
Returns a list of series names that are registered in this DataContainer
Returns: | A list of string series names registered to this DataContainer |
---|
Gets a single series and returns a list of [x,y] values from the transformed data
Parameters: | series_id – The name of the series to return |
---|---|
Returns: | A list of [x,y] values for the given series, or empty lists if the series doesn’t exist |
Gets all the current transforms applied
Returns: | A list of BaseDataTransform classes |
---|
Gets a list of x-values for a specified series_name
Parameters: | series_id – the string name of the series to retrieve |
---|---|
Returns: | a list of x values if the key is found, an empty list otherwise |
Gets a list of y-values for a specified series_name
Parameters: | series_id – the string name of the series to retrieve |
---|---|
Returns: | a list of y values if the key is found, an empty list otherwise |
Checks is the given series name is registered in the DataContainer
Parameters: | series_id – The name of the series to check (will be converted to string) |
---|---|
Returns: | True if the series exists, false otherwise |
Adds the passed X and Y values to the given series. If the series has not been registered with the DataContainer it registers it
Parameters: |
|
---|---|
Throws ValueError: | |
if the x and y lists are of different lengths |
|
Returns bool: | True if the series was created, false if data was appended |
A base class which must be inherited by DataTransform classes.
Takes a DataContainer object and applies a transformation to the X and Y data in the DataContainer. This is a base class which should be inherited from.
Warning
If no apply method is provided on the derived class then a NotImplementedError will be thrown
Raises: | NotImplementedError |
---|