in src/lookoutequipment/plot.py [0:0]
def add_signal(self, signals_list):
"""
This method will let you select which signals you want to plot. It will
double check that the signals are, actually available in the tags list.
This method will populate the ``signal_data`` property with the list of
each dataframes containing the signals to plot.
Parameters:
signals_list (list of string):
A list of tag names to be rendered when you call ``plot()``
Raises:
Exception: if some of the signals are not found in the tags list
"""
if self._tags_list is None:
self._build_tags_list()
# Check the list of requested signals:
intersection = [tag for tag in self._tags_list if tag in signals_list]
if len(intersection) != len(signals_list):
unknown_signals = [tag for tag in signals_list if tag not in intersection]
raise Exception(f'Signals not found in the tags list: {unknown_signals}')
self._signals_to_plot += signals_list
# Extract the series and store them in the current object instance:
for tag_name in signals_list:
if self.verbose:
print(f'Extracting {tag_name}')
self._extract_series(tag_name)
# Prepare the figure:
self.fig_height = 4
self.height_ratios = [8]
self.nb_plots += 1