average_value is not None):
# Verification of the Steady State conditions following the SNIA
# definition
- range_condition = range_value < 0.20 * abs(average_value)
- slope_condition = slope_value < 0.10 * abs(average_value)
+ range_condition = abs(range_value) < 0.20 * abs(average_value)
+ slope_condition = abs(slope_value) < 0.10 * abs(average_value)
steady_state = range_condition and slope_condition
data_series = [[-15, 0.43], [-16, 0.41], [-3, 0.45], [4, 0.42]]
actual = SteadyState.steady_state(data_series)
self.assertEqual(expected, actual)
+
+ def test_negative_slope(self):
+ expected = False
+ data_series = [[1.3, 1], [1.2, 1], [1.1, 1.1], [1.0, 1.1]]
+ actual = SteadyState.steady_state(data_series)
+ self.assertEqual(expected, actual)