Closed rodolakis closed 4 months ago
X
? Often time from one scan to another the positioner will change (x,y,z,th etc). So maintaining X
is probably not a realistic assumption. If X has a match when going from oldPvList
to newPvList
, then why not. But would probably stick to the 1st positioner if it exists, or index
if it doesn't. Could use firstPos
attribute for that. updateCheckboxes
reverse the selection back to old PV selection. Need to test with the update_mda_mvc=False
flag.Lots of edge cases to address when playing with the no_positioner
test folder:
==== Selected file: ARPES_0009.mda
Before: self.selectionField()={'Y': [2, 8, 12, 18, 19, 20], 'X': 1}
oldPvList=['Index', '29idc:m3.VAL', 'S:SRcurrentAI.VAL', 'EPS:29:ID:SS1:POSITION', '29idmono:ENERGY_MON', 'ID29:EnergySet.VAL', 'ID29:Energy.VAL', '29idb:ca1:read', '29idb:ca2:read', '29idb:ca3:read', '29idb:ca4:read', '29idb:ca5:read', '29idb:ca10:read', '29idb:ca12:read', '29idb:ca13:read', '29idc:ca2:read', '29idb:ca15:read', '29idc:ca1:read', '29idcEAV:Stats1:Total_RBV', '29idARPES:LS335:TC1:IN1', '29idARPES:LS335:TC1:IN2']
new_selection={'Y': [1, 7, 18, 19], 'X': 1}
After: self.selectionField()={'Y': [1, 7, 18, 19], 'X': 1}
newPvList=['Index', 'S:SRcurrentAI.VAL', 'EPS:29:ID:SS1:POSITION', '29idmono:ENERGY_MON', 'ID29:EnergySet.VAL', 'ID29:Energy.VAL', '29idb:ca1:read', '29idb:ca2:read', '29idb:ca3:read', '29idb:ca4:read', '29idb:ca5:read', '29idb:ca9:read', '29idb:ca12:read', '29idb:ca13:read', '29idc:ca2:read', '29idb:ca15:read', '29idc:ca1:read', '29idcScienta:Stats4:Total_RBV', '29idARPES:LS335:TC1:IN1', '29idARPES:LS335:TC1:IN2', '29idcScienta:HDF1:FileName']
doPlot called: args=('replace', {'Y': [1, 7, 18, 19], 'X': 1})
Application quitting ...
(mdaviz) [nefarian ~/src/mdaviz] mdaviz
Settings are saved in: /home/beams/RODOLAKIS/.config/BCDA-APS/mdaviz.ini
Application started ...
==== Selected file: ARPES_0001.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
After: self.selectionField()={'X': 1, 'Y': [2]}
doPlot called: args=('replace', {'X': 1, 'Y': [2]})
==== Selected file: ARPES_0009.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
new_selection={'Y': [1], 'X': 1}
After: self.selectionField()={'Y': [1], 'X': 1}
doPlot called: args=('replace', {'Y': [1], 'X': 1})
Traceback (most recent call last):
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 173, in setData
self.setCheckbox(index, value)
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 204, in setCheckbox
self.checkboxStateChanged.emit(self.plotFields()[0])
^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 374, in plotFields
column_number = self.columnNumber(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 298, in columnNumber
return self.columns().index(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: None is not in list
Aborted (core dumped)
(mdaviz) [nefarian ~/src/mdaviz] mdaviz
Settings are saved in: /home/beams/RODOLAKIS/.config/BCDA-APS/mdaviz.ini
Application started ...
==== Selected file: ARPES_0001.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
After: self.selectionField()={'X': 1, 'Y': [2]}
doPlot called: args=('replace', {'X': 1, 'Y': [2]})
==== Selected file: ARPES_0006.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
new_selection={'Y': [1], 'X': 1}
After: self.selectionField()={'Y': [1], 'X': 1}
doPlot called: args=('replace', {'Y': [1], 'X': 1})
Traceback (most recent call last):
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 173, in setData
self.setCheckbox(index, value)
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 204, in setCheckbox
self.checkboxStateChanged.emit(self.plotFields()[0])
^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 374, in plotFields
column_number = self.columnNumber(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 298, in columnNumber
return self.columns().index(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: None is not in list
Aborted (core dumped)
(mdaviz) [nefarian ~/src/mdaviz] mdaviz
Settings are saved in: /home/beams/RODOLAKIS/.config/BCDA-APS/mdaviz.ini
Application started ...
==== Selected file: ARPES_0001.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
After: self.selectionField()={'X': 1, 'Y': [2]}
doPlot called: args=('replace', {'X': 1, 'Y': [2]})
==== Selected file: ARPES_0005.mda
Before: self.selectionField()={'X': 1, 'Y': [2]}
new_selection={'Y': [1], 'X': 1}
After: self.selectionField()={'Y': [1], 'X': 1}
doPlot called: args=('replace', {'Y': [1], 'X': 1})
==== Selected file: ARPES_0008.mda
Before: self.selectionField()={'X': 1}
Traceback (most recent call last):
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mda_folder.py", line 327, in doFileSelected
self.updateSelectionForNewPVs(oldPvList, newPvList)
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/mda_folder.py", line 166, in updateSelectionForNewPVs
posY = self.selectionField()['Y']
~~~~~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'Y'
Aborted (core dumped)
(mdaviz) [nefarian ~/src/mdaviz]
Those notes are just for me to pick it up where I left it tomorrow morning. Should not be too hard to address.
Another one before heading home:
==== Selected file: ARPES_0005.mda
Before: self.selectionField()={'Y': [2], 'X': 1}
new_selection={'Y': [1], 'X': 0}
After: self.selectionField()={'Y': [1], 'X': 0}
doPlot called: args=('replace', {'Y': [1], 'X': 0})
==== Selected file: mda_0002.mda
Before: self.selectionField()={'Y': [1], 'X': 0}
new_selection={'Y': [2], 'X': 1}
After: self.selectionField()={'Y': [2], 'X': 1}
doPlot called: args=('replace', {'Y': [2], 'X': 1})
onCheckboxStateChange called: Auto-replace mda_0002 with {'Y': [1, 8], 'X': 0}
Traceback (most recent call last):
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 173, in setData
self.setCheckbox(index, value)
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 204, in setCheckbox
self.checkboxStateChanged.emit(self.plotFields()[0])
^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 374, in plotFields
column_number = self.columnNumber(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/beams3/RODOLAKIS/src/mdaviz/mdaviz/select_fields_table_model.py", line 298, in columnNumber
return self.columns().index(column_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: None is not in list
Aborted (core dumped)
Since PR #91, when closing #41, we did not address the case where one or more of the detectors selected do not exist in the next file. Cannot just rely on the table view row, need to check PV name,