<commit_before>import matplotlib.pyplot as plt

import data_capture


class PostProcessor:
    def __init__(self, run_experiment, run_data_capture, cfg):
        self._run_experiment = run_experiment
        self._run_data_capture = run_data_capture
        self._cfg = cfg

    @staticmethod
    def get_supported_data_capture(self):
        raise NotImplementedError()

    def process(self, data):
        raise NotImplementedError()


class ScopeSignalProcessor(PostProcessor):
    def __init__(self, run_experiment, run_data_capture, cfg):
        PostProcessor.__init__(self, run_experiment, run_data_capture, cfg)

        # Setup axes
        plt.ion()

        self._scope_fig, self._scope_axes = plt.subplots(2, sharex=True)

        self._scope_axes[0].set_title('Oscilloscope Signals')

        self._scope_axes[1].set_xlabel('Time (us)')
        self._scope_axes[0].set_ylabel('Input Signal (V)')
        self._scope_axes[1].set_ylabel('Output Signal (V)')

        self._scope_axes_line = (None, None)

        plt.show()

    @staticmethod
    def get_supported_data_capture(self):
        return data_capture.PulseData,

    def process(self, data):
        time = data['result_scope_time']
        scope = (data['result_scope_in'], data['result_scope_out'])

        for line in [1, 2]:
            if self._scope_axes_line[line] is None:
                self._scope_axes_line[line] = self._scope_axes[line].plot(time, scope[line])
            else:
                self._scope_axes_line[line].set_ydata(scope[line])

        self._scope_fig.canvas.draw()

        return data
<commit_msg>Fixed static method in post-processor<commit_after>import matplotlib.pyplot as plt

import data_capture


class PostProcessor:
    def __init__(self, run_experiment, run_data_capture, cfg):
        self._run_experiment = run_experiment
        self._run_data_capture = run_data_capture
        self._cfg = cfg

    @staticmethod
    def get_supported_data_capture():
        raise NotImplementedError()

    def process(self, data):
        raise NotImplementedError()


class ScopeSignalProcessor(PostProcessor):
    def __init__(self, run_experiment, run_data_capture, cfg):
        PostProcessor.__init__(self, run_experiment, run_data_capture, cfg)

        # Setup axes
        plt.ion()

        self._scope_fig, self._scope_axes = plt.subplots(2, sharex=True)

        self._scope_axes[0].set_title('Oscilloscope Signals')

        self._scope_axes[1].set_xlabel('Time (us)')
        self._scope_axes[0].set_ylabel('Input Signal (V)')
        self._scope_axes[1].set_ylabel('Output Signal (V)')

        self._scope_axes_line = (None, None)

        plt.show()

    @staticmethod
    def get_supported_data_capture(self):
        return data_capture.PulseData,

    def process(self, data):
        time = data['result_scope_time']
        scope = (data['result_scope_in'], data['result_scope_out'])

        for line in [1, 2]:
            if self._scope_axes_line[line] is None:
                self._scope_axes_line[line] = self._scope_axes[line].plot(time, scope[line])
            else:
                self._scope_axes_line[line].set_ydata(scope[line])

        self._scope_fig.canvas.draw()

        return data

{'fraction_non_alphanumeric': 0.10241336633663366, 'fraction_numerical': 0.004331683168316832, 'mean_word_length': 2.981527093596059, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7511930', 'n_tokens_mistral': 1053, 'n_tokens_neox': 988, 'n_words': 186}