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

Warn users when restarting with fix_final=True #804

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

kaushikponnapalli
Copy link
Contributor

Summary

Added a warning if load case is called while fix_final is set to True. If the case being loaded has a different final value than the user-specified value, the value from the loaded case will overwrite the specified value.

Related Issues

Backwards incompatibilities

None

New Dependencies

None

@@ -149,6 +150,12 @@ def load_case(problem, previous_solution):
if init_val_path:
problem.set_val(init_val_path[0], prev_state_val[0, ...], units=prev_state_units)

if options['fix_final']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to use the OpenMDAO helper issue_warning in instead of warnings.warn. See

issue_warning(f"The timeseries variable name {output_name} is "

@coveralls
Copy link

Coverage Status

Coverage remained the same at 95.52% when pulling 85c3eb7 on kaushikponnapalli:restart_fix_final into 8dbed22 on OpenMDAO:master.

@robfalck robfalck merged commit 425becc into OpenMDAO:master Aug 18, 2022
bernardopacini pushed a commit to kanekosh/dymos that referenced this pull request Aug 19, 2022
* added a warning if load case is called while fix_final is set to True

* added test case

* added similar warnings for controls and polynomial controls

* switched warning to issue_warning

Co-authored-by: Kaushik Ponnapalli <kaushik.s.ponnapalli@nasa.gov>
@kaushikponnapalli kaushikponnapalli deleted the restart_fix_final branch August 19, 2022 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interaction of using a restart file with fix_final=True on states.
3 participants