Alex_Project issueshttps://code.ornl.gov/y8z/alex_project/-/issues2021-07-14T20:07:11Zhttps://code.ornl.gov/y8z/alex_project/-/issues/32[Task] New column needed for self-scattering level checking2021-07-14T20:07:11ZZhang, Yuanpengzhangy3@ornl.gov[Task] New column needed for self-scattering level checkingWe need another column in the table view of ADDIE interface for Mantid. Detailed description can be found in the following link, [https://balsamiq.cloud/sd2jtfw/ptaj9k7](https://balsamiq.cloud/sd2jtfw/ptaj9k7) -- see the second wireframe...We need another column in the table view of ADDIE interface for Mantid. Detailed description can be found in the following link, [https://balsamiq.cloud/sd2jtfw/ptaj9k7](https://balsamiq.cloud/sd2jtfw/ptaj9k7) -- see the second wireframe there.
@halgh007 **We probably want to wait until we finish implementing this issue and the one to be created for adding in the scroll bar.**Alex_SULI_07-12-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/28[Task] Further implementation in table view2021-07-14T20:07:05ZZhang, Yuanpengzhangy3@ornl.gov[Task] Further implementation in table viewWe need further implementation in the main table view to catch up with the new implementation we have for the underlying reduction routine.
Refer to the following link for detailed information about what the intended changes to the tabl...We need further implementation in the main table view to catch up with the new implementation we have for the underlying reduction routine.
Refer to the following link for detailed information about what the intended changes to the table view are, [https://balsamiq.cloud/sd2jtfw/ptaj9k7](https://balsamiq.cloud/sd2jtfw/ptaj9k7) - see the first wireframe (i.e. slide).
> A short meeting may be necessary to go through what we need to do.Alex_SULI_07-05-2021Zhang, Yuanpengzhangy3@ornl.govGreenhalgh, AlexanderZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/24[Task] Point users to a temporary guidance website when clicking on the cheat...2021-06-28T04:11:39ZZhang, Yuanpengzhangy3@ornl.gov[Task] Point users to a temporary guidance website when clicking on the cheat sheet menu> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implemen...> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implementation is the final version that is merged into neutron/addie master branch. When submitting our first PR, there may be some changes needed to address comments from reviewers and we want to make sure the starting point of the second stage implementation does contain all those changes.**
1. Launch ADDIE and click on `Help` $`\rightarrow`$ `Cheat sheet`, currently cheat sheet website is not yet ready.
2. We want to point users temporarily to NOMAD user guidance website [https://neutrons.ornl.gov/nomad/users](https://neutrons.ornl.gov/nomad/users).Alex_SULI_06-28-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/23[Task] Implementation to make the search box in main interface functioning2021-06-29T16:47:51ZZhang, Yuanpengzhangy3@ornl.gov[Task] Implementation to make the search box in main interface functioning> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implemen...> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implementation is the final version that is merged into neutron/addie master branch. When submitting our first PR, there may be some changes needed to address comments from reviewers and we want to make sure the starting point of the second stage implementation does contain all those changes.**
1. Launch ADDIE and populate the table with some entries.
2. Input something in the search box and nothing happens.
3. What we are expecting is, when users input something in the search box, the program will refreshing the table to display only those entries whose `Title` contains the text in the search box.
> For this implementation, we can refer to the implementation for the search box in the database import window (when right click on table to select `Table` -> `Import from Database` -> `Replace ...`).Alex_SULI_06-28-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/22[Task] Implementation to make refresh button functioning in reduction configu...2021-06-30T15:16:59ZZhang, Yuanpengzhangy3@ornl.gov[Task] Implementation to make refresh button functioning in reduction configuration window> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implemen...> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implementation is the final version that is merged into neutron/addie master branch. When submitting our first PR, there may be some changes needed to address comments from reviewers and we want to make sure the starting point of the second stage implementation does contain all those changes.**
1. Launch ADDIE and bring up the following `Reduction Configuration` window,
![image](/uploads/64fe6bd1dc97e5f4217b3c74969fe807/image.png)
2. Currently, clicking on the refresh button alongside either `Q range` or `R range` will not do anything.
3. We need to make those two refresh buttons functioning in such a way that whenever they are clicked, values in the corresponding input boxes will be set to default.
- For `Q range` one, the default values are 0, 40 and 0.02, respectively, from left to right.
- For `R range` one, the default values are 0, 40 and 0.02, respectively, from left to right.
- **When writing this issue, I realized that some of the default values in those input boxes when we first launch the `Reduction Configuration` are improper. The values I put above are what we want to use as default.**Alex_SULI_06-28-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/21[Task] Fix the issue with chemical formula input2021-06-30T18:53:22ZZhang, Yuanpengzhangy3@ornl.gov[Task] Fix the issue with chemical formula input> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implemen...> **This task is for the second stage of implementation after we submit the first PR as specified in issue #15. Before starting putting in new implementations, we need to make sure that our starting point for the second stage of implementation is the final version that is merged into neutron/addie master branch. When submitting our first PR, there may be some changes needed to address comments from reviewers and we want to make sure the starting point of the second stage implementation does contain all those changes.**
- [x] Reproduce the issue.
- Clicking on the `...` button inside `Chemical Formula` box to bring up the chemical formula input window.
- Manual input whatever chemical formula will give error at the bottom bar of the window and the program refuses to continue to save the formula.
- However, clicking on those elements shown in periodic table to input chemical formula will not bring up any error.
- [x] Locate the issue in code.
> There may be some flag in the code whereby it will be automatically set to `True` when inputting by clicking on the periodic table. Such a flag should also be set to `True` if user does manually input suitable chemical formula. Here regular expression may be needed to check the suitability of the manually input chemical formula. Such an implementation should already exist in the code and the error should be just something to do with this part of codes.
- [x] Solve the issue.
- [x] Meeting for discussion if needed.
- [x] Issue solved and mark the task as `Complete`.Alex_SULI_06-28-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, 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/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/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/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/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/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/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/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/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/35[Task] Fix the issues with json file preparation and a few other issues2021-08-06T15:15:53ZZhang, Yuanpengzhangy3@ornl.gov[Task] Fix the issues with json file preparation and a few other issues1. Buttons in the `Reduction Configuration` window is not working, like the two `browse` buttons under `Grouping`. Also, the refresh buttons in the Q-range and r-range section is not working. I checked the previous version and they seem ...1. Buttons in the `Reduction Configuration` window is not working, like the two `browse` buttons under `Grouping`. Also, the refresh buttons in the Q-range and r-range section is not working. I checked the previous version and they seem to be working fine so I suspect it should be something to do with the adding in of the scroll bar.
2. In the `Merging` entry of the json file, there should be a `QBinning` entry whose value should be in the format of a list, e.g., [0.0, 0.005, 40.0]. The value should come from the Q-range section in the `Reduction configuration` window. The value are Qmin, Qbinning and Qmax, respectively.
3. Again for the `Merging` entry, there is a `Grouping` sub-entry where we have `Initial` and `Output` sub-sub-entries. For the `Initial` one, we need to go back to the `Reduction Configuration` window - if `From calibration file` is selected for `Intermediate`, then the value for `Initial` should be the full name of the calibration file (see bullet point 4 below). If `Browse` is selected and file is specified through browsing, then the `Initial` value should be the browsed file name. The same logic applies for the `Output` sub-sub-entry.
> Here is an example group file that can be imported by browsing, for both initial (i.e. `Intermediate`) and output grouping, [outputgrouping.xml](/uploads/820a91c472119ed9a04900c7df741010/outputgrouping.xml)
4. Concerning the calibration file, it can be imported from the `Calibration` browse button under the main table view. Here attached is an example calibration file that can be imported, [NOM_144974_2020_06_04_shifter_cycle.h5](/uploads/15bd59c280e4994f6662002d389477fd/NOM_144974_2020_06_04_shifter_cycle.h5).Alex_SULI_07-26-2021Zhang, Yuanpengzhangy3@ornl.govZhang, Yuanpengzhangy3@ornl.govhttps://code.ornl.gov/y8z/alex_project/-/issues/34[Task] Fix the issue with importing table from json file2021-07-16T03:47:08ZZhang, Yuanpengzhangy3@ornl.gov[Task] Fix the issue with importing table from json fileDetails about the issue can be found here, [https://code.ornl.gov/y8z/alex_suli/-/issues/8#note_594412](https://code.ornl.gov/y8z/alex_suli/-/issues/8#note_594412).
- [x] Reproduce the issue.
- [x] Locate the issue in code.
- [x] Solv...Details about the issue can be found here, [https://code.ornl.gov/y8z/alex_suli/-/issues/8#note_594412](https://code.ornl.gov/y8z/alex_suli/-/issues/8#note_594412).
- [x] Reproduce the issue.
- [x] Locate the issue in code.
- [x] Solve the issue.
- [x] Issue solved and mark the task as `Complete`.Alex_SULI_07-12-2021Greenhalgh, AlexanderGreenhalgh, Alexanderhttps://code.ornl.gov/y8z/alex_project/-/issues/31Reduction configuration scroll bar2021-07-13T19:59:52ZGreenhalgh, AlexanderReduction configuration scroll barReduction configuration tab is too long, need to put in scroll barReduction configuration tab is too long, need to put in scroll barGreenhalgh, AlexanderGreenhalgh, Alexander2021-07-13https://code.ornl.gov/y8z/alex_project/-/issues/25[Task] Submit PR for the second stage of implementation2021-07-02T20:08:47ZZhang, Yuanpengzhangy3@ornl.gov[Task] Submit PR for the second stage of implementation> **This is our second PR. One thing to always keep in mind is, the starting point of the second PR should be exactly the final version that is merged into neutron/addie master branch in our first PR. When submitting our first PR, there ...> **This is our second PR. One thing to always keep in mind is, the starting point of the second PR should be exactly the final version that is merged into neutron/addie master branch in our first PR. When submitting our first PR, there may be some changes needed to address comments from reviewers and we want to make sure the starting point of the second stage implementation does contain all those changes.**
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,
7 (#21), 3 (#22), 6 (#23) and 2 (#24)
2. Check out a new branch in your own git repository and put all the changes implemented in the second stage in place.
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 local branch to your own remote git repository.
7. Submit pull request (to ADDIE `master` branch) from GitHub online repository interface.Alex_SULI_07-05-2021Greenhalgh, AlexanderGreenhalgh, Alexander