Skip to content

Commit

Permalink
STY: Added docstring to BenchLeastSquares + PEP8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Mayorov committed May 25, 2015
1 parent 6107403 commit 3b3b678
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/lsq_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def check_answer(self, x, ftol):
then False is returned.
"""
if (self.lb is not None and np.any(x < self.lb) or
self.ub is not None and np.any(x > self.ub)):
self.ub is not None and np.any(x > self.ub)):
return False

f = np.sum(self.fun(x) ** 2)
Expand Down
6 changes: 2 additions & 4 deletions benchmarks/benchmarks/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,10 @@
try:
import scipy.optimize
from scipy.optimize.optimize import rosen, rosen_der, rosen_hess
from scipy.optimize import leastsq
except ImportError:
pass

from scipy.optimize import leastsq



from . import test_functions as funcs
from .common import Benchmark
from .lsq_problems import extract_lsq_problems
Expand Down Expand Up @@ -242,6 +239,7 @@ def run_LJ(self, methods=None):


class BenchLeastSquares(Benchmark):
"""Class for benchmarking nonlinear least squares solvers."""
problems = extract_lsq_problems()
params = [
list(problems.keys()),
Expand Down

0 comments on commit 3b3b678

Please sign in to comment.