SciDataTool icon indicating copy to clipboard operation
SciDataTool copied to clipboard

Bug: Units rpm and do not match

Open SebGue opened this issue 3 years ago • 1 comments

Hello @helene-t ,

I got some data object but I'm not able to use plot method due to an error. My object is as follows

from SciDataTool import Data1D, DataND
import numpy as np

spd = np.linspace(0, 1000, 20)
current = np.ones((20,1))

speed = Data1D(name="Speed", unit="rpm", values=spd, is_components=True)

axes = [speed]
kwargs = dict(name="Current RMS", unit="A", symbol="I")
data = DataND(axes=axes, values=current, **kwargs)

data.plot()

What am I doing wrong?

Best regards, Sebastian

SebGue avatar Apr 01 '22 13:04 SebGue

Hello @SebGue ,

Sorry for the late reply. Units are initialized from unit_dict, a dict defined in Functions/Plot/init.py The default unit for the speed axis is "rpm", but it uses the name "speed" instead of "Speed". We should improve the code in order to use the unit from the axis itself. In the meantime, you can simply rename your axis "speed".

Best regards, Hélène

helene-t avatar Apr 25 '22 09:04 helene-t