-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor expDesign
#84
Refactor expDesign
#84
Conversation
for more information, see https://pre-commit.ci
Codecov Report
@@ Coverage Diff @@
## dev #84 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 12 14 +2
Lines 220 224 +4
=====================================
- Misses 220 224 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
for more information, see https://pre-commit.ci
…te a matrix of zeros (ergo no change of fixation to show)
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…arco_streamline-expdesign"
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
4d77732
to
ee0796e
Compare
added some tests. do you want to also refactor the MT MST one ? It should be fairly straight forward now, no? (famous last words) |
assertEqual(speeds, ones(20, 12) * 28); | ||
|
||
% try when the target are just for the fixation cross | ||
cfg.target.type = {'fixation_cross'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why fixation targets here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there are only fixation cross as targets then setSpeedTargets
must return only zeros.
So it is a second test.
Will break it down into 2 to avoid confusion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok here I have "updated" the test meaning that now, being WIP, the two tests are checking for the same results (a matrix full of ones).
Added a reminder in #89
Hey sorry for being late on the reply here.
I am tempted to do that in a new PR cause I suspect that a separate design for MT_MST might be useless now and with few 'if/switch' statements we can do the trick. Also, I see that in some functions the copyright tag has been moved below the I am a bit confused by the test for the |
Until recently miss_hit only allowed the top line, but that would mess up using the "help" command on Octave and very few matlab codebases put the copyright there. So this has changed and we can now use the more conventional "copyright at the end of the help section". No need to change all functions now, but if you run into a function where it is still in the top line, put it at the end of the help section. |
Agreed |
Ah OK I get it now: I was not sure what was expected so I sort of made a wild guess: then the code and test need to be updated. |
if ismember('speed', cfg.target.type) | ||
[~, nbEventsPerBlock, ~, nbBlocks] = getDesignInput(cfg); | ||
speeds = ones(nbBlocks, nbEventsPerBlock) * cfg.dot.speedPixPerFrame; | ||
|
||
% Outputs an "empty" matrix in case no speed task is required | ||
else | ||
[~, nbEventsPerBlock, ~, nbBlocks] = getDesignInput(cfg); | ||
speeds = ones(nbBlocks, nbEventsPerBlock) * cfg.dot.speedPixPerFrame; | ||
|
||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know what confused me on this function.
At the moment both sides of the if block do exactly the same thing, so I thought either the If block is not necessary or the else part must be doing something different from the rest.
Do you see what I mean ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are totally right, kind of impossible to guess. My bad.
Let's say that now the function has the structure for future developments. Let me add some "warnings" here and there to make sure it is clear
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a couple of words below the [WIP] will do. :-)
|
||
% Set to 1 for a visualtion of the trials design order | ||
if nargin < 2 || isempty(displayFigs) | ||
displayFigs = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, I think it is very important to keep mock input in order to run a trial of the design outside the experiment. Important to understand what it is doing and in case of further development to see if the tasks and trials are arranged as needed. See also #69
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries: I basically took all the mocked content and created the getTestConfig
function with it.
We can just rename it ("get mock input"or something ) and move it into the design folder and make a call to that function in the expDesign function.
Makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it makes sense, will also improve the doc related to this. Thanks
I moved the left "to do" to new issues and brought back the mock configuration inside Also added more info about the WIP situation of |
Merging this one |
This refers to the function in use for MT+ localizer (nb: MT/MST has its own design function for the moment)
TO DO:
Refactoring
Features improvements
make it flexible in case someone wants only one condition (eithermoved to Make design flexible in case someone wants only one condition (either static or motion or more than two conditions) #88static
ormotion
or more than two conditions)add a task for different speed targets (eithermoved to add a task for different speed targets (eitherfaster
orslower
), might be better to develop this in another or to easy the weight of this one. The ground is set though. Consider as the output of the function a matrix with 1 (is target) and 0 (no target) instead of the actual dot speedfaster
orslower
) #89improve and avoidmoved to improve and avoiderror('number of repetitions must be a multiple of max number of targets');
error('number of repetitions must be a multiple of max number of targets');
inexpDesign
#90cfg.target.type = {'fixation_cross', 'speed'};
)setFixationTargets
:no more than ``nbRepetitions - 1`` target in the same event order
. Maybe better a rule of eg no less than 1 per each event position in the block (increase an equal distribution of the targets in the all event's position in the blocks across the run)Annex
README