-
Notifications
You must be signed in to change notification settings - Fork 16
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
Is it possible to change the array length of parameters in eui.ParamEditor? #311
Comments
Hi, for better or worse this is the expected behaviour. The issue is that we must enforce an equal number of trial conditions. Trial conditions are defined as parameters with more than 1 column (following MATLAB's column-major order), but the conditions are presented visually as rows in the ParamEditor table, which is kind of confusing, hence the Because the input fields store everything as text, we have to cast the user input back into the underlying format (e.g. For most of the experiments we do the parameters are not expected to change type or size. Although this is possible, particularly in Signals, it makes things more difficult because you have to write in cases to deal with dimension mismatches and such. It's very uncommon that a user wants to change the size of their parameters so the safest thing is to throw an error. We did partially implement a way around this, which was to allow parameters that are cell arrays to be 'free fields', i,e. they could be mixed type and could change type and shape. Again this is tricky because it's hard to interpret the intended input of the user, so with this feature the values all end up a char arrays (if you type '5' do you want it to cast to numeric or keep as a char?). I guess we could do two things to improve this:
The first one is obviously very easy to implement, the second one shouldn't take to long but I'd need to add tests for mc which will take a while. The third option would be a lot of work and, aside from avoiding the row/column size confusion, would not be used very often by users. What do you think about these solutions? |
Thanks for the detailed explanation. Option 1 seems best, if someone ever implements 3 then the exposed property could be removed. I might still be misunderstanding, but isn't there also an option here to parse anything that includes brackets as numeric (e.g. [1,2,3]') so that you can then interpret whether it's a row or column vector to tell what the user wants to happen? So [1,2,3] is interpreted as conditional and split into the trial conditions, while [1,2,3]' changes the array size of a global parameter? |
It could have been implemented that way. It has its advantages and disadvantages. For example fringe cases where the underlying type is not numerical there would be problems. The advantage of the current way is that the user doesn't have to worry about array syntax or shape. I'll come up with a solution for the next release. |
Describe the bug
It appears to not be possible to change the length of a parameter in the GUI.
To Reproduce
Define a parameter in a signals experiment either as a single value or an array:
Using the mc GUI or
eui.SignalsTest
try to change the length of either parameter.Setting
p.example1
to [1,2] will cause this error:Setting
p.example3
to [1,2] will cause the same error but with a different assignment size.This appears to be happening because of the
(:,row)
code at line 231, which forces the matrix to stay the same shape. Removing that extra code allows parameters to change length, but it's unclear if that might be breaking something else up/down stream from here.p.s. (:,row) is flipped, that's a column?
The text was updated successfully, but these errors were encountered: