import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from neuronautics.analysis.type.misc_analysis import MiscAnalysis


class {{ class_name }}(MiscAnalysis):
    def get_input_params(self):
        # Define your method logic here
        return []

    def run(self, spikes, *args, **kwargs):
        # Define your method logic here
        dt = 0.01
        t = np.arange(0, 30, dt)
        nse1 = np.random.randn(len(t))                 # white noise 1
        nse2 = np.random.randn(len(t))                 # white noise 2

        # Two signals with a coherent part at 10 Hz and a random part
        s1 = np.sin(2 * np.pi * 10 * t) + nse1
        s2 = np.sin(2 * np.pi * 10 * t) + nse2
        return dt, t, s1, s2

    def plot(self, *args, **kwargs):
        # Fixing random state for reproducibility
        np.random.seed(19680801)

        # Call run for generating the data to be plotted
        dt, t, s1, s2 = self.run(*args, **kwargs)

        fig, axs = plt.subplots(2, 1)
        axs[0].plot(t, s1, t, s2)
        axs[0].set_xlim(0, 2)
        axs[0].set_xlabel('Time')
        axs[0].set_ylabel('s1 and s2')
        axs[0].grid(True)

        cxy, f = axs[1].cohere(s1, s2, 256, 1. / dt)
        axs[1].set_ylabel('Coherence')

        fig.tight_layout()
        return fig  # return the figure to be embedded in the viewer

if __name__ == "__main__":
    # Sample dataframe
    sample_data = pd.DataFrame({
        'column1': [1, 2, 3],
        'column2': ['A', 'B', 'C']
    })

    # Instantiate your class and call methods
    instance = {{ class_name }}()
    instance.get_input_params()
    instance.run()
