Stricter check_params
protocol for DA module would simplify debugging
#528
Labels
check_params
protocol for DA module would simplify debugging
#528
Describe the bug
ot.utils.check_params
is used rather heavily throughoutot.da
functions. The function itself checks forNone
(s) in the input and returnsFalse
if at least one was spotted. Now, there are 2 patters of howcheck_params
is used in the code that are somewhat hard to debug when argument passed is, in fact, "invalid":fit
function works whencheck_params
returnsTrue
, otherwise just returnsself
(example). As there's no exceptions thrown, the downstream code safely assumes that fitting is done.transform
returns the result of the transformation only in casecheck_params
returnsTrue
, otherwise returnsNone
(example).In both cases, it's rather hard to find the cause as the issue is only reported using
print
statements.Expected behavior
Suggestion here is rather simple: to follow stricter convention, for example similar to
check_array
in sklearn. ThrowingValueError
in case invalid argument is provided seems to be safer option. What do you think? Happy to make a PR with the changes.The text was updated successfully, but these errors were encountered: