Ticket #7764 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Saving group workspaces causes workspace names to be changed.

Reported by: Samuel Jackson Owned by: Samuel Jackson
Priority: major Milestone: Release 3.0
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Mathieu Doucet

Description

Saving a group workspace causes the names of the child workspaces to be wiped and replaced with Filename_1, Filename_2 etc.

To reproduce:

  • Make a group workspace through any means
  • Right click, save nexus
  • Load the workspace back in. Observe that the names have been changed.

Change History

comment:1 Changed 7 years ago by Samuel Jackson

  • Status changed from new to inprogress
  • Owner set to Samuel Jackson

comment:2 Changed 7 years ago by Samuel Jackson

  • Priority changed from critical to major
  • Milestone changed from Release 2.6.1 to Release 3.0

Downgrading the urgency of this as the functionality never existed in the first place, so nothing has been broken. However we could definitely do better here by retaining the individual workspace names when saving and loading a group.

Last edited 7 years ago by Samuel Jackson (previous) (diff)

comment:3 Changed 7 years ago by Samuel Jackson

Save and load now store an attribute for workspace name.

Names will attempt to match with a stem on load. If not the stored name will be used.

Backwards compatible with older nexus files.

Refs #7764

Changeset: 0322d7cd3b765a8685c51d9f337a7d521e1c8315

comment:4 Changed 7 years ago by Samuel Jackson

  • Status changed from inprogress to verify
  • Resolution set to fixed

NeXus files now have an additional attribute called workspace_name. This holds information about what the workspace was called when the workspace last existed.

The save and load algorithms will now use this property when loading group workspaces. When loading a group workspace saved as a single nexus file the algorithm will now:

  • Check if the names of the child workspaces share a common stem (e.g. <WorkspaceName>_n)
    • If so this should be renamed to <OutputWorkspaceName>_n
  • If there is not common stem, the name stored in the Nexus file will be used.
  • If there is no workspace_name attribute, child workspaces will be called the same as the group workspace but with the index appended.
    • This is how it works at the moment and allows for backwards compatibility.

To Test

  • Create a group workspace with the following form:

GroupWsName
  - GroupWsName_1
  - GroupWsName_2
  - GroupWsName_3
  • Try saving and loading this workspace. GroupWsName should be replaced with whatever you call the output workspace in the load algorithm.
  • Create a group workspace where the names of the children differ. e.g:
GroupWsName
 - AChild
 - AnotherChild
 - SomeOtherChild_1
  • Saving and loading this should set the group name to be what the load algorithms output name is, but leave the child workspaces untouched.
  • Finally try saving and loading a single workspace and check that this functionality has not changed.

comment:5 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying
  • Tester set to Mathieu Doucet

comment:6 Changed 7 years ago by Mathieu Doucet

This might be outside the scope of this ticket, but what about the following scenario? In this case we have workspaces names 'ws1' and 'ws2' in two groups. How do we reference them? What will AnalysisDataService.retrieve('ws1') return?

ws1 = CreateWorkspace(DataX=[1,2,3,4],DataY=[1,2,3],NSpec=1)
ws2 = CreateWorkspace(DataX=[1,2,3,4],DataY=[1,2,3],NSpec=1)

grp1 = GroupWorkspaces(InputWorkspaces="ws1,ws2")

SaveNexus(InputWorkspace='grp1', Filename="/tmp/test_group.nxs")
Load(Filename="/tmp/test_group.nxs", OutputWorkspace="grp2")

comment:7 Changed 7 years ago by Samuel Jackson

  • Status changed from verifying to reopened
  • Resolution fixed deleted

comment:8 Changed 7 years ago by Samuel Jackson

  • Status changed from reopened to inprogress

Loading will now no longer produce duplicate names.

Refs #7764

Changeset: 947d5a24c396de529b33670cf5ebba11767be113

comment:9 Changed 7 years ago by Samuel Jackson

After some discussion over what is best to do in the situation described by Mathieu, LoadNexusProcessed will now replace a group workspace if the name is exactly the same.

If you load the same saved group to a different name (such as in comment 6) the child workspaces will check if there is a duplicate and append an index if necessary. This ensures that workspace names should always be unique.

comment:10 Changed 7 years ago by Samuel Jackson

  • Status changed from inprogress to verify
  • Resolution set to fixed

comment:11 Changed 7 years ago by Mathieu Doucet

  • Status changed from verify to verifying

comment:12 Changed 7 years ago by Mathieu Doucet

  • Status changed from verifying to closed

comment:13 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8609

Note: See TracTickets for help on using tickets.