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

Fixed show_progress error #1794

Merged
merged 4 commits into from
Dec 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions openmdao/core/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,9 @@ def check_totals(self, of=None, wrt=None, out_stream=_DEFAULT_OUT_STREAM, compac
For 'rel error', 'abs error', 'magnitude' the value is: A tuple containing norms for
forward - fd, adjoint - fd, forward - adjoint.
"""
if out_stream == _DEFAULT_OUT_STREAM:
out_stream = sys.stdout

if self._metadata['setup_status'] < _SetupStatus.POST_FINAL_SETUP:
raise RuntimeError(self.msginfo + ": run_model must be called before total "
"derivatives can be checked.")
Expand Down
5 changes: 4 additions & 1 deletion openmdao/core/tests/test_check_derivs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
from openmdao.test_suite.components.simple_comps import DoubleArrayComp
from openmdao.test_suite.components.array_comp import ArrayComp
from openmdao.test_suite.groups.parallel_groups import FanInSubbedIDVC, Diamond
from openmdao.utils.assert_utils import assert_near_equal, assert_warning, assert_check_partials
from openmdao.utils.assert_utils import assert_near_equal, assert_warning, assert_check_partials, \
assert_no_warning
from openmdao.utils.mpi import MPI

try:
Expand Down Expand Up @@ -2586,6 +2587,8 @@ def test_check_totals_show_progress(self):
lines = stream.getvalue()
self.assertFalse("Checking derivatives with respect to" in lines)

prob.check_totals(method='fd', show_progress=True)

def test_desvar_as_obj(self):
prob = om.Problem()
prob.model = SellarDerivatives()
Expand Down