-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Description
ThermoAdd.compute() raises a TypeError at line 121 due to two breaking changes:
-
OpenMDAO 3.42.0 stores scalar inputs as
(1,)arrays instead of scalars -
NumPy 2.0 removed implicit
float()conversion on 1-element arrays
The crash: W_other_out[self.idx_compo] += W_other_mix on line 121 causes the following TypeErrors:
TypeError: 'DESIGN.burner.mix_fuel.thermo_add' <class ThermoAdd>: Error calling compute(), only 0-dimensional arrays can be converted to Python scalars
File "C:\Users\REDACTED_FILEPATH\pycycle\thermo\tabular\thermo_add.py", line 121, in compute
W_other_out[self.idx_compo] += float(W_other_mix)
^^^^^^^^^^^^^^^^^^
TypeError: only 0-dimensional arrays can be converted to Python scalars
Fix: change line 121 in thermo_add.py to W_other_out[self.idx_compo] += W_other_mix.item()
Versions: om-pycycle 4.4.0, openmdao 3.42.0, numpy 2.4.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels