You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of #3077 (and, in particular, cfa6ff49f), invoking _GeneralVarData.set_value() on an variable object with units to a dimensionless numpy type (such as numpy.float64) may result in a UnitsError, but this appears to depend on on whether or not numpy types were added to native_numeric_types before or after set_value() was invoked.
shermanjasonaf
changed the title
Make physical units check trigger for Var.set_value more consistent
Make physical units check trigger for _GeneralVarData.set_value more consistent
Jan 23, 2024
Summary
As of #3077 (and, in particular,
cfa6ff49f
), invoking_GeneralVarData.set_value()
on an variable object with units to a dimensionless numpy type (such asnumpy.float64
) may result in aUnitsError
, but this appears to depend on on whether or not numpy types were added tonative_numeric_types
before or afterset_value()
was invoked.Steps to reproduce the issue
Before
cfa6ff49f
After
cfa6ff49f
Error Message
See previous section.
Information on your system
Pyomo version: 6.7.1dev0 (before and after
cfa6ff49f
)Python version: 3.9.17
Operating system: Ubuntu 20.04
How Pyomo was installed (PyPI, conda, source): source
Solver (if applicable):
Additional information
Other dependencies: numpy 1.23.1, Pint 0.19.2
The text was updated successfully, but these errors were encountered: