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
Fair point, although I think it would be good to handle this case if possible, since functions that quantities are being passed to may not be aware that the data being passed in is a quantity and so use rad2deg.
I'd like to work on this. It still happens on quantities 0.17.0: np.rad2deg(1*pq.rad) and np.deg2rad(180*pq.deg) raise ValueError: ufunc ... not supported by quantities, while np.degrees and np.radians already work and return deg and rad.
Since rad2deg and deg2rad are NumPy's aliases for degrees and radians, my plan is to register them with the same handling, with tests. Would that be OK?
Activity
twmr commentedon Aug 20, 2019
@CJ-Wright Why do you want to pass a quantity to
rad2deginstead of using.rescale?CJ-Wright commentedon Aug 20, 2019
Fair point, although I think it would be good to handle this case if possible, since functions that quantities are being passed to may not be aware that the data being passed in is a quantity and so use
rad2deg.OmkarGowda990 commentedon Nov 20, 2026
I'd like to work on this. It still happens on quantities 0.17.0:
np.rad2deg(1*pq.rad)andnp.deg2rad(180*pq.deg)raiseValueError: ufunc ... not supported by quantities, whilenp.degreesandnp.radiansalready work and returndegandrad.Since
rad2deganddeg2radare NumPy's aliases fordegreesandradians, my plan is to register them with the same handling, with tests. Would that be OK?