From 0261c263c7a8fba8c95d63c6d0e59aea917b469c Mon Sep 17 00:00:00 2001 From: carhc Date: Mon, 14 Oct 2024 10:38:13 +0200 Subject: [PATCH] Rename get_fit_function_lt to get_function_and_seed_lt --- invisible_cities/reco/icaro_components.py | 3 +-- invisible_cities/reco/icaro_components_test.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/invisible_cities/reco/icaro_components.py b/invisible_cities/reco/icaro_components.py index 7a90d81cc..300ac675f 100644 --- a/invisible_cities/reco/icaro_components.py +++ b/invisible_cities/reco/icaro_components.py @@ -106,8 +106,7 @@ def select_fit_variables(fittype : KrFitFunction, elif fittype is KrFitFunction.log_lin: return dst.DT, -np.log(dst.S2e) -def get_fit_function_lt(fittype : KrFitFunction): - +def get_function_and_seed_lt(fittype : KrFitFunction): ''' Retrieve the fitting function and seed function based on the specified fittype. diff --git a/invisible_cities/reco/icaro_components_test.py b/invisible_cities/reco/icaro_components_test.py index d1bcdd384..3d9472d63 100644 --- a/invisible_cities/reco/icaro_components_test.py +++ b/invisible_cities/reco/icaro_components_test.py @@ -68,14 +68,14 @@ def test_select_fit_variables(sample_df): integers(min_value = 10, max_value = 1e3), floats (min_value = 1e3, max_value = 1e5), floats (min_value = 5e3, max_value = 1e5)) -def test_get_fit_function_lt_with_data(x_min, x_max, steps, e0, lt): +def test_get_function_and_seed_lt_with_data(x_min, x_max, steps, e0, lt): x = np.linspace(x_min, x_max, steps) y = expo(x, e0, lt) - fit_func_lin, seed_func_lin = icarcomp.get_fit_function_lt(KrFitFunction.linear) - fit_func_expo, seed_func_expo = icarcomp.get_fit_function_lt(KrFitFunction.expo) - fit_func_log_lin, seed_func_log_lin = icarcomp.get_fit_function_lt(KrFitFunction.log_lin) + fit_func_lin, seed_func_lin = icarcomp.get_function_and_seed_lt(KrFitFunction.linear) + fit_func_expo, seed_func_expo = icarcomp.get_function_and_seed_lt(KrFitFunction.expo) + fit_func_log_lin, seed_func_log_lin = icarcomp.get_function_and_seed_lt(KrFitFunction.log_lin) popt_lin, _ = so.curve_fit(fit_func_lin, x, y, p0=seed_func_lin (x, y)) popt_expo, _ = so.curve_fit(fit_func_expo, x, y, p0=seed_func_expo (x, y))