Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default text for raster step #357

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

vshekar
Copy link
Collaborator

@vshekar vshekar commented Jan 20, 2024

Added a default value for raster step since if you add any other collection at startup, LSDC will complain that not all parameters are filled even though the added collection has nothing to do with rasters

@vshekar vshekar requested a review from JunAishima January 20, 2024 19:48
@JunAishima
Copy link
Collaborator

It would be better to fix the validation/error issue - can you show the exception here?

gui/control_main.py Show resolved Hide resolved
@vshekar
Copy link
Collaborator Author

vshekar commented Jan 22, 2024

It would be better to fix the validation/error issue - can you show the exception here?

The exception happens here: https://github.com/NSLS-II/lsdc/blob/cfdd2a0fc61e54a593b398673dc5164f8fdffd21/gui/control_main.py#L4073

This is within the function that creates a request dictionary. The function assumes that all text boxes are filled otherwise will throw an exception.
One issue is that it is inside a generic try block so its difficult to say from the error message where the exception happened. I used a debugger to pin point it. The current work around to this issue that the scientists are using is when the GUI is started, don't add a collection to queue, but instead switch to raster parameters so that the text box gets populated

The self.beamWidth_ledit and self.beamHeight_ledit text boxes were most likely part of the GUI, but replaced with rasterStepEdit. Unfortunately the textboxes were not properly removed, hidden from the GUI, instead used as variables within the code. So when rasterStepEdit is changed it triggers rasterStepChanged. This function simply sets beamWidth_ledit and beamHeight_ledit which is then used to create the request in the snippet above.
https://github.com/NSLS-II/lsdc/blob/cfdd2a0fc61e54a593b398673dc5164f8fdffd21/gui/control_main.py#L2290

I think removing these text boxes will be a more involved PR as its being used in multiple places

@JunAishima
Copy link
Collaborator

It would be better to fix the validation/error issue - can you show the exception here?

The exception happens here:

https://github.com/NSLS-II/lsdc/blob/cfdd2a0fc61e54a593b398673dc5164f8fdffd21/gui/control_main.py#L4073

This is within the function that creates a request dictionary. The function assumes that all text boxes are filled otherwise will throw an exception. One issue is that it is inside a generic try block so its difficult to say from the error message where the exception happened. I used a debugger to pin point it. The current work around to this issue that the scientists are using is when the GUI is started, don't add a collection to queue, but instead switch to raster parameters so that the text box gets populated

The self.beamWidth_ledit and self.beamHeight_ledit text boxes were most likely part of the GUI, but replaced with rasterStepEdit. Unfortunately the textboxes were not properly removed, hidden from the GUI, instead used as variables within the code. So when rasterStepEdit is changed it triggers rasterStepChanged. This function simply sets beamWidth_ledit and beamHeight_ledit which is then used to create the request in the snippet above.

https://github.com/NSLS-II/lsdc/blob/cfdd2a0fc61e54a593b398673dc5164f8fdffd21/gui/control_main.py#L2290

I think removing these text boxes will be a more involved PR as its being used in multiple places

I have made a new issue where we will handle this - #358

We will handle this properly in the future, but you need this to go forward.
Good that you saw them working around this though - the more we can get rid of these kinds of hacks, the better it is for them, as well as for us (hopefully an indication of better code and input handling)

@JunAishima JunAishima self-requested a review January 22, 2024 15:44
@vshekar vshekar merged commit d75ebae into NSLS2:master Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants