Skip to content

Commit

Permalink
Remove unused imports and Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
carhc committed Oct 14, 2024
1 parent 0261c26 commit 94087c9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
4 changes: 2 additions & 2 deletions invisible_cities/core/fit_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def fit(func, x, y, seed=(), fit_range=None, **kwargs):
Returns
-------
fitted_fun : FitFunction
Extended function containing fit parameters (fitf, vals, errors, chi2, pval,
cov) and full_output from curve_fit and leastsq (infodict, mesg and ier).
Extended function containing fit parameters (fitf, vals, errors, chi2, pval,
cov) and full_output from curve_fit and leastsq (infodict, mesg and ier).
Examples
Expand Down
1 change: 0 additions & 1 deletion invisible_cities/core/fit_functions_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from hypothesis.strategies import floats
from . testing_utils import float_arrays
from . testing_utils import random_length_float_arrays
from .. evm.ic_containers import FitFunction

from . import core_functions as core
from . import fit_functions as fitf
Expand Down
12 changes: 0 additions & 12 deletions invisible_cities/reco/icaro_components.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import numpy as np
import pandas as pd

from typing import Optional
from ..types.symbols import KrFitFunction
from .. evm.ic_containers import FitFunction
from .. core.fit_functions import polynom, expo


def lin_seed(x : np.array,
y : np.array):

'''
Estimate the seed for a linear fit.
Expand Down Expand Up @@ -44,7 +42,6 @@ def lin_seed(x : np.array,

def expo_seed(x : np.array,
y : np.array):

'''
Estimate the seed for an exponential fit.
Expand All @@ -62,7 +59,6 @@ def expo_seed(x : np.array,
'''

x, y = zip(*sorted(zip(x, y)))

const = y[0]

if const <= 0 or y[-1] <= 0:
Expand All @@ -76,16 +72,9 @@ def expo_seed(x : np.array,

def select_fit_variables(fittype : KrFitFunction,
dst : pd.DataFrame):

'''
Select the data for fitting based on the specified fit type.
NOTES: Since x axis (DT) is never altered, maybe we can just
return the y values. However, when we implement the binned fit,
the profile could be done here (?) so it would make sense to
always provide both x and y. We could rename parameters and have
fittype (binned / unbinned) and fitfunction (lin, expo, log-lin...)
Parameters
----------
fittype : KrFitFunction
Expand Down Expand Up @@ -133,7 +122,6 @@ def get_function_and_seed_lt(fittype : KrFitFunction):


def transform_parameters(fit_output : FitFunction):

'''
Transform the parameters obtained from the fitting output into EO and LT.
When using log_lin fit, we need to convert the intermediate variables into
Expand Down
1 change: 1 addition & 0 deletions invisible_cities/reco/icaro_components_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def sample_df():
'S2e': [50, 45, 42, 41, 41]
}
return pd.DataFrame(data)

def test_select_fit_variables(sample_df):

x_linear, y_linear = icarcomp.select_fit_variables(KrFitFunction.linear, sample_df)
Expand Down

0 comments on commit 94087c9

Please sign in to comment.