-
Notifications
You must be signed in to change notification settings - Fork 13
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
[ENH]: Improve BasePreprocessor
#310
Conversation
adc0811
to
fee73cf
Compare
|
I think I have an issue with this PR.
|
Since the
The reason is because |
We could have the |
Check this out: This is how we "add" the junifer/junifer/preprocess/confounds/fmriprep_confound_remover.py Lines 575 to 580 in a7bd0f6
But this is how we treat the input in the junifer/junifer/preprocess/base.py Lines 173 to 192 in a7bd0f6
So basically we have This is madness. My madness, but madness still. I don't know how to tackle this to make it proper. Problems we currently have:
A more declarative way would be to:
|
I agree with the steps and it's similar to what I proposed in the earlier comment.
|
Perfect! |
…ver.preprocess() and clean up
fee73cf
to
5f41a4d
Compare
@fraimondo The latest commits should implement this. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 88.90% 88.95% +0.05%
==========================================
Files 103 103
Lines 4615 4610 -5
Branches 868 868
==========================================
- Hits 4103 4101 -2
+ Misses 368 366 -2
+ Partials 144 143 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Tests are not passing yet, but code is OK from my side.
Was a network issue for downloading assets, nothing from our side. Let's wait and see. |
This PR refactors
preprocess
method of preprocessors to not return "data type" and only return the preprocessed input data. Having to return "data type" forced a concrete preprocessor to only operate on a single "data type" (likeBOLDWarper
introduced in #267) and not allow theon
parameter to be exposed to the user (as requested in #301). If a concrete preprocessor adds new "data type" likeBOLD_mask
in the "junifer data object" asfMRIPrepConfoundRemover
(introduced in #111) does, it will be handled as usual with no changes.A preprocessor should not create new "data types" (which was allowed earlier and hence the restriction) but only create and add "helper data types" like
BOLD_mask
which happens viaextra_input
of thepreprocess
method.