def count_of_phones(self): return round_to_significant_figures( sum(area.count_of_phones for area in self.areas), 1)
def count_of_phones_likely(self): area_estimate = self.simple_polygons.estimated_area bleed_area_estimate = self.simple_polygons.bleed.estimated_area - area_estimate return round_to_significant_figures( self.count_of_phones + (self.count_of_phones * bleed_area_estimate / area_estimate), 1)
def test_round_to_significant_figures(value, significant_figures, expected_result): assert round_to_significant_figures(value, significant_figures) == expected_result