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
NF Add the parameter fa_operator in auto_response function #1288
Conversation
Looks useful. I'd prefer to have the operator be a proper callable (defined as a function), rather than a lambda defined in the function signature (that looks a bit weird to me). I'd also want to see a test that defines this callable as something different, to get a sense for how this will be used. |
dipy/reconst/csdeconv.py
Outdated
operator used to compare the FA with the fa_thr. | ||
fa_operator : function | ||
Function that defines operator used to compare the FA with the fa_thr. | ||
Must be defined as `def function_name(FA, fa_thr)` and return a bool array. |
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? I believe lambdas and functions are the same in python (expect lambdas don't get a function name).
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.
So, I don't know if my last commit is the right thing or not
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 think that the code is fine (I think it's easier to understand this way). The documentation can be changed to say:
fa_operator : callable
A callable that defines an operation that compares FA with the fa_thr. The operator
should have two positional arguments (e.g., `fa_operator(FA, fa_thr)`) and it should
return a bool array.
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #1288 +/- ##
==========================================
+ Coverage 87.11% 87.12% +0.01%
==========================================
Files 228 228
Lines 28764 28791 +27
Branches 3090 3093 +3
==========================================
+ Hits 25057 25084 +27
Misses 3003 3003
Partials 704 704
Continue to review full report at Codecov.
|
1 similar comment
1 similar comment
This looks good to me. Unless I hear any objections, I will merge this after the holiday (July 4th). |
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 am not sure about the name. fa_operator? fa_callable is preferred. |
@skoudoro I work with @GuillaumeTh on this. I might be lost, but I don't see the change you requested. Mind pointing it? Also, you say you prefer to merge #1283 before this one. Is it because both of them touch the test_csdeconv file? I don't think this might create any conflict. |
1 similar comment
NF Add the parameter fa_operator in auto_response function
Add a new parameter (fa_operator) in auto_response to give an operator for the comparison with the FA threshold.
@jchoude, @arokem, @MrBago Can you review ? This PR will be useful when the MSMT PR will be merged.