Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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] properly infer slice_time_ref from BIDS derivatives #3605
[FIX] properly infer slice_time_ref from BIDS derivatives #3605
Changes from 16 commits
97f0663
fe4cbe7
4e6a449
b0c5477
fbf556d
80ff3cc
4343da8
79d33c4
908a5cb
c775545
94b1a4e
0a06581
843e8ef
5a6a83b
15e43ad
3aecd4a
158ca00
0a81c72
06e3442
3534e12
0c42bd7
4910735
058361b
b1ad2f5
771e26a
292846d
52864d7
f2be27f
475a626
0b6fa7c
b02cacb
9dac2d7
cee0957
532b6be
80d8f94
54dcf91
03f25f9
eeea48e
9594588
ef839c1
a69c8fd
4a4ae5c
f9cfeba
8c2f51c
1130eb1
91eeacb
3785882
ea368fc
8155ec0
de4a2a9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 758 in nilearn/_utils/data_gen.py
Codecov / codecov/patch
nilearn/_utils/data_gen.py#L758
Check warning on line 935 in nilearn/glm/first_level/first_level.py
Codecov / codecov/patch
nilearn/glm/first_level/first_level.py#L935
Check warning on line 953 in nilearn/glm/first_level/first_level.py
Codecov / codecov/patch
nilearn/glm/first_level/first_level.py#L953
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.
We should not warn 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.
Gonna try to make a small table about the different situations (input argument VS what metadata exist in which dataset) to clarify when to throw warnings or errors.
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 refactoring isn't very useful if
slice_time_ref
default is not changed to None. If we do this, we need to deprecate it properly as @bthirion pointed out. In any case, given the explanation in the docstrings, this warning becomes redundant with the one under 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.
will remove the warning
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.
@ymzayek see my long comment below #3605 (comment)
But there the option of not changing the API and keeping the default to 0 and let users actively pass
slice_time_ref=None
if they want to let nilearn try to infer it from the dataset.In this case, then this refactoring could be useful if even if we did not change the API.
I am not saying I am in favor of not changing the API: just explaining why this bit of code could be useful even if we did not change 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.
@Remi-Gau Yes I agree that if we don't have to change the API, better not. But this implementation will only infer the slice_time_ref if the user passes None, while the old behavior tries to infer it if the default, which is
0.
, is kept. So a user that doesn't change their code that uses the default option will now get0.
set as their slice_time_ref while they expect it to be inferred. Does that make sense? Or maybe I have the logic wrong. If what I'm saying follows, then we'd need to go through a deprecation cycle as well.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 I am correct the old behavior was:
t_r
ANDslice_time_ref
if and only ift_r = None
is passed (which was the default)slice_time_ref
is found then it overrides ANY value passed as argument.Making more tables to compare old and new behavior depending on datasets and arguments...