| @@ 73-85 (lines=13) @@ | ||
| 70 | np.testing.assert_almost_equal(calculations.peak_heights(potentials_d, currents_d)[1], 4.998, decimal=3, err_msg="min peak height incorrect for data") |
|
| 71 | ||
| 72 | ||
| 73 | def test_peak_ratio(): |
|
| 74 | """This function tests peak_ratio() function.""" |
|
| 75 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 76 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 77 | potentials_d = pd.DataFrame(potentials) |
|
| 78 | currents_d = pd.DataFrame(currents) |
|
| 79 | ||
| 80 | assert (isinstance(calculations.peak_ratio(potentials_d, currents_d)) |
|
| 81 | == np.ndarray, "output is not an array") |
|
| 82 | assert (len(calculations.peak_ratio(potentials_d, currents_d)) |
|
| 83 | == 1, "output list is not the correct length") |
|
| 84 | np.testing.assert_almost_equal(calculations.peak_ratio(potentials_d, currents_d), |
|
| 85 | 1.451, decimal=3, err_msg="max peak height incorrect for data") |
|
| 86 | ||
| @@ 63-73 (lines=11) @@ | ||
| 60 | return |
|
| 61 | ||
| 62 | ||
| 63 | def test_peak_ratio(): |
|
| 64 | """This function tests peak_ratio() function.""" |
|
| 65 | potentials = [0.500, 0.498, 0.499, 0.497] |
|
| 66 | currents = [7.040, 6.998, 8.256, 8.286] |
|
| 67 | potentials_d = pd.DataFrame(potentials) |
|
| 68 | currents_d = pd.DataFrame(currents) |
|
| 69 | ||
| 70 | assert type(calculations.peak_ratio(potentials_d, currents_d)) == np.ndarray, "output is not an array" |
|
| 71 | assert len(calculations.peak_ratio(potentials_d, currents_d)) == 1, "output list is not the correct length" |
|
| 72 | np.testing.assert_almost_equal(calculations.peak_ratio(potentials_d, currents_d), 1.451, decimal=3), "max peak height incorrect for data" |
|
| 73 | return |
|
| 74 | ||