mdolab / mdolab/pyoptsparse

`isMajor` not returned for non-major iterations using getValues

Open
#269 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
270
Forks
123
Avg merge
1d 18h
Merged PRs (30d)
3

Description

Description

The code incorrectly assumes that isMajor is only defined at major iterations.
The code makes the check for the isMajor flag as part of the check here

Possibly related to issue #250

Steps to reproduce issue
  1. create a history file using SNOPT
  2. optHist = History(hist_file)
    histValues = optHist.getValues('isMajor',major=False)
Current behavior

raises the warning

"The major flag has been set to True, since some names specified only exist on major iterations."

and returns the values of isMajor at only major iterations

Expected behavior

returns the value lf isMajor at all iterations

Code versions

List versions only if relevant

  • pyoptsparse: 2.6.2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read pyoptsparse/pyOpt_history.py around lines 597-602 and trace History.getValues with the major=False argument. Reproduce the issue by creating a history file using SNOPT, then call getValues('isMajor', major=False). Done means isMajor values are returned for all iterations without the major-iteration warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.