Skip to content

Commit

Permalink
Fixed bisection without verbosity
Browse files Browse the repository at this point in the history
  • Loading branch information
mbillingr committed Feb 8, 2016
1 parent fa2ac1a commit 8be27de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions scot/var.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,10 @@ def optimize_delta_bisection(self, data, skipstep=1, verbose=None):
(ja, ka) = msge(data, trform(a), self.xvschema, skipstep, self.p)
(jb, kb) = msge(data, trform(b), self.xvschema, skipstep, self.p)

if trform(b) >= maxdelta and verbose:
print('Bisection: could not find initial interval.')
print(' ********* Delta set to zero! ************ ')
if trform(b) >= maxdelta:
if verbose:
print('Bisection: could not find initial interval.')
print(' ********* Delta set to zero! ************ ')
return 0

nsteps = 0
Expand Down
2 changes: 1 addition & 1 deletion tests/test_var_builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ def test_bisection_invalid(self):
var = VAR(1)
var.optimize_delta_bisection(x)

# nice data, so the regularization should not be too strong.
# totally ugly data, should be unable to find reasonable regularization.
self.assertEqual(var.delta, 0)

0 comments on commit 8be27de

Please sign in to comment.