MDSplus / mdsplus

The MDSplus data management system
https://mdsplus.org/
Other
71 stars 43 forks source link

old-trees branch only -- long node names are truncated on a v8 tree created by auto-upgrade of v7 tree #2474

Closed mwinkel-cfs closed 2 years ago

mwinkel-cfs commented 2 years ago

My understanding (perhaps incorrect) is that editing a v7 tree should automatically upgrade it to a v8 tree. That is not occurring correctly, because the v8 tree is still truncating long node names to 12 characters.

This example uses a v7 tree from C-Mod, shot #1160727005.

Use TCL to open the v7 tree and create a new pulse (in this example shot #9999). Quit TCL. Restart TCL and edit the new pulse by adding a node with a long name. Write the tree and quit. Restart TCL and open the tree again -- the new node appears, but it is truncated to 12 characters.

TCL> edit cmod /shot=9999
TCL> dir

\CMOD::TOP

 :SEQUENCE_NUM :TIME_OF_SHOT :TSTART

  ADMIN  DNB  EDGE  ELECTRONS  ENGINEERING  FUELING  HYBRID  IMAGES
  LH  MHD  MIST  PARTICLES  RF  SPECTROSCOPY  TRANSPORT

Total of 18 nodes.
TCL> add node THIS_IS_A_VERY_LONG_NODE_NAME/usage=text
TCL> dir

\CMOD::TOP

 :SEQUENCE_NUM :THIS_IS_A_VERY_LONG_NODE_NAME :TIME_OF_SHOT :TSTART

  ADMIN  DNB  EDGE  ELECTRONS  ENGINEERING  FUELING  HYBRID  IMAGES
  LH  MHD  MIST  PARTICLES  RF  SPECTROSCOPY  TRANSPORT

Total of 19 nodes.
TCL> write
TCL> dir

\CMOD::TOP

 :SEQUENCE_NUM :THIS_IS_A_VERY_LONG_NODE_NAME :TIME_OF_SHOT :TSTART

  ADMIN         DNB           EDGE          ELECTRONS     ENGINEERING
  FUELING       HYBRID        IMAGES        LH            MHD
  MIST          PARTICLES     RF            SPECTROSCOPY  TRANSPORT

Total of 19 nodes.
TCL> quit
$ mdstcl
TCL> set tree cmod /shot=9999
TCL> dir

\CMOD::TOP

 :SEQUENCE_NUM :THIS_IS_A_VE :TIME_OF_SHOT :TSTART

  ADMIN  DNB  EDGE  ELECTRONS  ENGINEERING  FUELING  HYBRID  IMAGES
  LH  MHD  MIST  PARTICLES  RF  SPECTROSCOPY  TRANSPORT

Total of 19 nodes.
TCL>
mwinkel-cfs commented 2 years ago

My initial assumption was likely wrong. I thought that "create pulse" would automatically upgrade a v7 tree to a v8 tree. Apparently though, it instead is just creating another v7 tree. Whether that is the appropriate behavior or not is debatable. If it is decided that the default should be to create a v7 tree, then it would be useful to add an option that forces the tree to be upgraded to v8. For example, "create pulse nnnn /v8".

Regardless, there is still a bug here. Even if shot #9999 (in the above example) is v7, adding a node with a long name, and then writing, should have converted the saved tree to v8. (Perhaps there is an option on the write command to force upgrade to v8 that I am unaware of.)

As an aside, it would be useful to have a feature in MDSplus to list the tree version. So that users can easily tell if they are working with a v7 or v8 tree.

WhoBrokeTheBuild commented 2 years ago

Hey Mark, create pulse is little more than a file copy, so I don't think that will be the mechanism to upgrade a tree from v7 to v8. Also, we don't want this happening "automatically" without the user's consent.

That upgrade will likely be a specific editing operation on the model itself, with nothing to do with create pulse. Something along the lines of:

edit treename
upgrade
write
close

This has been discussed but we don't have anything written yet, for the most part we're trying to focus on making fresh v8 trees work, then we'll write an upgrade function and put it in TCL.

S

mwinkel-cfs commented 2 years ago

As Stephen noted above, this is not a bug. (I didn't remember that it been decided that it would be safer to require explicit upgrade to the 63-character file format, than to do the upgrade automatically.) So closing this issue as per Stephen.