def test_estimate_parameters(self, timestamps, measurements): from colonyscanalyser.utilities import round_tuple_floats assert GrowthCurveModel.estimate_parameters(timestamps, list()) == (0, 0, 0) assert GrowthCurveModel.estimate_parameters( timestamps, measurements, window=len(timestamps) + 1) == (0, 0, 0) with pytest.raises(ValueError): GrowthCurveModel.estimate_parameters(timestamps, [0]) assert round_tuple_floats( GrowthCurveModel.estimate_parameters(timestamps, measurements), 1) == (0.5, 1, 1) assert GrowthCurveModel.estimate_parameters( [0, 0, 0, 0, 0, 0], [0, 1, 3, 6, 10, 15], window=3) == (0, 5, 16.414213562373096)
def test_value_error(self): with pytest.raises(ValueError): round_tuple_floats(1)
def test_rounding(self, tuples, rounding): result = round_tuple_floats(tuples, rounding) for value in result: assert self.float_precision(value) <= rounding