[Task] Solve the issue with GSAS-tab reset
-
Identify the issue.
- Load in the attached file (NOM161049tof.gsa) by going to
Rietveld
tab and click onLoad
button. Then go toEdit
menu and click onReset GSAS-tab
item and ADDIE will crash, throwing out error message as below,
Traceback (most recent call last): File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 773, in do_reset_gsas_tab bragg_event_handler.BraggTree.do_reset_gsas_tab(self) File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/braggtree.py", line 336, in do_reset_gsas_tab main_window._myController.delete_workspace(workspace) File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/addiedriver.py", line 190, in delete_workspace raise RuntimeError('Workspace %s does not exist.' % workspace_name) RuntimeError: Workspace Bank 1 - 15.099999999999994 does not exist. Aborted (core dumped)
- Load in the attached file (NOM161049tof.gsa) by going to
-
The last file in traceback is where the program stops but that is probably not the fundamental reason for the crash since the algorithm
delete_workspace
is just for deleting workspace. It is that the workspace that it is trying to delete does not exist, that crashes the program. So, we need to go up a little bit to check,File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/braggtree.py", line 336, in do_reset_gsas_tab
-
Expanding the loaded in workspace we will find several children. When trying to resetting the GSAS-tab, we probably only need to delete the parent workspace and not to worry about deleting those children - from the error message, it seems we are trying to delete those children which are actually not workspace.
In ADDIE programming framework,
workspace
is a special object and we have a lot of algorithms/methods specially designed for dealing with workspaces. Therefore, if the object passed to those algorithms/methods is not a workspace, we will be in trouble.This indicates we probably want to delete line from
gsas_ws_name_list = bragg_list.get_child_nodes(
tomain_window._myController.delete_workspace(workspace)
in/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/braggtree.py
.