@@ -233,11 +233,19 @@ def _run_interaction_regression(
233233 # in the result based on the specific requirements of the analysis
234234 if lrdf == 0 and lrstat == 0 :
235235 # Both models are equal
236- yield {"Converged" : True , "LRT_pvalue" : lr_pvalue , "Log" : "Both models are equivalent in terms of fit" }
236+ yield {
237+ "Converged" : True ,
238+ "LRT_pvalue" : lr_pvalue ,
239+ "Log" : "Both models are equivalent in terms of fit" ,
240+ }
237241 elif np .isnan (lr_pvalue ):
238242 # There is an issue with the LRT calculation
239243 # TODO: Extend the logs returns
240- yield {"Converged" : True , "LRT_pvalue" : lr_pvalue , "Log" : "Both models are equivalent in terms of fit" }
244+ yield {
245+ "Converged" : True ,
246+ "LRT_pvalue" : lr_pvalue ,
247+ "Log" : "Both models are equivalent in terms of fit" ,
248+ }
241249 else :
242250 if report_betas :
243251 # Get beta, SE, and pvalue from interaction terms
@@ -280,7 +288,7 @@ def _run_interaction_regression(
280288 "Full_Var2_SE" : est .bse [term_2 ],
281289 "Full_Var2_Pval" : est .pvalues [term_2 ],
282290 "LRT_pvalue" : lr_pvalue ,
283- "Log" : ""
291+ "Log" : "" ,
284292 }
285293 else :
286294 # Only return the LRT result
@@ -289,7 +297,11 @@ def _run_interaction_regression(
289297 else :
290298 # Did not converge - nothing to update
291299 # yield dict()
292- yield {"Converged" : False , "LRT_pvalue" : "NaN" , "Log" : "One or Both models NOT Converge" }
300+ yield {
301+ "Converged" : False ,
302+ "LRT_pvalue" : "NaN" ,
303+ "Log" : "One or Both models NOT Converge" ,
304+ }
293305
294306 def _get_interaction_specific_data (self , interaction : Tuple [str , str ]):
295307 """Select the data relevant to performing a regression on a given interaction, encoding genotypes if needed"""
@@ -412,9 +424,7 @@ def _run_interaction(
412424 complete_case_mask = ~ data .isna ().any (axis = 1 )
413425 N = complete_case_mask .sum ()
414426 if N == 0 :
415- raise ValueError (
416- f"No Overlap (min_n filter: { N } < { min_n } )"
417- )
427+ raise ValueError (f"No Overlap (min_n filter: { N } < { min_n } )" )
418428 if N < min_n :
419429 raise ValueError (
420430 f"too few complete observations (min_n filter: { N } < { min_n } )"
0 commit comments