Skip to content

Commit

Permalink
the Problem 'p' was getting garbage collected too early because 'p' w…
Browse files Browse the repository at this point in the history
…as overwritten by return val of eval_ode_on_grid (#1047)
  • Loading branch information
naylor-b authored Feb 20, 2024
1 parent e9c1ddf commit 77fb991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dymos/grid_refinement/test/test_error_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def test_compute_state_quadratures(self):

phase = p.model.traj0.phases.phase0

x, u, p, f = eval_ode_on_grid(phase, phase.options['transcription'])
x, u, pp, f = eval_ode_on_grid(phase, phase.options['transcription'])

t_duration = phase.get_val('t_duration')

Expand All @@ -113,7 +113,7 @@ def test_compute_state_quadratures(self):
for name, options in phase.polynomial_control_options.items():
p_solution = phase.get_val(f'timeseries.polynomial_controls:{name}')
print(f'{name} interpolation error',
max(np.abs(p[name].ravel() - p_solution.ravel())))
max(np.abs(pp[name].ravel() - p_solution.ravel())))

for name, options in phase.state_options.items():
x_solution = phase.get_val(f'timeseries.states:{name}')
Expand Down

0 comments on commit 77fb991

Please sign in to comment.