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
{{ message }}
Repository navigation
view: dimension names and units are guessed (a Torque shows in J) #2070
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Found in the review of #2057, which adds the experimental view. It does not block that PR; #2059 fixed the findings that did. Paths refer to #2059's head.
Problem
The view model guesses a dimension name and a coherent unit for a value (CoherentUnits in crates/graphcal-project/src/view_model/value.rs). It disagrees with graphcal eval and with the declared type.
dim Torque = Force * Length;
node t: Torque = 2.0 N * 1.5 m;
node r: Dimensionless / Time = 2.0 / 1.0 s;
Declaration
graphcal eval
graphcal view
t: Torque
3 m^2*kg/s^2
dimension Energy, value 3 J
r: Dimensionless / Time
2 s^-1
dimension Frequency, value 2 Hz
The numbers are right in the units shown. But showing a torque in joules goes against engineering practice, and the two commands disagree.
Proposed fix
Needs a decision on how the view shows units. The review recommends:
dimension carries the declaration's own spelling (Torque, Dimensionless / Time).
Without a display unit, a value is shown by the same rule as graphcal eval.
Activity
View model contract v1 (#2090 lane A) (#2106)