-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[MNT] Fix warnings in widget tests #3502
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
Merged
Merged
Changes from 39 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
88e49ae
Test warnings: Fix warning about old-style widget messages
janezd 4f8ec03
Test warnings: Rename widgets' self.info to self.infolabel
janezd c5a6c98
Test warnings: Register DummyComponent as provider for test widget
janezd 4ed3208
Test warnings: Mock and test logging instead of printing it out
janezd 2f48790
Test warnings: rename assertEquals to assertEqual
janezd 57e60e7
Test warnings: OWDataSampler, use randint instead of random_integer, …
janezd 53767bb
Test warnings: Remove warnings related to empty or all-nan matrices
janezd 7317da2
Test warnings: Remove warnings in OWRank
janezd a5097b8
OWCalibrationPlot: Remove division by zero in smoothing
janezd b37590c
SGD: Set tol to 1e-3 (future default from 0.21) to avoid warnings
janezd a8d9bdf
Test warnings: Remove convergence warnings in tests for OWCalibration
janezd 30f0b9e
Test warnings: Remove division by zero in confusion matrix
janezd 364de14
Test warnings: Silence warning about ill-defined F-score and precision
janezd f6c8312
Test warnings: Remove selecting class value: widget.data is None at t…
janezd bb86133
Test warnings: Fix deprecated indexing in test_owlogisticregression.py
janezd 919468f
Test warnings: Test logged error in report test instead of printing i…
janezd 16cb108
Test warnings: Ignore division by zero in owcorrespondence
janezd a171cb2
Test warnings: Silence warning in construction of infinite distances …
janezd f1ad559
MDS: Don't set n_init to 4 if init_data is given
janezd 6b4e0cd
Test warnings: Silence matrix deprecation warning in scipy
janezd 93f135d
Test warnings: Silence convergence warnings in tests for widgets of n…
janezd 1a1234f
Test warnings: Fix or silence warning in MDS tests
janezd 2adcf6c
Scatterplotgraph: Faster construction of continuous palette if all co…
janezd e8aeee6
OWManifoldLearning: capture and show warning about disconnected graph…
janezd b92a126
OWtSNE: treat all-nan columns as constant in check_data
janezd c318db6
Test warnings: Silence division by zero warning in PCA
janezd ef82ba3
Box plot: Fix divisions by zero in statistical tests
janezd 5af6da7
OWDistributions: Fix arguments in smoothing (float -> int)
janezd d64d773
Orange.distance: silence warning about unhandled nans that are handle…
janezd 598bbb8
OWSieve: Fix division by zero
janezd 28799b8
Heatmap tests: Silence warnings about convergence
janezd f9b1edc
Test concurrent: Silence warning that the class (we're testing) is ob…
janezd 03055fb
Test warnings: Remove prints
janezd bd289f6
Tests: Stop report window and some other widgets from showing
janezd 7dd696f
owfeaturestatistics: Change deprecated locale.format -> format_string
lanzagar 7884e2c
Fix warnings in widget tests: Follow suggestions in review (1)
janezd 8950666
data.utils.histogram: Fix warning for means of empty bins
janezd 3395a0c
Venn Diagram: Silence warning about nans
janezd 23d674d
manifold.MDS: Change the signature back to same as skl, fix n_init in…
janezd c5f8118
fixup! Test warnings: Remove warnings in OWRank
janezd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
|
|
||
| It also patches bottleneck to contain these functions. | ||
| """ | ||
| import warnings | ||
| from warnings import warn | ||
|
|
||
| import bottleneck as bn | ||
|
|
@@ -353,7 +354,10 @@ def weighted_mean(): | |
|
|
||
| def _nan_min_max(x, func, axis=0): | ||
| if not sp.issparse(x): | ||
| return func(x, axis=axis) | ||
| with warnings.catch_warnings(): | ||
|
||
| warnings.filterwarnings("ignore", ".*All-NaN slice encountered.*", | ||
| RuntimeWarning) | ||
| return func(x, axis=axis) | ||
| if axis is None: | ||
| extreme = func(x.data, axis=axis) if x.nnz else float('nan') | ||
| if sparse_has_implicit_zeros(x): | ||
|
|
@@ -423,6 +427,9 @@ def nanmean(x, axis=None): | |
| """ Equivalent of np.nanmean that supports sparse or dense matrices. """ | ||
| def nanmean_sparse(x): | ||
| n_values = np.prod(x.shape) - np.sum(np.isnan(x.data)) | ||
| if not n_values: | ||
| warnings.warn(RuntimeWarning, "Mean of empty slice") | ||
| return np.nan | ||
| return np.nansum(x.data) / n_values | ||
|
|
||
| return _apply_func(x, np.nanmean, nanmean_sparse, axis=axis) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.