Permalink
Browse files

Solution to passing argument was obvious: rename the option within fr…

…amework
  • Loading branch information...
1 parent aa4bc95 commit 4c5885bc58b8314c708169aa6838f2e832f87c27 Andrew Lambe committed Jul 3, 2012
Showing with 2 additions and 13 deletions.
  1. +2 −13 nlpy/optimize/solvers/auglag2.py
@@ -239,13 +239,7 @@ class AugmentedLagrangianLbfgs(AugmentedLagrangian):
def __init__(self, nlp, **kwargs):
AugmentedLagrangian.__init__(self, nlp, **kwargs)
- # Surely there's a faster way to do this ...
- if 'npairs' in kwargs:
- npairs = kwargs['npairs']
- del kwargs['npairs']
- else:
- npairs = 5
- self.Hessapp = LBFGS(self.n, npairs=npairs, **kwargs)
+ self.Hessapp = LBFGS(self.n, npairs=kwargs.get('qn_pairs',5), **kwargs)
def hprod(self, x, z, v, **kwargs):
@@ -304,12 +298,7 @@ class AugmentedLagrangianLsr1(AugmentedLagrangianLbfgs):
def __init__(self, nlp, **kwargs):
AugmentedLagrangian.__init__(self, nlp, **kwargs)
- if 'npairs' in kwargs:
- npairs = kwargs['npairs']
- del kwargs['npairs']
- else:
- npairs = 5
- self.Hessapp = LSR1(self.n, npairs=npairs, **kwargs)
+ self.Hessapp = LSR1(self.n, npairs=kwargs.get('qn_pairs',5), **kwargs)
# end class

0 comments on commit 4c5885b

Please sign in to comment.