Open Maximilian-Stefan-Ernst opened 2 years ago
Not that it helps but it should be missing
instead of NaN
.
Why? Lavaan uses NA
, and writing f1 → fixed(1.0, missing)*x1
seems not so pretty to me. So I decided in favor of NaN
. Also, NaN
and 1.0
have the same length in monospace fonts, resulting in a much more pleasant look:
graph = @StenoGraph begin
# measurement model
visual → fixed(1.0, NaN)*x1
textual → fixed(1.0, 1.0)*x4
end
graph = @StenoGraph begin
# measurement model
visual → fixed(1.0, missing)*x1
textual → fixed(1.0, 1.0)*x4
end
NaN
exists only to satisfy ISO norm for floating-point calc and has some really weird behaviours.
missing
is the idiomatic way and the Julia community is very proud of it (rightfully so, I'd say). One important point is that typeof(NaN)
is Float64
.
Therefore the equivalent of fixed(1.0, NaN)
for label is label(1.0, missing)
anyway. Base often uses _
for ignored arguments, so I could imagine:
const _ = missing
Unfortunately, we settled on _ for unquoting....
I could be a bit surprising and swap NaN
with missing
.
Not sure what is the best solution...
I would like to allow the Syntax
f1 → fixed(1.0, NaN)*x1
to fix the loading in the first group, but not the second. However, this fails unexpectedly:While
typeof(NaN)
isFloat64
, andtypeof(fixed(1.0, NaN))
results inFixed{Tuple{Float64, Float64}}
, using it inside the@StenoGraphs
macro results in the ModifierFixed{Tuple{Float64, Symbol}}((1.0, :NaN))
.MWE: