Skip to content

Clarify GradientTest for constrained variables #213

@mphoward

Description

@mphoward

The equations and documentation are written in a way that's confusing (it took me 20 minutes to convince myself what was written is correct!). We should make it clearer that when a variable is at its upper bound, it is converged if the gradient is negative (below the tolerance), while if it is at its lower bound, it is converged if the gradient is positive (above the tolerance). The negative signs and inequalities make this tricky currently.

There is also a typo in one of the unit tests:

x.value = -2.0
x.high = 2.0
self.assertFalse(t.converged(result=q.compute(x)))

Line 88 should be x.value = 2.0 so that the constrain is active.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions