From c218a893b2747d20ce0867f929b03f8a9373a0df Mon Sep 17 00:00:00 2001 From: Gerardo Date: Thu, 25 Jan 2024 01:05:54 +0100 Subject: [PATCH] codeclimate details --- qutip/solver/heom/bofin_baths.py | 2 +- qutip/solver/heom/bofin_fit.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qutip/solver/heom/bofin_baths.py b/qutip/solver/heom/bofin_baths.py index d6ade6d5d5..165620548c 100644 --- a/qutip/solver/heom/bofin_baths.py +++ b/qutip/solver/heom/bofin_baths.py @@ -1281,4 +1281,4 @@ def _calc_chi(self, Nk): alpha_p += alpha_p.transpose() evals = eigvalsh(alpha_p) chi = [-2. / val for val in evals[0: Nk - 1]] - return chi \ No newline at end of file + return chi diff --git a/qutip/solver/heom/bofin_fit.py b/qutip/solver/heom/bofin_fit.py index 260b12fde7..cd39fda7f4 100644 --- a/qutip/solver/heom/bofin_fit.py +++ b/qutip/solver/heom/bofin_fit.py @@ -117,10 +117,9 @@ def get_fit( N : optional,int Number of underdamped oscillators to use, if set to False it is found automatically. - Nk : optional,int - Number of exponential terms used to approximate the bath correlation - functions. Defaults to 5 + Number of exponential terms used to approximate the bath + correlation functions. Defaults to 5 final_rmse : float Desired normalized root mean squared error . lower : list @@ -147,7 +146,7 @@ def get_fit( spec_n = len(params[0]) end = time() fit_time = end - start - bath = self._generate_bath(params,Nk) + bath = self._generate_bath(params, Nk) bath.spectral_density = self._J_fun summary = gen_summary( fit_time, rmse, N, "The Spectral Density", *params) @@ -678,7 +677,8 @@ def _fit( except Exception: sigma = 1e-4 C_max = abs(max(C, key=abs)) - if C_max == 0: ## When The correlation does not have imaginary or real part + if C_max == 0: + # When The correlation does not have imaginary or real part rmse = 0 params = [0, 0, 0] return rmse, params @@ -833,4 +833,4 @@ def two_column_summary( formatted_line1 = f"{line1:<{max_length1}} |" formatted_line2 = f"{line2:<{max_length2}}" full_summary += formatted_line1 + formatted_line2 + "\n" - return full_summary \ No newline at end of file + return full_summary