Alex_Project issueshttps://code.ornl.gov/y8z/alex_project/-/issues2022-03-04T15:38:51Zhttps://code.ornl.gov/y8z/alex_project/-/issues/1[Enabler] Checklist for Alex project2022-03-04T15:38:51ZZhang, Yuanpengzhangy3@ornl.gov[Enabler] Checklist for Alex project- [ ] Badge.
- [x] Network access (UCAMS account).
- [x] Cyber security training (see email concerning `SuccessFactors Learning`).
___
Greenhalgh, Alexander Dyrk; ID: 03078525 - has a requirement to complete Cyber Security Awaren...- [ ] Badge.
- [x] Network access (UCAMS account).
- [x] Cyber security training (see email concerning `SuccessFactors Learning`).
___
Greenhalgh, Alexander Dyrk; ID: 03078525 - has a requirement to complete Cyber Security Awareness for Curriculum Cyber Security Awareness Training due on 7/1/2021 11:59 PM US/Eastern
SuccessFactors notifications are generated at 28 and 14 days prior to the due date. If the due date is 14 days from now, this is your final notice.
To access your required training, please open [your ORNL Learning Plan](https://learning.ornl.gov/) here.
___
- [x] Access to GitLab (using UCAMS account).
- [x] Meet to discuss project plan, communication and management of project, etc.
- [x] Orientation.
- [ ] Weekly seminar.
- [ ] **Time tracking -- 40 hours per week are required by the project.**
> **We agreed that you will be attending some courses during the internship. Unfortunately, you have to make up the time to guarantee that you do have 40 hours per week spent on the internship work. We can definitely have offline discussion about this.**
- [ ] Deliverables.
___
- [x] pre-survey (due -- **need to finish ASAP**).
- [x] 150-word abstract that summarizes their poster presentation (an "elevator speech").
- [x] poster presentation - the poster session will take place on **Thursday, August 12**.
- [x] 300-word abstract - a scientific abstract.
- [x] research report.
- [ ] peer review - student answer template questions of another student's poster.
- [ ] post-survey.
___
> Deliverable guidelines: [SULI_Deliverables_Guidelines.pdf](/uploads/f6649d8832f1eba20d73da91bcc36a5e/SULI_Deliverables_Guidelines.pdf)Alex_SULI_06-07-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.gov2021-07-31https://code.ornl.gov/y8z/alex_project/-/issues/2[Enabler] Plan of big scope2021-08-05T02:07:56ZZhang, Yuanpengzhangy3@ornl.gov[Enabler] Plan of big scope1. ADDIE GUI interface for `mantidtotalscattering`.
2. Python 2 to Python 3 translation for those autoNOM relevant scripts.
3. Implement `nomad_extract` in either `mantidtotalscattering` or `pystog`.
4. Save ADDIE configuration as a p...1. ADDIE GUI interface for `mantidtotalscattering`.
2. Python 2 to Python 3 translation for those autoNOM relevant scripts.
3. Implement `nomad_extract` in either `mantidtotalscattering` or `pystog`.
4. Save ADDIE configuration as a project.
5. ADDIE documentation update.
6. Abstract IDL data reduction routine to programming flowchart.
> Need to involve Joerg for understanding the IDL workflow and the abstraction.Alex_SULI_06-07-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.gov2021-07-31https://code.ornl.gov/y8z/alex_project/-/issues/3[Agenda] Kick-off meeting on SULI project2021-06-18T02:09:59ZZhang, Yuanpengzhangy3@ornl.gov[Agenda] Kick-off meeting on SULI project1. Welcome & Introduction.
2. Communication and management of project.
2.1. We will be using GitLab issues as our project management tool. We will create issue for each thing we want to accomplish. Issue of big scope will be called...1. Welcome & Introduction.
2. Communication and management of project.
2.1. We will be using GitLab issues as our project management tool. We will create issue for each thing we want to accomplish. Issue of big scope will be called `story`, which will turn into specific tasks that will be called `tasks` literally.
2.2. Each story or task will be assigned with some labels, e.g., those indicating priority.
2.3. We will have a weekly meeting (currently my plan is to put this meeting in Friday afternoon, but we can discuss), during which we will talk about the work during the week and decide what to do for next week. For the plan part, I will create stories/tasks for you with assigned priority beforehand so that we can decide which one to focus on next from the list according to their priorities.
2.4. Communication beyond the weekly meeting is always welcome and I will try my best to be responsive to email, phone, slack or Teams, etc.
3. Using git.
- Fork & clone repository.
- Local working branch.
- Push changes & submit pull request.
4. The first major thing to do - ADDIE interface for `mantidtotalscattering`.
- Demo for ADDIE & `mantidtotalscattering` on analysis cluster.
- Make sure the interaction with ONCAT is smooth and bug free.
- Make sure the interaction with the table view is smooth and bug free.
- When hitting the execution button, we need to prepare the input json file for the underlying `mantidtotalscattering` engine to run with.
5. Other todo's -- refer to #2.
6. AOB.Alex_SULI_06-07-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.gov2021-06-08https://code.ornl.gov/y8z/alex_project/-/issues/4[Story] Make sure the table view for Mantid interface in ADDIE is working rob...2021-07-02T20:15:23ZZhang, Yuanpengzhangy3@ornl.gov[Story] Make sure the table view for Mantid interface in ADDIE is working robustlyThe main interface for `mantidtotalscattering` in ADDIE looks like,
![Screenshot_2021-06-10_174048](/uploads/10d504deb3b5c08c8ddc07b4d5b771a2/Screenshot_2021-06-10_174048.png)
In the table view shown in the middle of the panel, we are ...The main interface for `mantidtotalscattering` in ADDIE looks like,
![Screenshot_2021-06-10_174048](/uploads/10d504deb3b5c08c8ddc07b4d5b771a2/Screenshot_2021-06-10_174048.png)
In the table view shown in the middle of the panel, we are going to input information for our data reduction. Each row in the table will correspond to a single instance of reduction execution. The entries in each row then contain all the information needed for the corresponding reduction.
Along with the table view itself, we have a whole bunch of buttons, input boxes and menus through which we can then operate on the table - simply put, we can do something on the table with those buttons, etc. For example, when we right click on the table view, it will pop up a menu - we want to make sure those options in the pop-up menu all work as expected. Same thing, we want to make sure all buttons to the bottom of the table view all function properly, except the `Launch Reduction` button which we will take care of separately.Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/5[Task] Install ADDIE to a local conda environment2021-06-18T02:09:49ZZhang, Yuanpengzhangy3@ornl.gov[Task] Install ADDIE to a local conda environment1. Install `conda` locally on analysis cluster.
> The installation instruction can be found here, [https://conda.io/projects/conda/en/latest/user-guide/install/linux.html](https://conda.io/projects/conda/en/latest/user-guide/install...1. Install `conda` locally on analysis cluster.
> The installation instruction can be found here, [https://conda.io/projects/conda/en/latest/user-guide/install/linux.html](https://conda.io/projects/conda/en/latest/user-guide/install/linux.html). We can choose to install either `anaconda` or `miniconda` - `miniconda` is recommended here since it is light weighted.
2. ADDIE github page is here, https://github.com/neutrons/addie, on which we can find detailed installation instructions. Follow the instruction to install ADDIE locally.
3. Once ADDIE is installed locally into a specific conda environment, we can then activate the corresponding conda environment and execute `which addie` to find out where `addie` is actually installed. In my case, my conda environment is `addie_env_3` and `which addie` gives me,
```
/SNS/users/y8z/miniconda/envs/addie_env_3/bin/addie
```
4. Locate ADDIE source codes.
> Starting from the result of `which addie` from previous step, we want to get rid of '/bin/addie' from the tail of the output and append `/lib/python3.6/site-packages/addie` to the end which will give us the full path to where ADDIE source codes are located. In my case, the full path will be,
```
/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie
```
5. Once we locate where ADDIE codes are stored in our local conda environment, we can then start to play with the source codes. Anytime we change the source code, we can then execute `addie` (suppose the corresponding conda environment is active - in my case, my conda environment name is `addie_env_3`, I need to execute `conda activate addie_env_3`) to start the program and inspect the effect of our change immediately.Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/6[Task] Test and make sure the interaction with ADDIE table view is smooth and...2021-06-23T03:43:13ZZhang, Yuanpengzhangy3@ornl.gov[Task] Test and make sure the interaction with ADDIE table view is smooth and bug free1. With the local version of `addie` installed, we need to activate the corresponding conda environment and launch `addie` from command line by executing `addie`.
2. The program will be defaulted to the `Mantid` interface, as shown belo...1. With the local version of `addie` installed, we need to activate the corresponding conda environment and launch `addie` from command line by executing `addie`.
2. The program will be defaulted to the `Mantid` interface, as shown below,
![Screenshot_2021-06-10_174048](/uploads/141a08ddd860f6d447b7fea1d58086d1/Screenshot_2021-06-10_174048.png)
3. Make sure all the interactive buttons, menus and input boxes are functioning properly.
- When right click on the table view, there is a menu popping up. We need to make sure all items listed in the menu are behaving as expected.
> We need a head-to-tail test for the table view. Starting from a blank table, we want to test the adding of entries either manually or from database. When table is filled with entries, we need to test all the interactive functionalities, such as copying and pasting rows/cells, etc.
- Make sure all buttons, input boxes, etc. are functioning properly in the window brought up by clicking `Reduction Configuration`.
> When writing this task, I already found a bug with the window brought up by `Reduction Configuration`. When we click on the refresh-like button along side `Q range` and `R range`, I expect those entries to the left of the refresh-like buttons to be reset to the default values. But currently when I click on those refresh-like buttons, nothing happens. We need to write down such bugs into GitLab issues. For record purpose, we can create a single issue in GitLab and put all bugs or features we think should be added in all together into it.
- Make sure buttons associated with `Calibration` work properly.
N.B. At this stage, we don't need to worry about the meaning of all the buttons, input boxes, etc. The only thing we want to make sure is all those interactive items are behaving as expected. For example, when pressing the `-` key while a certain row of table is selected, we expect the selected row to be deleted. Something like this. Therefore, rather than implementation, this is our testing and problem recording (if any) stage.Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/7[Story] Make ADDIE interface for mantidtotalscattering functioning2021-06-11T15:37:04ZZhang, Yuanpengzhangy3@ornl.gov[Story] Make ADDIE interface for mantidtotalscattering functioningMaking sure the table view and all the buttons, input boxes, etc. are working perfectly, the very next step is to worry about the `Launch Reduction` button, by clicking on which the program will do the real job - reducing the data. Two m...Making sure the table view and all the buttons, input boxes, etc. are working perfectly, the very next step is to worry about the `Launch Reduction` button, by clicking on which the program will do the real job - reducing the data. Two main steps we need to implement for this story, i.e. when clicking on the `Launch Reduction` button, we expect the program to do the following two things,
1. Collect all information in the table view (including those necessary information from the `Reduction Configuration` window) and prepare the input json file.
2. Call `mantidtotalscattering` to run with the prepared json file. The command is simply `mantidtotalscattering INPUT_FILE_NAME.json`.
> Refer to specific tasks for details.Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/8[Task] Collect info and prepare input json file2021-08-06T15:20:14ZZhang, Yuanpengzhangy3@ornl.gov[Task] Collect info and prepare input json file1. The following dataset can be used for testing our implementation,
> IPTS-24291, `CeO2_bulk_cryo_6x6_at_10K`.
- To prepare the table view for the dataset mentioned above, we can use the feature of importing from database, fol...1. The following dataset can be used for testing our implementation,
> IPTS-24291, `CeO2_bulk_cryo_6x6_at_10K`.
- To prepare the table view for the dataset mentioned above, we can use the feature of importing from database, following steps below,
Launch ADDIE 🠪 right click on table view 🠪 `Table` 🠪 `Import from Database` 🠪 `Replace ...`
- Then a login window will pop up where we can use our UCAMS account to log in. I am not sure whether @halgh007 has the access to the example data we are going to use here. If not, we can always sort out a way to do this. Need offline discussion.
- After logging in successfully, we can select IPTS-24291 either using the dropdown menu or the input box, followed by clicking on the `Import All Runs` button to import all runs.
- Then we need to remove all rows except `CeO2_bulk_cryo_6x6_at_10K`.
2. Fill in all necessary information if they are not already there, e.g. background runs. Also, correct improper inputs, e.g., chemical formula.
> We can refer to the json file attached below (that we are finally going to prepare) for reference about what proper input should be.
3. Clicking on the `Launch Reduction` button, we need to tell the program to prepare the input json file, as attached below,
[ceriaBulk_PAC06_at_10K_IDL_Calib_abs.json](/uploads/321fc16ca45e43972441025af2edbeb6/ceriaBulk_PAC06_at_10K_IDL_Calib_abs.json)
> For implementation, we need to first figure out where the `Launch Reduction` button is defined. Then to figure out the unique label for the button which will be used by the internal codes to recognize the button. Then to figure out what (i.e. a function, a method, or whatever) is linked to the `Launch Reduction` button, i.e., we want to know what the internal code is going to execute when the `Launch Reduction` button is clicked.
ATTENTION
=========
1. In terms of implementation, the json file preparation should be packaged up and implemented as a single function. For example, if the json file preparation function is called `json_input_prep`, when the `Launch Reduction` button is clicked, `json_input_prep` will be called.
2. The updated version of example json file (with all the redundant entries removed, see item-3 above) should be in a one-to-one mapping with the table view in ADDIE.
3. The `Output` and `Cache` directory specification can be found by going to `File` $`\rightarrow`$ `Settings` menu.Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/9[Task] Kick off reduction by calling mantidtotalscattering2021-06-23T14:15:37ZZhang, Yuanpengzhangy3@ornl.gov[Task] Kick off reduction by calling mantidtotalscatteringFollowing previous task #8, once the json file is ready, we need to go the next stage - call `mantidtotalscattering` to run with the prepared json file. Suppose the prepare json file is `reduction.json`, the command we are going to execu...Following previous task #8, once the json file is ready, we need to go the next stage - call `mantidtotalscattering` to run with the prepared json file. Suppose the prepare json file is `reduction.json`, the command we are going to execute is `mantidtotalscattering reduction.json`.
Refer to the following codes for the typical method to call another program within ADDIE.
[https://github.com/neutrons/addie/blob/50e28ba3f7b7e02774328087ebf9c595057c4b54/addie/processing/idl/run_sum_scans.py#L38-L45](https://github.com/neutrons/addie/blob/50e28ba3f7b7e02774328087ebf9c595057c4b54/addie/processing/idl/run_sum_scans.py#L38-L45)
> We may need some more live discussions when we come to this task since it may be a bit challenging for you @halgh007 to figure out the workflow.Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/10[Scope] Running list of issues in ADDIE interface2021-07-12T19:30:16ZGreenhalgh, Alexander[Scope] Running list of issues in ADDIE interfaceIssues
------
~~1. Under Edit tab, selecting "Reset GSAS-tab" causes ADDIE to crash
`File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/main.py", line 772, in do_reset_gsas_tab calculategr_event_handl...Issues
------
~~1. Under Edit tab, selecting "Reset GSAS-tab" causes ADDIE to crash
`File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/main.py", line 772, in do_reset_gsas_tab calculategr_event_handler.do_reset_gsas_tab(self)
AttributeError: module 'addie.calculate_gr.event_handler' has no attribute 'do_reset_gsas_tab'
Aborted (core dumped)`~~
~~2. Under `help` tab, selecting `Cheat Sheet` leads to `https://neutrons.github.io/addie/index.html`, site not found error~~
~~3. As previously mentioned `Reduction Configuration` Refresh button not working~~
4. May need to reduce default size of `Reduction Configuration` or add slider bar, the only way I could see past the `global align and focus` portion was by using `alt + F7` key command, could be unique to my monitor size though
~~5. When importing from oncat database, selecting `Change User` button and logging in again causes ADDIE to crash
`File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/master_table/import_from_database/oncat_authentication_handler.py", line 111, in ok_clicked
self.next_function()
TypeError: 'NoneType' object is not callable
Aborted (core dumped)`~~
~~6. Haven't been able to get the search box/button at top of interface to work, don't think it has any functionality~~
~~7. Haven't been able to get any result other than `Unable to calculate Molecular Mass. CHECK YOUR FORMULA!` from periodic table, even retrying formulas loaded in from database~~
~~8. If `Chemical formula` is filled out in table entry, selecting `Mass Density` and switching to `Number Density`, trying to replace `N/A` in field with number causes `ADDIE` to crash: `File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/utilities/math_tools.py", line 196, in number_density2mass_density
mass_density = number_density * molecular_mass / natoms / avogadro_term
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
Aborted (core dumped)` Another Error With same button: `File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/master_table/mass_density_handler.py", line 194, in number_density_value_changed
number_density = np.float(self.ui.number_density_line_edit.text())
ValueError: could not convert string to float:
Aborted (core dumped)`~~
9. Already knew issue existed but Error output when pressing `Launch Reduction` button is: `Traceback (most recent call last):
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/main.py", line 559, in run_mantid
mantid_reduction_launcher.run_mantid(self)
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/launch_reduction.py", line 87, in run_mantid
reduction_input = exporter.convert_from_row_to_reduction(json_input)
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/master_table/master_table_exporter.py", line 649, in convert_from_row_to_reduction
element_section)
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/master_table/master_table_exporter.py", line 505, in density_selection_for_reduction
dictionary['MassDensity'] = float(mass_density)
ValueError: could not convert string to float: 'N/A'
Aborted (core dumped)`
10. Need to put warning for when `launch reduction` is hit with nothing in table, crashes `Addie` with error ` File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/main.py", line 559, in run_mantid
mantid_reduction_launcher.run_mantid(self)
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/launch_reduction.py", line 67, in run_mantid
raise RuntimeError('Cannot export empty table')
RuntimeError: Cannot export empty table
Aborted (core dumped)` which is exactly how it should behave right now
~~11. Sometimes when loading in from database, a second `Options to load list of runs selected` window is created that cannot be deleted. Hard to pin down the exact cause yet, has happened twice loading in different files. Still can't reliably reproduce Example:
![image](/uploads/b441d07ff93154b3efd8a6fbd4031771/image.png)~~
~~12. When trying to import from database, during authentication stage, if we click on `Cancel` button the authentication window will be closed and we are then left with the 'Import from database' window. Then in this window, if we are trying to click on some option, it will crash.~~
~~13. Very similar to #8 in this list, selecting `Mass Density` and switching to the third option `Mass` will cause addie to crash with error `Traceback (most recent call last):
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/processing/mantid/master_table/mass_density_handler.py", line 221, in mass_value_changed
mass = np.float(self.ui.mass_line_edit.text())
ValueError: could not convert string to float: 'N/'
Aborted (core dumped)
` Sometimes allows you to edit before crashing, Only way to edit is to highlight all of N/A and replace at once, trying to delete N/A one character at a time will cause crash. If number is in space, clearing the last character is what cause will crash, understandable since data type can no longer be a float.~~
~~14. Go to `Rietveld` tab and load in the attached GSAS data file ([NOM161049tof.gsa](/uploads/8af7b9646043ed0175b761d2f204819b/NOM161049tof.gsa)), then go to `Edit` tab and click on `Reset GSAS-tab` will crash ADDIE, bringing up the following error message,~~
```
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)
```
~~15. After resetting GSAS tab, trying to change units will result in addie crash, some of the children still remain on graph, probably need to make addition changes to fix #14~~
```
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/3d0/miniconda3/envs/addie-env_test/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit
assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.'
AssertionError: At least 1 GSS file must be selected.
Aborted (core dumped)
```
~~Trying to check some of the bank boxes will also cause a crash, need to find what fully resets window~~
~~In addition, changing the units while in something is actually graphed will automatically graph all banks~~
~~16. Load in several GSAS data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)) in `Rietveld` tab and we will see those loaded in data under the `Bragg Workspaces` tree. Select all loaded-in data and right click on them to select `Delete workspace`. Following that, we then go ahead to change unit and ADDIE will crash, showing the following error,~~
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit
assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.'
AssertionError: At least 1 GSS file must be selected.
Aborted (core dumped)
```
~~17. In `Rietveld` tab, after loading in some data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)), if we select nothing in the `Bragg Workspaces` tree and click on the change unit dropdown menu, ADDIE will crash, throwing out the message,~~
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit
assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.'
AssertionError: At least 1 GSS file must be selected.
```
~~18. In `Rietveld` tab, after loading in some data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)), if we click on `workspaces` in the `Bragg Workspaces` tree and click on the change unit dropdown menu, ADDIE will crash, throwing out the message,~~
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 388, in switch_bragg_unit
ws_group)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/addiedriver.py", line 296, in get_bank_numbers
wksp = addie.utilities.workspaces.get_ws(ws_name)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/utilities/workspaces.py", line 33, in get_ws
name), 'Workspace "{}" does not exist.'.format(name)
AssertionError: Workspace "workspaces" does not exist.
Aborted (core dumped)
```
~~19. Import some example data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)) in `Rietveld` tab, we then right click on `workspaces` in `Bragg Workspaces` tree and all items there in the right click menu will crash ADDIE. This is because `workspaces` is just an indicator or place holder so any time when we right click on `workspaces` followed by clicking on any of the items in the right click menu, we just want to skip any operation (i.e. do nothing).~~
Priorities
----------
| **Group-#** | **Member** | **Priority** | **Subdivision** | **Comments**|
|-------------|----------------------|--------------|--------------------------------------------------|-------------|
| 1 | 1, 3, 4, 5, 6, 7, 8, 10, 12, 13, 14, 15 | Critical | 1 (#11), 14 (#14), 15 (#16), 5 (#12), 8 (#17), 13 (#17), 12 (#13), 16 (#18), 17 & 18 (#19), 19 (#20) $`\rightarrow`$ 7 (#21), 3 (#22), 6 (#23), 2 (#24) $`\rightarrow`$ 4 | These are all the issues we need to fix before implementing the `real` functionality, i.e., preparing input for `mantidtotalscattering` and kick off the reduction |
| 2 | 9, 10 | High | | Two things need to happen when clicking on `Launch Reduction`, 1) prepare the input json file and 2) call `mantidtotalscattering` to run with the prepared json file |
| 3 | 11 | Low | | This will not be covered during the internship |Alex_SULI_06-14-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/11[Task] Solve the issue with GSAS tab reset2021-06-24T01:36:23ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with GSAS tab reset1. Locate where the error occurs.
```
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 772
```
2. Identify what causes the issue from the error message.
```
Attribute...1. Locate where the error occurs.
```
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 772
```
2. Identify what causes the issue from the error message.
```
AttributeError: module 'addie.calculate_gr.event_handler' has no attribute 'do_reset_gsas_tab'
```
- Go to ADDIE source code folder of local conda environment and it seems we are going to worry about the file `calculate_gr/event_handler.py`.
- Open that file with preferred text editor and see whether we can find the definition of `do_reset_gsas_tab`.
- If it is not defined, definitely we will have issue during program running.
3. Solve the issue.
- Search for `do_reset_gsas_tab` in the whole ADDIE source codes.
- Point `Reset GSAS-tab` menu to where `do_reset_gsas_tab` is defined.
> `do_reset_gsas_tab` $`\rightarrow`$ `BraggTree` $`\rightarrow`$ `main_window.rietveld_ui.treeWidget_braggWSList`.
> A live working session may be needed to work through this issue.Alex_SULI_06-21-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/12[Task] Solve the issue with user changing functionality2021-06-24T01:36:29ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with user changing functionality> I went through this defect myself and have solved the issue. We should have a live working session so I can show you how I went through the pain to identify the issue and fix the bug. This can help you build up understanding the compli...> I went through this defect myself and have solved the issue. We should have a live working session so I can show you how I went through the pain to identify the issue and fix the bug. This can help you build up understanding the complicated connections among various parts of the codes.
- First, the error message points directly to the `on_clicked` function in `./processing/mantid/master_table/import_from_database/oncat_authentication_handler.py`.
- Put in some print-out message and compare the behavior when trying to get access to the login window from different approaches - right click and change user. It seems that both of them are pointing to the same location. So definitely it is not the issue of the hinted location - need to date back to execution history of each approach.
- For right click approach, search for `Replace ...` and finally we get to the function `_import_table_from_database` in `processing/mantid/master_table/table_tree_handler.py`.
- Look for where `launch_import_from_database_handler` is defined. Needs to know a bit about `self` and object oriented programming.
`self` -> `H3TableHandler` -> `./processing/mantid/event_handler.py` -> `h3_table_right_click` -> `main.py` -> `self` -> `launch_import_from_database_handler` -> `processing/mantid/event_handler.py` -> `ImportFromDatabaseHandler` -> `./processing/mantid/master_table/import_from_database/import_from_database_handler.py`
- Compare different between the calling of `OncatAuthenticationHandler` from two different approaches -> copy the properly working one to another.Alex_SULI_06-14-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/13[Task] Solve the issue with interacting with ONCAT database2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with interacting with ONCAT database> I checked through the issue and found this is probably too challenging for you to solve independently since you may not know what the best solution will be. I will put down what we need to check and change as below.
1. Trace back the ...> I checked through the issue and found this is probably too challenging for you to solve independently since you may not know what the best solution will be. I will put down what we need to check and change as below.
1. Trace back the issue.
- From the error message as presented below, we know it is something to do with `addie/databases/oncat/oncat.py` file (line-70),
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/processing/mantid/master_table/import_from_database/import_from_database_handler.py", line 397, in radio_button_changed
self.ipts_selection_changed()
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/processing/mantid/master_table/import_from_database/import_from_database_handler.py", line 449, in ipts_selection_changed
self.refresh_preview_table_of_runs()
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/processing/mantid/master_table/import_from_database/import_from_database_handler.py", line 271, in refresh_preview_table_of_runs
o_import.from_oncat_template()
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/processing/mantid/master_table/import_from_database/import_table_from_oncat_handler.py", line 54, in from_oncat_template
projection=projection,
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/databases/oncat/oncat.py", line 70, in pyoncatGetRunsFromIpts
run_list = oncat.Datafile.list(facility=facility,
AttributeError: 'NoneType' object has no attribute 'Datafile'
Aborted (core dumped)
```
- Search for `pyoncatGetRunsFromIpts` and we know it is defined in line-70 of `addie/databases/oncat/oncat.py` file. But we need to go deeper to see where this defined function is called. Further checking of the search result for `pyoncatGetRunsFromIpts`, we know it is called in `addie/processing/mantid/master_table/import_from_database/import_table_from_oncat_handler.py` (line-50, in the function definition for `from_oncat_template`). We then go deeper to search for `from_oncat_template` and will arrive at line-257 which is the function body that will call `from_oncat_template`.
> Now we need to think about what the fundamental reason is for the issue - from the error message printed out, it seems the `oncat` object is `None` which means it is not given a value anywhere. Here in the definition for `refresh_preview_table_of_runs`, we call `from_oncat_template` which will try to access the `oncat` object and return a json file. So here before we call `from_oncat_template` function, we need to check whether `oncat` is `None` or not. If indeed it is `None` (like in our case, we clicked on `Cancel` at the authentication stage so did not successfully fetch database data and therefore `oncat` will definitely be `None`), we then need to return without doing anything. So just add in the following lines to the very top of the function definition for `refresh_preview_table_of_runs` (line-257 in `addie/processing/mantid/master_table/import_from_database/import_from_database_handler.py`),
```python
if self.parent.oncat is None:
print("[Warning] ONCat connection not set up properly. Make sure you have logged in successfully.")
self.ui.run_radio_button.setChecked(True)
return
```
The first and third line under the `if` statement just tells the program that if `oncat` is `None`, we just print out a warning message and return. The second line is to make sure the `Run(s) #` radio button is checked since otherwise when we log in again, the whole program will freeze for some unknown reason (which I guess should be something to do with the GUI not being initialized properly after re-logging-in). By checking the `Run(s) #` button, we should be fine.Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/14[Task] Solve the issue with GSAS-tab reset2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with GSAS-tab reset1. Identify the issue.
- Load in the attached file ([NOM161049tof.gsa](/uploads/773ea9f96899b11e749a9d4630aad855/NOM161049tof.gsa)) by going to `Rietveld` tab and click on `Load` button. Then go to `Edit` menu and click on `Reset GS...1. Identify the issue.
- Load in the attached file ([NOM161049tof.gsa](/uploads/773ea9f96899b11e749a9d4630aad855/NOM161049tof.gsa)) by going to `Rietveld` tab and click on `Load` button. Then go to `Edit` menu and click on `Reset 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)
```
2. 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
```
3. 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(` to `main_window._myController.delete_workspace(workspace)` in `/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/braggtree.py`.Alex_SULI_06-14-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/15[Task] Submit changes to ADDIE repository through pull request2021-06-25T02:34:08ZZhang, Yuanpengzhangy3@ornl.gov[Task] Submit changes to ADDIE repository through pull request1. Once we finish the implementation for solving the following entries listed in #10, we will submit our changes at this stage to ADDIE repository through pull request. The issues needs to be solved at this stage,
1 (#11), 14 (#14),...1. Once we finish the implementation for solving the following entries listed in #10, we will submit our changes at this stage to ADDIE repository through pull request. The issues needs to be solved at this stage,
1 (#11), 14 (#14), 15 (#16), 5 (#12), 8 (#17), 13 (#17), 12 (#13), 16 (#18), 17 & 18 (#19), 19 (#20)
2. Fork ADDIE to our own GitHub repository and clone our own repository to local disk.
3. Put all changed files at this stage in their corresponding positions on our local disk.
4. Run `git diff` to see all the changes -> check through all the changes to make sure they all make sense.
5. Run `flake8` on changed files to make sure the format requirement is not broken.
6. Push all changes to your own remote GitHub repository (i.e. the forked one).
7. Submit pull request (to ADDIE `master` branch) from GitHub online repository interface.Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/16[Task] Solve the issue with Bragg panel after resetting2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with Bragg panel after resetting1. Pin down the cause for the issue.
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_ev...1. Pin down the cause for the issue.
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit
assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.'
AssertionError: At least 1 GSS file must be selected.
Aborted (core dumped)
```
- It seems the program is expecting the number of workspaces (those shown in the `Bragg Workspaces` panel) to be non-zero.
- However, after resetting the GSAS-tab, the number of workspaces already become zero and therefore in this case we need to disable all the plot control buttons/checkboxes (just like when we first launch the GUI, all those buttons/checkboxes are greyed out before loading in any data).
2. Solve the issue.
- Locate where the unit selection dropdown menu is defined.
> Searching for `dSpacing` in the codes -> from line-29 in `addie/initialization/widgets/rietveld_tab.py`, we know it is one of the options in `comboBox_xUnit`.
- Locate `comboBox_xUnit` in the codes.
> We know that definitely this `comboBox_xUnit` should have been disabled during the initialization stage, so we want to look into the codes to see how this was done.
> At line-199 in `addie/rietveld/event_handler.py`, we see `ui.comboBox_xUnit.setEnabled(enable_widgets)` which is definitely what we want.
- We need to call `check_rietveld_widgets` method after resetting the GSAS-tab.
> Go to `addie/rietveld/braggtree.py` and go to the end of `do_reset_gsas_tab` method. We need to put the following lines to the end of `do_reset_gsas_tab` method,
```
main_window._onCanvasGSSBankList = []
event_handler.check_rietveld_widgets(main_window)
```
> The first line added above is to reset the `_onCanvasGSSBankList` variable so that `check_rietveld_widgets` method knows that we have an empty workspace list.Alex_SULI_06-21-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/17[Task] Solve the issue with the transformation between mass and number density2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with the transformation between mass and number density1. Locate where the issue happens.
- At line-202 in `addie/processing/mantid/master_table/mass_density_handler.py`, there occurs error when calling `number_density_value_changed`,
```
File "/SNS/users/y8z/miniconda/envs/a...1. Locate where the issue happens.
- At line-202 in `addie/processing/mantid/master_table/mass_density_handler.py`, there occurs error when calling `number_density_value_changed`,
```
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/utilities/math_tools.py", line 200, in number_density2mass_density
mass_density = number_density * molecular_mass / natoms / avogadro_term
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
```
- We know from the error message that the error should be something to do with that some of the variables used in the math calculation is `None` (i.e. no value assigned). Anyhow, we need to trace further back, by searching for `number_density2mass_density`.
- All parameters passed to `number_density2mass_density` are given in the function `number_density_value_changed` defined in `addie/processing/mantid/master_table/mass_density_handler.py`. From there, we know, there may be something wrong with either `self.total_number_of_atoms` or `self.total_molecular_mass`.
- Further searching for, e.g, `self.total_molecular_mass` in `./processing/mantid/master_table/mass_density_handler.py`, we know that `self.total_molecular_mass` is assigned value at line-87 in `addie/processing/mantid/master_table/mass_density_handler.py` and the value comes from the function call to `retrieving_molecular_mass_and_number_of_atoms_worked`.
- Further searching for `retrieving_molecular_mass_and_number_of_atoms_worked` will lead us to `addie/processing/mantid/master_table/periodic_table/material_handler.py`.
- Checking the codes will lead us further to `get_periodictable_formatted_element_and_number_of_atoms` in `addie/processing/mantid/master_table/periodic_table/material_handler.py`.
- We realize that there are three return parameters from `get_periodictable_formatted_element_and_number_of_atoms`, but when we check the value assignment in `retrieving_molecular_mass_and_number_of_atoms_worked`, we found there are only two receivers.
2. Solve the issue.
- The solution should be straightforward to change the following line in `addie/processing/mantid/master_table/periodic_table/material_handler.py`,
```python
[formated_element, number_of_atoms] = get_periodictable_formatted_element_and_number_of_atoms(
_element)
```
to
```python
[formated_element, number_of_atoms, case] = get_periodictable_formatted_element_and_number_of_atoms(
_element)
```Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/18[Task] Solve the issue with clearing GSAS workspaces2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with clearing GSAS workspaces1. Identify the issue.
- When deleting all workspaces from the `Bragg Workspaces` tree and trying to change unit afterwards, ADDIE will crash, raising error like below,
```
Traceback (most recent call last):
File "/SN...1. Identify the issue.
- When deleting all workspaces from the `Bragg Workspaces` tree and trying to change unit afterwards, ADDIE will crash, raising error like below,
```
Traceback (most recent call last):
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/main.py", line 692, in evt_switch_bragg_unit
rietveld_event_handler.switch_bragg_unit(main_window=self)
File "/SNS/users/y8z/miniconda/envs/addie_env_3/lib/python3.6/site-packages/addie/rietveld/event_handler.py", line 377, in switch_bragg_unit
assert len(ws_group_list) > 0, 'At least 1 GSS file must be selected.'
AssertionError: At least 1 GSS file must be selected.
```
- From the error message, we see that the cause for the issue is that the unit changing operation is expecting at least one workspace to be selected. However, if we already delete all workspaces, such a condition will never be met and therefore we encounter with issue.
2. Solve the issue.
- We want to make sure that once we delete all workspaces from the tree, all the checkboxes/buttons will be greyed out and the canvas should be cleared.
- Search for `Delete workspace` -> `addie/rietveld/braggtree.py` -> `self.do_delete_gsas`
- `self.do_delete_gsas` defines what will happen when we click on the `Delete workspace` option from the right click menu. Therefore, in this part of codes, we want to add (to the end of the function) the checking for the number of still existing workspaces. If this number is one (since there will always be a workspace called `workspaces`), we then want to grey out all checkboxes/buttons and clear the canvas.
- The following codes can be introduced in the very end of the function `do_delete_gsas` in `addie/rietveld/braggtree.py`,
```python
if len(self._mainNodeDict) == 1:
event_handler.do_clear_bragg_canvas(self._main_window)
self._main_window._onCanvasGSSBankList = []
event_handler.check_rietveld_widgets(self._main_window)
```
> The `self._main_window` is defined at the very bottom of `addie/rietveld/braggtree.py`.
> The last two lines refer to the solution to issue #16.Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/19[Task] Solve the issue with unit changing in Rietveld tab2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with unit changing in Rietveld tab1. Load in some sample data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae...1. Load in some sample data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)) in `Rietveld` tab and select nothing in `Bragg Workspaces` tree and click on any of the item in the unit change dropdown menu will crash ADDIE.
- According to the error message, we need to go to the `switch_bragg_unit` function definition in `addie/rietveld/event_handler.py` and search for the line containing `At least 1 GSS file must be selected.`. We want to replace such an assertion operation with the following codes to throw out warning message instead of crashing ADDIE in such a situation,
```python
if len(ws_group_list) == 0:
print("[Warning] At least 1 GSS file must be selected.")
return
```
2. Load in some sample data (as attached here, [NOM161121tof.gsa](/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)) in `Rietveld` tab and select `workspaces` in `Bragg Workspaces` tree and click on any of the item in the unit change dropdown menu will crash ADDIE.
- According to the error message, we need to go to the `switch_bragg_unit` function definition in `addie/rietveld/event_handler.py` and search for the line containing `if 'workspaces' in ws_group_list`. We see that `workspaces` is intended to be removed from workspaces list but we have a typo here - `workspace` needs to be changed to `workspaces`.Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/20[Task] Solve the issue with right click menu on workspaces entry in Rietveld tab2021-06-24T01:37:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Solve the issue with right click menu on workspaces entry in Rietveld tab> Import some example data (as attached here, [NOM161121tof.gsa](/y8z/alex_suli/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/y8z/alex_suli/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NO...> Import some example data (as attached here, [NOM161121tof.gsa](/y8z/alex_suli/uploads/e73835b58e306f54a50506ec66fa302f/NOM161121tof.gsa), [NOM161122tof.gsa](/y8z/alex_suli/uploads/4a37555d9a929f19ddcabfdd3289aae6/NOM161122tof.gsa), [NOM161123tof.gsa](/y8z/alex_suli/uploads/ae73489f278b22a7c5e824e9a832b03c/NOM161123tof.gsa)) in `Rietveld` tab, we then right click on `workspaces` in `Bragg Workspaces` tree and all items there in the right click menu will crash ADDIE.
1. For `Delete workspace` option, we need to go to the definition of function `do_delete_gsas` in `addie/rietveld/braggtree.py`. In the `for` loop there, we are cycling through all workspaces and here, we want to simply skip `workspaces`. So the old codes are,
```python
for gsas_node in gsas_node_list:
# delete the gsas group workspace (deletes sub-workspaces as well)
gsas_name = str(gsas_node.text())
gss_ws_name = gsas_name.split('_group')[0]
self._main_window.get_workflow().delete_workspace(gss_ws_name)
```
and new codes will be,
```python
for gsas_node in gsas_node_list:
# delete the gsas group workspace (deletes sub-workspaces as well)
gsas_name = str(gsas_node.text())
gss_ws_name = gsas_name.split('_group')[0]
if gss_ws_name == "workspaces":
continue
self._main_window.get_workflow().delete_workspace(gss_ws_name)
```
2. For `Remove from plotting` option, we need to go to the definition of function `remove_gss_from_plot` in `addie/rietveld/braggtree.py` and change the following part of codes,
```python
if len(gss_wksps) == 0:
raise RuntimeError(
'GSAS-single-bank workspace name list is empty!')
```
to
```python
if len(gss_wksps) == 0:
print("[Warning] GSAS-single-bank workspace name list is empty!")
return
```
3. For `Merge to GSAS` option, we need to go to the definition of function `do_merge_to_gss` in `addie/rietveld/braggtree.py` and change the codes from,
```python
gss_node_list = ret_obj
if len(gss_node_list) == 0:
return
elif len(gss_node_list) > 1:
msg = '[Error] Only 1 GSS node can be selected.'
msg += 'Current selected nodes are {}.'
print(msg.format(gss_node_list))
return
```
to
```python
gss_node_list = ret_obj
if len(gss_node_list) == 0:
return
elif len(gss_node_list) > 1:
msg = '[Error] Only 1 GSS node can be selected.'
msg += 'Current selected nodes are {}.'
print(msg.format(gss_node_list))
return
if str(gss_node_list[0]) == "workspaces":
print("[Warning] No valid workspace selected!")
return
```
4. For `To IPython` option, we need to go to the definition of function `do_copy_to_ipython` in `addie/rietveld/braggtree.py` and change the codes from,
```python
ws_name = str(current_item.text())
python_cmd = "ws = mtd['%s']" % ws_name
```
to
```python
ws_name = str(current_item.text())
if ws_name == "workspaces":
print("[Warning] No valid workspace selected.")
return
python_cmd = "ws = mtd['%s']" % ws_name
```
5. For `Plot` option, we need to go to the definition of function `do_copy_to_ipython` in `addie/rietveld/braggtree.py` and change the codes from,
```python
# set to plot
for gss_group_node in selected_nodes:
# gss_group_name = str(gss_group_node.text())
# self._main_window.set_bragg_ws_to_plot(gss_group_name)
self._main_window.set_bragg_ws_to_plot(gss_group_node)
```
to
```python
# set to plot
for gss_group_node in selected_nodes:
gss_group_name = str(gss_group_node)
if gss_group_name == "workspaces":
continue
# self._main_window.set_bragg_ws_to_plot(gss_group_name)
self._main_window.set_bragg_ws_to_plot(gss_group_node)
```Alex_SULI_06-21-2021Greenhalgh, AlexanderGreenhalgh, Alexander