deepsource-autofix[bot] commited on
Commit
505bce0
1 Parent(s): d11773b

Format code with black

Browse files

This commit fixes the style issues introduced in d11773b according to the output
from black.

Details: https://deepsource.io/gh/MilesCranmer/PySR/transform/6e361fd3-a9c6-45c5-b5c5-df824cd0014c/

Files changed (1) hide show
  1. pysr/sr.py +5 -7
pysr/sr.py CHANGED
@@ -367,9 +367,7 @@ def pysr(
367
  if maxsize < 7:
368
  raise NotImplementedError("PySR requires a maxsize of at least 7")
369
 
370
- X, selection = _handle_feature_selection(
371
- X, select_k_features, y, variable_names
372
- )
373
 
374
  if maxdepth is None:
375
  maxdepth = maxsize
@@ -657,9 +655,7 @@ def _create_inline_operators(binary_operators, unary_operators):
657
  op_list[i] = function_name
658
 
659
 
660
- def _handle_feature_selection(
661
- X, select_k_features, y, variable_names
662
- ):
663
  if select_k_features is not None:
664
  selection = run_feature_selection(X, y, select_k_features)
665
  print(f"Using features {[variable_names[i] for i in selection]}")
@@ -801,7 +797,9 @@ def get_hof(
801
  sympy_format.append(eqn)
802
 
803
  # Numpy:
804
- lambda_format.append(CallableEquation(sympy_symbols, eqn, selection, variable_names))
 
 
805
 
806
  # JAX:
807
  if output_jax_format:
 
367
  if maxsize < 7:
368
  raise NotImplementedError("PySR requires a maxsize of at least 7")
369
 
370
+ X, selection = _handle_feature_selection(X, select_k_features, y, variable_names)
 
 
371
 
372
  if maxdepth is None:
373
  maxdepth = maxsize
 
655
  op_list[i] = function_name
656
 
657
 
658
+ def _handle_feature_selection(X, select_k_features, y, variable_names):
 
 
659
  if select_k_features is not None:
660
  selection = run_feature_selection(X, y, select_k_features)
661
  print(f"Using features {[variable_names[i] for i in selection]}")
 
797
  sympy_format.append(eqn)
798
 
799
  # Numpy:
800
+ lambda_format.append(
801
+ CallableEquation(sympy_symbols, eqn, selection, variable_names)
802
+ )
803
 
804
  # JAX:
805
  if output_jax_format: