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
I often need to store arrays of variables that have different units, e.g. when solving a system of equations. I've noticed some inconsistent behavior with several operations. Note below that Qx is an instance of a quantity, not necessarily with the same units
f = np.empty(3, dtype=object)
x = np.array([1., 2])
f[[0,1]] = x * Q # f now contains the magnitude of x*Q, not the quantities as I would expect
y = np.array([Q1, Q2, Q3], dtype=object)
y *= Q4 # the magnitude changes correctly but the units do not. The units of the divisor are lost and the units of the original quantities are preserved
These issues can be mitigated using loops and indexing but it would be nice if these operations were supported.
The text was updated successfully, but these errors were encountered:
I often need to store arrays of variables that have different units, e.g. when solving a system of equations. I've noticed some inconsistent behavior with several operations. Note below that
Qx
is an instance of a quantity, not necessarily with the same unitsThese issues can be mitigated using loops and indexing but it would be nice if these operations were supported.
The text was updated successfully, but these errors were encountered: