Repository navigation
Update _smoothers_lowess.pyx - #5556
Conversation
The user is supposed to supply a value in the range [0,1] to the argument frac in the Lowess smoother, but this is not enforced! As a result, if the user mistakenly supplies a value such as frac=40 (for 40%) the software silently defaults to frac=1. Instead, the user should be alerted to this mistake.
|
Alternatively, this patch could go in the Python code for the Lowess smoother here; however, it seems as though the check should be placed as closely to the usage as possible to prevent other code paths from inadvertently supplying the bad values this is supposed to exclude. |
Codecov Report
@@ Coverage Diff @@
## master #5556 +/- ##
==========================================
+ Coverage 82.02% 82.03% +<.01%
==========================================
Files 588 588
Lines 93062 93062
Branches 10317 10317
==========================================
+ Hits 76336 76345 +9
+ Misses 14361 14355 -6
+ Partials 2365 2362 -3
Continue to review full report at Codecov.
|
|
Happy to merge this PR if you can write a test that shows that it works for frac <0 and frac > 1. |
|
I'm afraid I'm not sure where or how to do that. |
|
You need to add a function to which has the name patters |
|
Thanks. While this really should have a test, thanks for helping -- all improvements are welcome. |
The user is supposed to supply a value in the range [0,1] to the argument frac in the Lowess smoother, but this is not enforced! As a result, if the user mistakenly supplies a value such as frac=40 (for 40%) the software silently defaults to frac=1. Instead, the user should be alerted to this mistake.