From 7a7aff5432e4aca30b1dd3e4163868aa9dd1695e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 15:35:48 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- cubehandler/cube.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cubehandler/cube.py b/cubehandler/cube.py index 5d37155..0d28d51 100644 --- a/cubehandler/cube.py +++ b/cubehandler/cube.py @@ -13,7 +13,7 @@ def remove_trailing_zeros(number): # Format the number using fixed-point notation with high precision - number_str = "{:.11f}".format(number) + number_str = f"{number:.11f}" # Remove trailing zeros and a possible trailing decimal point number_str = number_str.rstrip("0").rstrip(".") @@ -189,7 +189,7 @@ def write_cube_file(self, filename, low_precision=False): if low_precision: string_io = io.StringIO() - format_string = "%.{}f".format(self.low_precision_decimals) + format_string = f"%.{self.low_precision_decimals}f" np.savetxt(string_io, self.data.flatten(), fmt=format_string) result_string = remove_useless_zeros(string_io.getvalue()) f.write(result_string)