Skip to content

Commit

Permalink
Fixed no parameter changes when max_radii and cutoffs not used.
Browse files Browse the repository at this point in the history
When any method in gradient generates parameter changes, these
are then run through gradient.check, which checks whether the radius
of unscaled parameter changes meets certain user specified conditions
(currently, those conditions are given in the __init__ statement of
gradient.Gradient).

It would first check for max_radii and then for cutoffs. However,
if neither were used, it would incorrectly return None rather than
returning the unscaled parameter changes.

This should fix issue #7.
  • Loading branch information
ericchansen committed Jun 10, 2016
1 parent 96eb161 commit d646465
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ def __init__(self,
direc, ff, ff_lines, args_ff, args_ref)
# Whether or not to generate parameters with these methods.
self.do_lstsq = True
self.do_lagrange = False
self.do_levenberg = False
self.do_lagrange = True
self.do_levenberg = True
self.do_newton = True
self.do_svd = False
self.do_svd = True
# Particular settings for each method.
# LEAST SQUARES
self.lstsq_cutoffs = None
Expand Down Expand Up @@ -288,6 +288,8 @@ def check(changes, max_radii, cutoffs):
elif cutoffs:
if check_cutoffs(radius, cutoffs):
new_changes.append(change)
else:
new_changes.append(changes)
return new_changes

def check_cutoffs(par_rad, cutoffs):
Expand Down

0 comments on commit d646465

Please sign in to comment.