From c374d8bed1a395e428c650042e35f0a6ae16bbdc Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 16 Feb 2024 11:32:28 +0100 Subject: [PATCH] round values in properties dataframe --- src/sipmarray/unit.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/sipmarray/unit.py b/src/sipmarray/unit.py index 03102ce..28c231d 100644 --- a/src/sipmarray/unit.py +++ b/src/sipmarray/unit.py @@ -175,11 +175,11 @@ def get_properties_str(self) -> str: main_string += f'Width tolerance: {self.width_tolerance} mm\n' main_string += f'Height tolerance: {self.height_tolerance} mm\n' main_string += '--------------------------------------------\n' - main_string += f'Total unit area: {self.total_area:.2f} mm^2\n' - main_string += f'Active area geometric correction: {self.active_area_correction:.2f}\n' - main_string += f'Active area: {self.active_area:.2f} mm^2\n' + main_string += f'Total unit area: {round(self.total_area):.2f} mm^2\n' + main_string += f'Active area geometric correction: {round(self.active_area_correction):.2f}\n' + main_string += f'Active area: {round(self.active_area):.2f} mm^2\n' main_string += '--------------------------------------------\n' - main_string += f'Active area fraction: {self.active_area_fraction*100:.2f} %\n' + main_string += f'Active area fraction: {round(self.active_area_fraction)*100:.2f} %\n' main_string += f'Photon detection efficiency: {self.pde*100:.2f} %' return main_string @@ -215,9 +215,9 @@ def get_properties_df(self) -> pd.DataFrame: self.height_active, self.width_tolerance, self.height_tolerance, - self.total_area, - self.active_area_correction, - self.active_area, - self.active_area_fraction, + round(self.total_area, 2), + round(self.active_area_correction, 2), + round(self.active_area, 2), + round(self.active_area_fraction, 2), self.pde]} return pd.DataFrame(properties)