From 2a717ece69a2cc4416d9e14696c6dacdc7ee2b2e Mon Sep 17 00:00:00 2001 From: Kenneth Moore Date: Mon, 7 Aug 2023 14:58:39 -0400 Subject: [PATCH] Fix for MPI so that all phases show up in the phase timeseries plot. (#959) * Fix for openmdao warning messages. * Fix for using phase timeseries report in mpi * PEP --- .../timeseries/bokeh_timeseries_report.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dymos/visualization/timeseries/bokeh_timeseries_report.py b/dymos/visualization/timeseries/bokeh_timeseries_report.py index 17e058568..2bdbdc91f 100644 --- a/dymos/visualization/timeseries/bokeh_timeseries_report.py +++ b/dymos/visualization/timeseries/bokeh_timeseries_report.py @@ -150,8 +150,7 @@ def _load_data_sources(prob, solution_record_file=None, simulation_record_file=N 'sim_data_by_phase': {}, 'timeseries_units': {}} - for phase in traj.system_iter(include_self=True, recurse=True, typ=dm.Phase): - phase_name = phase.pathname.split('.')[-1] + for phase_name, phase in traj._phases.items(): data_dict[traj_name]['param_data_by_phase'][phase_name] = {'param': [], 'val': [], 'units': []} phase_sol_data = data_dict[traj_name]['sol_data_by_phase'][phase_name] = {} @@ -191,8 +190,7 @@ def _load_data_sources(prob, solution_record_file=None, simulation_record_file=N # Now a second pass through the phases since we know the units in which to plot # each timeseries variable output. - for phase in traj.system_iter(include_self=True, recurse=True, typ=dm.Phase): - phase_name = phase.pathname.split('.')[-1] + for phase_name, phase in traj._phases.items(): phase_sol_data = data_dict[traj_name]['sol_data_by_phase'][phase_name] = {} phase_sim_data = data_dict[traj_name]['sim_data_by_phase'][phase_name] = {} @@ -262,8 +260,8 @@ def make_timeseries_report(prob, solution_record_file=None, simulation_record_fi param_tables = [] phase_names = [] - for phase in traj.system_iter(include_self=True, recurse=True, typ=dm.Phase): - phase_name = phase.pathname.split('.')[-1] + for phase_name, phase in traj._phases.items(): + phase_names.append(phase_name) # Make the parameter table