Trouble with Reporting Results

40 Views Asked by At

With OpenMDAO 3.22 and running an optimization with parts of WISDEM involved, I get an error after the optimization completes, and is related to the reporting.

In particular, the call to _make_dvcons_table from opt_report.py crashes with the following error:

''' Traceback (most recent call last): File "<string>", line 1, in <module> File "D:\ProgramData\Anaconda3\envs\wisdem-env2\Lib\site-packages\openmdao\visualization\opt_report\opt_report.py", line 427, in _make_dvcons_table row['visual'] = _constraint_plot(meta=meta, val=vals_dict[name], kind=kind) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\ProgramData\Anaconda3\envs\wisdem-env2\Lib\site-packages\openmdao\visualization\opt_report\opt_report.py", line 708, in _constraint_plot var_bounds_plot(kind, ax, float(val), meta['lower'], meta['upper']) File "D:\ProgramData\Anaconda3\envs\wisdem-env2\Lib\site-packages\openmdao\visualization\opt_report\opt_report.py", line 906, in var_bounds_plot _draw_pointer_and_label(ax, pointer_plot_coord, pointer_color, value) File "D:\ProgramData\Anaconda3\envs\wisdem-env2\Lib\site-packages\openmdao\visualization\opt_report\opt_report.py", line 953, in _draw_pointer_and_label pts = np.array([ ^^^^^^^^^^ ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (3, 2) + inhomogeneous part. '''

Could you please help me figure out what may be causing this issue?

these are the values of the arguments to the call:

desvars_vals = {'control.rated_TSR': array([6.]), 'blade.opt_var.chord_opt': array([1.6085229])}

desvars_meta =

'control.rated_TSR'
special variables
function variables
'scaler':
None
'adder':
None
'name':
'control.rated_TSR'
'upper':
6.0
'lower':
2.0
'ref':
1.0
'ref0':
None
'units':
None
'cache_linear_solution':
False
'indices':
None
'flat_indices':
False
'parallel_deriv_color':
None
'source':
'wt_init.control.rated_TSR'
'orig':
('control.rated_TSR', None)
'distributed':
False
'total_adder':
None
'total_scaler':
None
'size':
1
'global_size':
1
len():
19



'blade.opt_var.chord_opt':
special variables
function variables
'scaler':
None
'adder':
None
'name':
'blade.opt_var.chord_opt'
'upper':
array([3.2])
'lower':
array([0.48])
'ref':
1.0
'ref0':
0.0
'units':
None
'cache_linear_solution':
False
'size':
1
'indices':
ArrayIndexer: [0]
'flat_indices':
False
'parallel_deriv_color':
None
'source':
'wt_init.blade.opt_var.chord_opt'
'orig':
('blade.opt_var.chord_opt', None)
'distributed':
False
'total_adder':
None
'total_scaler':
None
'global_size':
1
len():
19
len():
2```

And these are the values in `_draw_pointer_and_label` that cause the issue, but I am not sure how to relate these to my variables.

`[pointer_plot_coord - _pointer_half_width, -_pointer_height]`

[array([0.43163271]), -0.4]

`[pointer_plot_coord + _pointer_half_width, -_pointer_height]`

[array([0.51163271]), -0.4]

`[pointer_plot_coord, 0.0]`

[array([0.47163271]), 0.0]`

Thank you!
1

There are 1 best solutions below

0
Justin Gray On

This seems like something that should be reported as a bug: