From a291f1b5c77b75d414867296a8be758b9aea5516 Mon Sep 17 00:00:00 2001 From: alejandroaldas <52395149+alejandroaldas@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:44:40 -0500 Subject: [PATCH 1/3] Fix enumeration order in FFT string representation --- maths/radix2_fft.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/maths/radix2_fft.py b/maths/radix2_fft.py index 2c5cdc004d1d..83423e2e2a49 100644 --- a/maths/radix2_fft.py +++ b/maths/radix2_fft.py @@ -157,15 +157,15 @@ def __multiply(self): # Overwrite __str__ for print(); Shows A, B and A*B def __str__(self): - a = "A = " + " + ".join( - f"{coef}*x^{i}" for coef, i in enumerate(self.polyA[: self.len_A]) - ) - b = "B = " + " + ".join( - f"{coef}*x^{i}" for coef, i in enumerate(self.polyB[: self.len_B]) - ) - c = "A*B = " + " + ".join( - f"{coef}*x^{i}" for coef, i in enumerate(self.product) - ) + a = "A = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.polyA[: self.len_A]) + ) + b = "B = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.polyB[: self.len_B]) + ) + c = "A*B = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.product) + ) return f"{a}\n{b}\n{c}" From 7cd8f0530876ef789be50b7ce16e4b1b8ae7f870 Mon Sep 17 00:00:00 2001 From: alejandroaldas Date: Tue, 3 Jun 2025 19:51:00 +0000 Subject: [PATCH 2/3] updating DIRECTORY.md --- DIRECTORY.md | 1 + 1 file changed, 1 insertion(+) diff --git a/DIRECTORY.md b/DIRECTORY.md index 00f4bb4ef2b2..dfecc9cfe584 100644 --- a/DIRECTORY.md +++ b/DIRECTORY.md @@ -443,6 +443,7 @@ * [Present Value](financial/present_value.py) * [Price Plus Tax](financial/price_plus_tax.py) * [Simple Moving Average](financial/simple_moving_average.py) + * [Straight Line Depreciation](financial/straight_line_depreciation.py) * [Time And Half Pay](financial/time_and_half_pay.py) ## Fractals From 2ec488a57e044d72fcb3c0a6c75c8f77a87d705c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 19:54:20 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- maths/radix2_fft.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/maths/radix2_fft.py b/maths/radix2_fft.py index f815634725b2..fc71f98ec0be 100644 --- a/maths/radix2_fft.py +++ b/maths/radix2_fft.py @@ -158,15 +158,15 @@ def __multiply(self): # Overwrite __str__ for print(); Shows A, B and A*B def __str__(self): - a = "A = " + " + ".join( - f"{coef}*x^{i}" for i, coef in enumerate(self.polyA[: self.len_A]) - ) - b = "B = " + " + ".join( - f"{coef}*x^{i}" for i, coef in enumerate(self.polyB[: self.len_B]) - ) - c = "A*B = " + " + ".join( - f"{coef}*x^{i}" for i, coef in enumerate(self.product) - ) + a = "A = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.polyA[: self.len_A]) + ) + b = "B = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.polyB[: self.len_B]) + ) + c = "A*B = " + " + ".join( + f"{coef}*x^{i}" for i, coef in enumerate(self.product) + ) return f"{a}\n{b}\n{c}"