-
Notifications
You must be signed in to change notification settings - Fork 22
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
Hardware specific variables #77
Hardware specific variables #77
Conversation
Many thanks for implementing this, I think this will be very useful but have one high level question about the implementation. Currently if I understand correctly the hardware level variables are still associated with individual tasks. It seems to me that it might be preferable if the hardware level variables are independent from individual tasks, as the type of things they are likely to be useful for, such as solenoid or other hardware calibration, will be used across many tasks on the same setup. One way this could be implemented would be to have hardware level variables defined in the hardware definition. Annother way would be to have the hardware level variables not associated with any task in the GUI, but if a corresponding variable is defined in any task used on the setup the variable will be set. This could be combined with a convention such that hardware variable names always start with hw, e.g. |
CleanShot.2023-04-07.at.15.19.43.mp4I changed it so that hardware level variables are independent from individual tasks. I didn't want to have them defined in hardware definitions because that would mean many individual and nearly identical hardware definition files would need to be created and tediously reloaded every time there was a change to a setup. I went with your suggestion of having a special
|
…to a string with two words separated by a space
do not add hidden variables ending in "___", hw_ variables, or custom_variables_dialog
I changed it so |
Thanks for the updates and apogies for the delay getting back to this.
I'm not sure I understand this concern as I don't see why having variables in the hardware definition would require duplicaton of hardware definitions beyond that needed to deal with different hardware setups?
I think this is a reasonable way to go but the one thing I am not crazy about is that because the user has to enter the variable name manually in the variables table, there is a risk of a typo in the variable table or task file causing the variable not to be set, which it would be easy to miss when the task is run on systems with large numbers of setups. I agree that giving a warning or error if a hardware variable defined in a task is not set would be desirable to avoid this. For the Experiment tab it might be best to do this in the Configure_experiment_tab when the experiment is run, rather than in the Run_experiment_tab, as this would avoid issues with the parallel_call and also quicker for the user.
This might be confusing for users as it is different behaviour from the standard variables table in the run experiment tab. I think my preference is to use the full name.
Agree this is sensible.
|
the input automatically adds "hw_" at the start, and is validated with a regular expression
…up that is attempting to run - experiment hw_variable validation now occurs in configure_experiment_tab.py to avoid parallel_call problems
…on key from "variables" to "hw_variables"
The user now selects the variable name from a dropdown instead of typing it manually. All task files are automatically scanned for hardware variables and put into a list that is used to populate the dropdown. If you want to add/edit hardware variables, you need to first add it to a task file.
A warning message box now pops up if a task has a hardware variable defined but the setup that is trying to run does not have a corresponding value for that hardware variable. To avoid parallel_call issues, this check/warning happens in the configure_experiment_tab as you suggested.
fixed
I agree this is preferable. You can now set variables for selected setups. I added a "Variables" button to the "Configure selected" section. These changes are fresh and have not undergone a lot of testing, so please let me know if you find any bugs. |
@ThomasAkam this is ready for review when you get a chance |
Thanks Andy, these changes sound great but currently do not seem to be working on my machine - I can't select any setups in the setups tab using either the 'select all' checkbox or the individual setup checkboxes. No error message is generated when I click the checkboxes. pyControl.v1.8.2023-05-03.10-23-36.mp4 |
should be fixed now @ThomasAkam |
…"variables" key exists in setups.json
Thanks @alustig3, functionallity appears to be working great appart from a couple of small bugs:
-Pressing the setups tab variables button after removing the name of a setup gave this error:
I guess these errors could be prevented by greying out the variables button unless all setups are named.
|
@ThomasAkam should all be fixed now. Thanks for testing! |
the variables button should be greyed out unless 1 or more of the selected setups has a name. Once the variables button is clicked, the dialog will only add to the editing table the subset of the selected setups that have names. |
Thanks @alustig3 . I think we should aim to do a release soon to get all this new functionallity out. I would like to include the new_data_file_format in the next version, and will try and get that branch ready to merge ASAP. Are there any other bits of new functionallity you want to include before a new release? |
sounds good @ThomasAkam. There isn't any functionality that I'd like to add before the next release. I would like to run the Black formatter (as discussed previously #67 (comment)) on all of the python files in the repository though. It will probably be easiest if I make a quick pull request with formatting changes after you have merged the new_data_file_format into the dev branch. I can also add some information about using Black to the contributing section of the pyControl docs. |
this addresses #20
CleanShot.2023-03-29.at.00.40.51.mp4