Skip to content

Commit 075eeea

Browse files
committed
Fix typing
1 parent 21f9b71 commit 075eeea

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

xifdr/utils/knee_finder.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def find_knees(df: Union[pl.DataFrame, pd.DataFrame],
2525
td_prob: int = 2,
2626
td_prot_prob: int = 10,
2727
td_dd_ratio: float = 1.0,
28-
custom_aggs: dict = None) -> tuple[float, float, float]:
28+
custom_aggs: dict = None) -> tuple[float, float, float, float]:
2929
"""
3030
3131
Parameters
@@ -118,7 +118,7 @@ def find_knees(df: Union[pl.DataFrame, pd.DataFrame],
118118
polynomial_degree=poly_deg
119119
)
120120
if kn.all_knees and kn.find_knee()[0] > 0:
121-
csm_knee_fdr = kn.find_knee()[0]
121+
csm_knee_fdr = float(kn.find_knee()[0])
122122

123123
df_csm = df_csm.filter(pl.col('csm_fdr') <= csm_knee_fdr)
124124

@@ -140,7 +140,7 @@ def find_knees(df: Union[pl.DataFrame, pd.DataFrame],
140140
polynomial_degree=poly_deg
141141
)
142142
if kn.all_knees and kn.find_knee()[0] > 0:
143-
pep_knee_fdr = kn.find_knee()[0]
143+
pep_knee_fdr = float(kn.find_knee()[0])
144144

145145
df_pep = df_pep.filter(pl.col('pep_fdr') <= pep_knee_fdr)
146146

@@ -161,7 +161,7 @@ def find_knees(df: Union[pl.DataFrame, pd.DataFrame],
161161
polynomial_degree=poly_deg
162162
)
163163
if kn.all_knees and kn.find_knee()[0] > 0:
164-
prot_knee_fdr = kn.find_knee()[0]
164+
prot_knee_fdr = float(kn.find_knee()[0])
165165

166166
df_prot = df_prot.filter(pl.col('prot_fdr') <= prot_knee_fdr)
167167

@@ -185,6 +185,6 @@ def find_knees(df: Union[pl.DataFrame, pd.DataFrame],
185185
polynomial_degree=poly_deg
186186
)
187187
if kn.all_knees and kn.find_knee()[0] > 0:
188-
link_knee_fdr = kn.find_knee()[0]
188+
link_knee_fdr = float(kn.find_knee()[0])
189189

190-
return (csm_knee_fdr, pep_knee_fdr, prot_knee_fdr, link_knee_fdr)
190+
return csm_knee_fdr, pep_knee_fdr, prot_knee_fdr, link_knee_fdr

0 commit comments

Comments
 (0)