Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dual_annealing does not set the success attribute in OptimizeResult #9801

Closed
andyfaff opened this issue Feb 11, 2019 · 0 comments · Fixed by #9898
Closed

dual_annealing does not set the success attribute in OptimizeResult #9801

andyfaff opened this issue Feb 11, 2019 · 0 comments · Fixed by #9898
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize
Milestone

Comments

@andyfaff
Copy link
Contributor

from scipy.optimize import dual_annealing, rosen
res = dual_annealing(rosen, [(-2, 2), (-2, 2)])
print(res.success)

Gives:

--------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
~/miniconda3/envs/dev3/lib/python3.7/site-packages/scipy/optimize/optimize.py in __getattr__(self, name)
    113         try:
--> 114             return self[name]
    115         except KeyError:

KeyError: 'success'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
<ipython-input-4-402eff86d4dd> in <module>
      1 from scipy.optimize import dual_annealing, rosen
      2 res = dual_annealing(rosen, [(-2, 2), (-2, 2)])
----> 3 res.success

~/miniconda3/envs/dev3/lib/python3.7/site-packages/scipy/optimize/optimize.py in __getattr__(self, name)
    114             return self[name]
    115         except KeyError:
--> 116             raise AttributeError(name)
    117 
    118     __setattr__ = dict.__setitem__

AttributeError: success
sgubianpm added a commit to philipmorrisintl/scipy that referenced this issue Mar 4, 2019
@rgommers rgommers added defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize labels Mar 4, 2019
@rgommers rgommers added this to the 1.3.0 milestone Mar 5, 2019
rgommers added a commit that referenced this issue Mar 5, 2019
…cess_attribute

BUG: Set success attribute in OptimizeResult. See #9801
rlucas7 pushed a commit to rlucas7/scipy that referenced this issue Apr 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect A clear bug or issue that prevents SciPy from being installed or used as expected scipy.optimize
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants