Skip to content

Commit

Permalink
Format code with black
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in 1b8ec96 according to the output
from black.

Details: https://deepsource.io/gh/MilesCranmer/PySR/transform/1238fdcd-08b5-4b2e-ab9b-9efdb9123dab/
  • Loading branch information
deepsource-autofix[bot] committed Feb 11, 2022
1 parent 1b8ec96 commit 932dcf5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion benchmarks/hyperparamopt.py
Expand Up @@ -178,7 +178,7 @@ def merge_trials(trials1, trials2_slice):
max_evals=n + len(trials.trials),
trials=trials,
verbose=1,
rstate=np.random.RandomState(np.random.randint(1, 10 ** 6)),
rstate=np.random.RandomState(np.random.randint(1, 10**6)),
)
except hyperopt.exceptions.AllTrialsFailed:
continue
Expand Down
4 changes: 2 additions & 2 deletions pysr/sr.py
Expand Up @@ -78,8 +78,8 @@ def import_error_string(julia_project=None):
"div": lambda x, y: x / y,
"mult": lambda x, y: x * y,
"sqrt_abs": lambda x: sympy.sqrt(abs(x)),
"square": lambda x: x ** 2,
"cube": lambda x: x ** 3,
"square": lambda x: x**2,
"cube": lambda x: x**3,
"plus": lambda x, y: x + y,
"sub": lambda x, y: x - y,
"neg": lambda x: -x,
Expand Down
6 changes: 3 additions & 3 deletions test/test.py
Expand Up @@ -40,7 +40,7 @@ def test_multioutput_custom_operator_quiet(self):
y = self.X[:, [0, 1]] ** 2
model = PySRRegressor(
unary_operators=["sq(x) = x^2"],
extra_sympy_mappings={"sq": lambda x: x ** 2},
extra_sympy_mappings={"sq": lambda x: x**2},
binary_operators=["plus"],
verbosity=0,
**self.default_test_kwargs,
Expand All @@ -65,7 +65,7 @@ def test_multioutput_weighted_with_callable_temp_equation(self):
model = PySRRegressor(
unary_operators=["sq(x) = x^2"],
binary_operators=["plus"],
extra_sympy_mappings={"sq": lambda x: x ** 2},
extra_sympy_mappings={"sq": lambda x: x**2},
**self.default_test_kwargs,
procs=0,
temp_equation_file=True,
Expand Down Expand Up @@ -121,7 +121,7 @@ def test_noisy(self):
# Test that passing a single operator works:
unary_operators="sq(x) = x^2",
binary_operators="plus",
extra_sympy_mappings={"sq": lambda x: x ** 2},
extra_sympy_mappings={"sq": lambda x: x**2},
**self.default_test_kwargs,
procs=0,
denoise=True,
Expand Down
2 changes: 1 addition & 1 deletion test/test_torch.py
Expand Up @@ -58,7 +58,7 @@ def test_pipeline(self):

def test_mod_mapping(self):
x, y, z = sympy.symbols("x y z")
expression = x ** 2 + sympy.atanh(sympy.Mod(y + 1, 2) - 1) * 3.2 * z
expression = x**2 + sympy.atanh(sympy.Mod(y + 1, 2) - 1) * 3.2 * z

module = sympy2torch(expression, [x, y, z])

Expand Down

0 comments on commit 932dcf5

Please sign in to comment.