Open aowen87 opened 4 years ago
I am not sure if these are related but see #4570 regarding the helper/hinter strings that expression system inserts when you select an expression function to insert.
If a similar situation exists for the menus (e.g. edit expressions over there but stuff related to expression gui somewhere else), its easy to have developers add expressions (that still will work when they are manually typed in) that never make it into our menus.
If so, that I think points to an important refactor, just as it does for the issue I cite above.
To find undocumented expression functions, I did the following greps
find ../../avt/Expressions -exec grep 'functionName == "' {} \; -print | \
tr '[:upper:]' '[:lower:]' | tr ' ' '\n' | grep '"' | tr -d '")' | sort | uniq > ~/visit/expr_funcs.txt
which produces a list of functions in the actual code. I then cross checked this agains what is actually documented using...
% cat ../../doc/using_visit/Quantitative/Expressions.rst | tr '[:upper:]' '[:lower:]' | \
tr '`(),*<>/.:?;"{}@#$%+=--^&~' ' ' | tr ' ' '\n' > ~/visit/foo.txt
% cat ~/visit/expr_funcs2.txt | xargs -n 1 -I'{}' grep -i -x '{}' ~/visit/foo.txt \
| sort | uniq > ~/visit/documented_expr_funcs.txt
and then diffed the documented_expr_funcs.txt
with expr_funcs.txt
and wound up with the following list...
apply_ddf
array_decompose2d
atan2
color4
coords
deg2rad
det
distance_to_best_fit_line2
equals
gte
key_agg
lambda2
log10
log10withmin
logical_nodeid
logical_zoneid
lte
mirvf
neq
node_domain
notequal
notequals
q_crit
rad2deg
relative_volume
sq
strain_almansi
strain_green_lagrange
strain_infinitesimal
strain_rate
strain_volumetric
val4mat
volume2
zone_centers
zone_domain
zonetype_label
I noticed that the displacement expression appears to be missing from the "Insert function" menu in the Expressions window. You can still use this expression by typing in the function yourself, but then you have to know it exists somehow. I only know it exists because I saw it being used in one of VisIt's plugins. Looking over the docs, it seems like there might be some others missing as well.
There's also a lot of missing documentation for expression (I counted over 50 before giving up):
Is there any reason to not add all available (and unique) expressions to the menu? We should probably also update the documentation.