# 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

  This file is part of APASVO.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''




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):

# 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


  This file is part of APASVO.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
'''




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,