[Kst] [Bug 141597] Change data file tool does not perform some updates

Barth Netterfield netterfield at astro.utoronto.ca
Thu Feb 22 16:19:16 CET 2007

This problem also relates to changing the tagname of a vector.
Imagine that I had a bunch of plots based on field N15C7 (filtered, a psd, an 
equation...) and I decide to change root vector to look at field N15C6.  I 
decide to also change the tag name of the vector so that I'm not confused.
What should happen to all the dependent data objects?

On Wednesday 21 February 2007 6:06:51 pm Eli Fidler wrote:
> ------- Additional Comments From eli staikos net  2007-02-22 00:06 -------
> I've fixed some of the problem by properly updating in the Data Manager,
> but there remains a tricky issue with equations.
> If you have an equation using variables and you change the name of those
> variables, the equation clearly won't work. In the equation in the bug.kst
> file ([DS-manche3.see/P2]-[DS-manche3.see/R2]), both vectors have the
> filename in their tags. When we change the data file for P2, it's full tag
> changes to "DS-manche1.see/P2".
> We're not sure exactly how to deal with this, but we've had several ideas.
> 1. Don't change the vector tags when the datasource changes.
>      - This fixes equations but is nasty for pretty much everything else.
>        The view ... dialogs will all have misleading hierarchies and it'll
> be very hard to tell what's going on.

Doesn't deal with the above problem.  BAD.

> 2. When building equations, only insert the display tags for the vectors
> into the equation string. - This will break if those names become
> non-unique (i.e. insert DS-manche3.see/P2 so equation becomes "[P2]", then
> create
>        DS-manche1.see/P2). The equations will then be unresolvable.


> 3. When changing object names, check if they are used in equations and
> update the equations to use the new names. - This changes the current
> semantics of equations, where the text of the equation is independent of
> the current data objects in memory. - It is also potentially tricky and/or
> expensive to identify where objects are used (equations, events, etc.).

This, I think, is the behavior we are suppose to currently have with other 
data objects (eg, psds).  It is the most complicated solution, but from the 
user's point of view, the best.

An implementation suggestion: When an equation string is submitted to the 
KstEquation, the KstEquation does an internal replacement of vector names 
with its own internal code eg, [{V1}] or some such, and keeps a list of 
KstVectorPtrs which these refer to.  When filling the equation text edit in 
the dialog, it does a replacement with the vector's tag names.  Do the same 
thing for scalars.  IIRC, KstEquations already have the list of vectors which 
the equation depends on.

Scalars in labels have the same issue as equations: what to do?
I think we treat the labels the same way we treat equations.  List of used 
vectors and used scalars:  Tag Name replacement for dialogs and saving.

More related questions: 

1) do we change the tag-names of dependent data objects which are using 
automatically generated tag names?
-Nicholas has suggested that KstObjects be able to have a special dynamic 
automatically generated tag name.  If the user changes it, it ceases to be 
automatic (unless the user re-automatizes it).  I like this a lot!  

It seems to me that we are moving to a place where we *never* refer to a data 
object by its tag name internally; only in the UI, and only by its current 

So... what does this all do for the schedule of releasing 1.4?

More information about the Kst mailing list