[MNT] Fix test warnings in scripting part#3503
Conversation
9350394 to
595137c
Compare
Codecov Report
@@ Coverage Diff @@
## master #3503 +/- ##
==========================================
- Coverage 83.59% 83.54% -0.05%
==========================================
Files 367 367
Lines 65580 65784 +204
==========================================
+ Hits 54823 54961 +138
- Misses 10757 10823 +66 |
Codecov Report
@@ Coverage Diff @@
## master #3503 +/- ##
==========================================
- Coverage 83.97% 83.97% -0.01%
==========================================
Files 370 370
Lines 66920 66941 +21
==========================================
+ Hits 56196 56212 +16
- Misses 10724 10729 +5 |
595137c to
64cd571
Compare
80e6937 to
72b2f9c
Compare
72b2f9c to
d474b22
Compare
4258cad to
730c346
Compare
|
Build crashed (output too large) after removing the fix for
The problem in this PR is silencing the warnings in If you agree, I'll:
When/If I get a green light from you, I'll first fix this PR and then do the same in #3502 (there seem to be just six places, also thanks to your cautious approach reviewing it). |
|
At least now we know why filtering out some warnings can actually lead to more of them in the output! |
d4e4922 to
6f572b2
Compare
6f572b2 to
b10a5e3
Compare
janezd
left a comment
There was a problem hiding this comment.
I disabled warning about (scipy.sparse's) using of matrix for all Orange. Warnings are silenced on Travis and when tests are run locally in certain ways, but not always: if tests are run in PyCharm, warnings are re-enabled by the test runner. I don't see a good way of disabling it without hacking into the runner or warnings filter. This is not critical, though.
| means = np.nanmean(x, axis=0) | ||
| vars = np.nanvar(x, axis=0) | ||
| if self.normalize and not vars.all(): | ||
| raise ValueError("some columns are constant") |
There was a problem hiding this comment.
x[~mask] unnecessarily copies the array, and I wouldn't like to do it column by column. This patching is a non-idiomatic substitute for catch_warnings.
| mads = np.zeros(len(x)) | ||
| else: | ||
| medians = np.nanmedian(x, axis=0) | ||
| mads = np.nanmedian(np.abs(x - medians), axis=0) |
There was a problem hiding this comment.
The warning here was "mean of empty slice", which appeared because median fell back to mean if size equalled 0 (achieving what?!)
| # This warning filter can be removed in scikit 0.22 | ||
| with warnings.catch_warnings(): | ||
| warnings.filterwarnings( | ||
| "ignore", "The behavior of AMI will change in version 0\.22.*") |
There was a problem hiding this comment.
I kept this catch_warnings although it's not in tests. It's supposed to be temporary.
b10a5e3 to
bc99d0c
Compare
Similar to #3502, this PR deals with most warnings in the scripting part, except those in postgresql and a few in the code I don't sufficiently understand.