# Path: apasvo/utils/plotting.py
# SPECGRAM_WINDOWS = ("boxcar", "hamming", "hann", "bartlett",
#                             'blackman', "blackmanharris")
# SPECGRAM_WINDOWS_NAMES = ("Rectangular", "Hamming", "Hann", "Bartlett",
#                           "Blackman", "Blackman-Harris")
# def plot_specgram(ax, data, fs, nfft=256, noverlap=128, window='hann',
#                   cmap='jet', interpolation='bilinear', rasterized=True):
# def reduce_data(x, y, width, xmin=0, xmax=None):
# def adjust_axes_height(ax, max_value=None, min_value=None, margin=0.1):


import unittest
import numpy as np
from apasvo.utils import plotting
'''




class Check_utils_plotting_reduce_data(unittest.TestCase):

    xdata = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    ydata = [5, 0, -5, 0, 1, 2, 0, -1, -2, 5, 5]
    width = 3
    xmin, xmax = 1, 10
    xreduced = [1, 2, 4, 5, 7, 8, 9, 10]
    yreduced = [0, -5, 1, 2, -1, -2, 5, 5]

    def test_reduce_data_returns_correct_results(self):
        xres, yres = plotting.reduce_data(self.xdata, self.ydata, self.width,
                                          self.xmin, self.xmax)
        self.assertTrue(np.all(self.xreduced == xres))
        self.assertTrue(np.all(self.yreduced == yres))

    def test_too_much_width_returns_input_data(self):
        xres, yres = plotting.reduce_data(self.xdata, self.ydata, 15)
        self.assertTrue(np.all(self.xdata == xres))
        self.assertTrue(np.all(self.ydata == yres))

    def test_x_y_with_different_length_returns_error(self):
        self.assertRaises(ValueError, plotting.reduce_data, self.xdata,
                          np.random.randn(5), self.width)

    def test_xmax_not_greater_than_xmin_returns_error(self):

# Path: apasvo/utils/plotting.py
# SPECGRAM_WINDOWS = ("boxcar", "hamming", "hann", "bartlett",
#                             'blackman', "blackmanharris")
# SPECGRAM_WINDOWS_NAMES = ("Rectangular", "Hamming", "Hann", "Bartlett",
#                           "Blackman", "Blackman-Harris")
# def plot_specgram(ax, data, fs, nfft=256, noverlap=128, window='hann',
#                   cmap='jet', interpolation='bilinear', rasterized=True):
# def reduce_data(x, y, width, xmin=0, xmax=None):
# def adjust_axes_height(ax, max_value=None, min_value=None, margin=0.1):


# Path: tests/tests_utils.py
import unittest
import numpy as np
from apasvo.utils import plotting

'''




class Check_utils_plotting_reduce_data(unittest.TestCase):

    xdata = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    ydata = [5, 0, -5, 0, 1, 2, 0, -1, -2, 5, 5]
    width = 3
    xmin, xmax = 1, 10
    xreduced = [1, 2, 4, 5, 7, 8, 9, 10]
    yreduced = [0, -5, 1, 2, -1, -2, 5, 5]

    def test_reduce_data_returns_correct_results(self):
        xres, yres = plotting.reduce_data(self.xdata, self.ydata, self.width,
                                          self.xmin, self.xmax)
        self.assertTrue(np.all(self.xreduced == xres))
        self.assertTrue(np.all(self.yreduced == yres))

    def test_too_much_width_returns_input_data(self):
        xres, yres = plotting.reduce_data(self.xdata, self.ydata, 15)
        self.assertTrue(np.all(self.xdata == xres))
        self.assertTrue(np.all(self.ydata == yres))

    def test_x_y_with_different_length_returns_error(self):
        self.assertRaises(ValueError, plotting.reduce_data, self.xdata,
                          np.random.randn(5), self.width)

    def test_xmax_not_greater_than_xmin_returns_error(self):

        self.assertRaises(ValueError, plotting.reduce_data, self.xdata,