Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Units rpm and do not match #97

Open
SebGue opened this issue Apr 1, 2022 · 1 comment
Open

Bug: Units rpm and do not match #97

SebGue opened this issue Apr 1, 2022 · 1 comment

Comments

@SebGue
Copy link
Contributor

SebGue commented Apr 1, 2022

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

@helene-t
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants