Skip to content

Commit

Permalink
Merge pull request #104 from MilesCranmer/deepsource-transform-a53be7e0
Browse files Browse the repository at this point in the history
Format code with black
  • Loading branch information
MilesCranmer committed Feb 11, 2022
2 parents 60e8eba + 932dcf5 commit 4409272
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 4409272

Please sign in to comment.