-
Notifications
You must be signed in to change notification settings - Fork 530
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
FIX: correct bug in _concatenate_info function #2857
base: master
Are you sure you want to change the base?
Conversation
Using concatenate_runs = True results in an error as regressor names are missing for session dummy variables, this one-line corrects it.
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.
This looks sensible. I think it could be written slightly more cleanly. And can you verify that this produces the results you expect?
And do you want to add yourself to the .zenodo.json
file?
nipype/algorithms/modelgen.py
Outdated
@@ -567,6 +567,8 @@ def _concatenate_info(self, infolist): | |||
infoout.regressors.insert( | |||
len(infoout.regressors), | |||
onelist.tolist()[0]) | |||
# insert session regressor name | |||
infoout.regressor_names.extend(['run' + str(i + 1)]) |
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.
infoout.regressor_names.extend(['run' + str(i + 1)]) | |
infoout.regressor_names.append('run%d' % (i + 1)) |
Yes, this produces the results I expect, I already use it in my local code. I will add myself to the zenodo file, thanks! |
Related to the fix in nipy#2857
Just noticed the failing tests. Looks like I'll try to have a deeper look tomorrow. |
Also, can you go ahead and merge/cherry-pick 4158583 into this PR instead of having a separate one? |
Ok, silly mistake, |
corrected and error in _concatenate_info - when regressor and regressor_names are not defined, the fix fails. Now the regressor_names are created if they were not defined by the user.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2857 +/- ##
==========================================
- Coverage 70.81% 70.81% -0.01%
==========================================
Files 1277 1277
Lines 59153 59155 +2
Branches 8590 8590
==========================================
Hits 41889 41889
- Misses 16119 16120 +1
- Partials 1145 1146 +1 ☔ View full report in Codecov by Sentry. |
No worries. When you get some time. |
Hi @hstojic. Just a bump to let you know we'll be aiming to have everything in for the 1.1.9 release by next Friday, Feb 22. Let us know if you need any help on this. |
This is related to issue #2844 that I raised, more details is provided there.
In summary, using
concatenate_runs = True
results in an error as regressor names are missing for session dummy variables, this one-line corrects it by adding a session regressor name to the regressor_names variable..If my interpretation is correct, its an easy fix with a single line I think:
infoout.regressor_names.extend(['run' + str(i + 1)])