def test_calculatefirstderivative_yaxis(self): """Step4 - derivative: testing the first derivative calculation - axis y""" [xdata, ydata, edata] = loadCsvFile("peak_finder_algorithms/easy_data_set.csv") peakfinder = PeakFinderDerivation(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.getFirstDerivative() ydata10 = ydata_first[0:10] self.assertEqual(ydata10, [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 4.0, 1.0, -1.0])
def test_calculatefirstderivative_xaxis(self): """Step4 - derivative: testing the first derivative calculation - axis x""" [xdata, ydata, edata] = loadCsvFile("peak_finder_algorithms/easy_data_set.csv") peakfinder = PeakFinderDerivation(xdata, ydata, edata) [xdata_first, ydata_first] = peakfinder.getFirstDerivative() xdata10 = xdata_first[0:10] self.assertEqual(xdata10, [0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, 9.5])