pyoptsparse icon indicating copy to clipboard operation
pyoptsparse copied to clipboard

`getValues` with `allowSens=True` does not work without specifying `names`.

Open kanekosh opened this issue 3 years ago • 1 comments

Description

History.getValues() does not work when we call it with allowSens=True and default values for the other inputs. To make it work, users have to specify appropriate callCounters and names. The docstrings say it is up to the user to ensure that the callCounters specified contain the information requested, so this behavior is expected, but not very user-friendly.

Steps to reproduce issue

  1. Run one of the test problems.
  2. Read the history file and call hist.getValues(allowSense=True).

Current behavior

It tries to parse obj/con/funcs from the sensitivity evaluation, even though we don't have that info. Then it fails with KeyError.

Expected behavior

It should raise a pyOptSparse Warning or Error when allowSens=True and the (default or user-specified) callCounters and names are not valid. It'd be better if we can overwrite callCounters and names internally.

kanekosh avatar May 18 '21 14:05 kanekosh

Related to #250.

ewu63 avatar May 18 '21 14:05 ewu63