pswamp.utils.time_window_labeled

Attributes

gtw

Classes

Indexer

TimeWindowLabeled

Stores the most recent n_samples of multichannel data, and corresponding time stamps. Updating with a new

GrowingTimeWindowLabeled

Stores the most recent n_samples of multichannel data, and corresponding time stamps. Updating with a new

Functions

table_to_strarray(cols, data)

Module Contents

pswamp.utils.time_window_labeled.table_to_strarray(cols, data)
class pswamp.utils.time_window_labeled.Indexer(n_cols=None, header=None)
header
n_cols = 1
get_col_idx(*args, **kwargs)
get_col_idx_single_query(*args, **kwargs)
class pswamp.utils.time_window_labeled.TimeWindowLabeled(n_samples=10, n_cols=None, header=None, dtype=float)

Bases: pswamp.utils.time_window.TimeWindow

Stores the most recent n_samples of multichannel data, and corresponding time stamps. Updating with a new set of measurements is efficient, since only one row in the data array (self._data) is overwritten.

indexer
header
get_col_idx(*args, **kwargs)
get_col_str(*args, **kwargs)

Get data columns based on lookup of strings in self.header. :param *args: Strings to look for. Look for first arg in first header row, second in second row, and so on. :param **kwargs: Dictionary with header rows to lookup as keys and entries as values

Returns:

Data array.

class pswamp.utils.time_window_labeled.GrowingTimeWindowLabeled(n_samples=None, n_cols=None, header=None, dtype=float)

Bases: pswamp.utils.time_window.GrowingTimeWindow, TimeWindowLabeled

Stores the most recent n_samples of multichannel data, and corresponding time stamps. Updating with a new set of measurements is efficient, since only one row in the data array (self._data) is overwritten.

indexer
header
get_col_str(*args, **kwargs)

Get data columns based on lookup of strings in self.header. TODO: This function is defined twice, also in TimeWindowLabeled. If not redefined here, it will use TimeWindow’s get_col, not GrowingTimeWindow’s variant. Could probably be done in a nicer way.

Parameters:
  • *args – Strings to look for. Look for first arg in first header row, second in second row, and so on.

  • **kwargs – Dictionary with header rows to lookup as keys and entries as values

Returns:

Data array.

pswamp.utils.time_window_labeled.gtw