Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d5ddf32
Initial changes to the command line interface
hschilling Feb 26, 2026
0aaeb56
removed hangar subcommand
hschilling Feb 26, 2026
9545ca0
updated the docs for the convert subcommand. Changed the names so som…
hschilling Feb 26, 2026
3e20050
Changed the output file argument for the convert fortran_to_aviary co…
hschilling Feb 26, 2026
32f5df9
Fixed cmd line descriptions
hschilling Feb 26, 2026
550d938
merged in main
hschilling Mar 13, 2026
c13f559
Initial working version of rt plot for aviary missions
hschilling Mar 17, 2026
87cf3c2
Added note about max_iter being set to zero in the examples
hschilling Mar 18, 2026
356457b
Code cleanup
hschilling Mar 18, 2026
b2935c9
Added rt option to relevant methods in AviaryProblem so that realtime…
hschilling Mar 23, 2026
1b7898c
Added documentation on real-time plotting
hschilling Mar 24, 2026
f2bed85
merged out and fixed conflicts
hschilling Mar 24, 2026
4d6c841
Merge branch 'main' into IA884-cmd-line-refactor
Kenneth-T-Moore Mar 27, 2026
9490a81
fixed merge conflicts after merge out
hschilling Apr 6, 2026
c884336
Merge branch 'IA884-cmd-line-refactor' of https://github.com/hschilli…
hschilling Apr 6, 2026
ffd111f
Updated the tests for the command line changes. Also change the get_f…
hschilling Apr 7, 2026
d859829
Updated docs to reflect change in convert subcommand
hschilling Apr 7, 2026
bdf7032
Some doc fixes
Kenneth-T-Moore Apr 8, 2026
c4cfc51
Added level1 rtplot image for docs
hschilling Apr 8, 2026
459c9a2
Merge remote-tracking branch 'ken/herb_884' into IA884-cmd-line-refactor
hschilling Apr 8, 2026
f920256
Removed png from gitignore since we have png files for our docs
hschilling Apr 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ reports/
aviary/reports/
*.openmdao_out
*.out
*.png
*.sql
*.db
*.pdf
Expand Down
45 changes: 40 additions & 5 deletions aviary/core/aviary_problem.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import csv
import json
import os
import subprocess
import warnings
from copy import deepcopy
from datetime import datetime
from enum import Enum
from pathlib import Path
from packaging import version

import numpy as np
from itertools import count

import dymos as dm
import numpy as np
import openmdao
import openmdao.api as om
from openmdao.utils.reports_system import _default_reports
from openmdao.utils.units import convert_units
from packaging import version
import openmdao.utils.hooks as hooks

from aviary.core.aviary_group import AviaryGroup
from aviary.interface.utils import set_warning_format
Expand Down Expand Up @@ -1176,6 +1179,7 @@ def run_aviary_problem(
simulate=False,
make_plots=True,
verbosity=None,
rt=False,
):
"""
This function actually runs the Aviary problem, which could be a simulation,
Expand Down Expand Up @@ -1211,13 +1215,44 @@ def run_aviary_problem(
else:
verbosity = self.verbosity # defaults to BRIEF

if verbosity >= Verbosity.VERBOSE: # VERBOSE, DEBUG
if (
verbosity >= Verbosity.VERBOSE or rt
): # rt needs a driver recorder file to run the realtime plot server
recorder = om.SqliteRecorder('optimization_history.db')
self.driver.add_recorder(recorder)
self.final_setup()

if verbosity >= Verbosity.VERBOSE: # VERBOSE, DEBUG
with open(self.get_reports_dir() / 'input_list.txt', 'w') as outfile:
self.model.list_inputs(out_stream=outfile)

recorder = om.SqliteRecorder('optimization_history.db')
self.driver.add_recorder(recorder)
def _view_realtime_plot_hook(driver):
case_recorder_file = str(driver._rec_mgr._recorders[0]._filepath)

cmd = ['openmdao', 'realtime_plot', '--pid', str(os.getpid()), case_recorder_file]
cp = subprocess.Popen(cmd) # nosec: trusted input

# Do a quick non-blocking check to see if it immediately failed
# This will catch immediate failures but won't wait for the process to finish
quick_check = cp.poll()
if quick_check is not None and quick_check != 0:
# Process already terminated with an error
stderr = cp.stderr.read().decode()
raise RuntimeError(
f'Failed to start up the realtime plot server with code {quick_check}: {stderr}.'
)

# register the hook to stat up the real-time plot server
if rt:
if not self.driver:
raise RuntimeError(
'Unable to run realtime optimization progress plot because no Driver'
)

hooks._register_hook(
'_setup_recording', 'Driver', post=_view_realtime_plot_hook, ncalls=1
)
hooks._setup_hooks(self.driver)

if suppress_solver_print:
self.set_solver_print(level=0)
Expand Down
4 changes: 2 additions & 2 deletions aviary/docs/examples_unreviewed/deconstructed_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@
"outputs": [],
"source": [
"# Testing Cell\n",
"from aviary.interface.download_models import get_model\n",
"from aviary.utils.functions import get_model\n",
"\n",
"get_model('advanced_single_aisle/advanced_single_aisle_data.py')"
]
Expand Down Expand Up @@ -937,7 +937,7 @@
"# Testing Cell\n",
"import os\n",
"\n",
"from aviary.interface.download_models import get_model\n",
"from aviary.utils.functions import get_model\n",
"\n",
"all_files = {\n",
" 'large_single_aisle_1': [''],\n",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading