-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[FIX] Fix varius deprecation (and other) warnings #1774
Merged
lanzagar
merged 19 commits into
biolab:master
from
ales-erjavec:fixes/deprecation-warnings
Nov 25, 2016
Merged
[FIX] Fix varius deprecation (and other) warnings #1774
lanzagar
merged 19 commits into
biolab:master
from
ales-erjavec:fixes/deprecation-warnings
Nov 25, 2016
Conversation
This file contains 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
Replace random_integers with randint
Fix a 'DeprecationWarning: Passing 1d arrays as data is deprecated in 0.17 and will raise ValueError in 0.19. Reshape your data either using X.reshape(-1, 1) if your data has a single feature or X.reshape(1, -1) if it contains a single sample.' from scikit-learn
Fix a 'VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future'
lanzagar
reviewed
Nov 24, 2016
@@ -101,8 +101,11 @@ def _score_cont(): | |||
if score == 0: | |||
return REJECT_ATTRIBUTE | |||
score *= non_nans / len(col_x) | |||
branches = (col_x > cut).astype(int) | |||
|
|||
with np.errstate(invalid="ignore"): # NaN in col_x handled later |
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.
Wouldn't it be cleaner to initialize branches to -np.ones and set only the non-nan values after that.
Maybe it's just me, but I prefer not triggering errors to declaring which ones to ignore.
Great stuff 👍 |
Current coverage is 88.96% (diff: 100%)@@ master #1774 diff @@
==========================================
Files 82 82
Lines 8853 8857 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 7872 7880 +8
+ Misses 981 977 -4
Partials 0 0
|
Fix FutureDeprecationWarnings due to PEP 479
A OWWidget can be constructed only with only a mainArea (no controlArea, e.g. 'OWDistanceMatrix') in which case the constant index was incorect. Fixes a warning 'QSplitter::setCollapsible: Index 1 out of range' from Qt
Suppress a "FutureWarning: in the future, full(...) will return an array of dtype('int64')"
Was broken since 2329179
Suppress a 'DeprecationWarning: numpy boolean subtract, the `-` operator, is deprecated, use the bitwise_xor, the `^` operator, or the logical_xor function instead'
Suppress a warning from Qt ('QGraphicsScene::addItem: item has already been added to this scene')
ales-erjavec
force-pushed
the
fixes/deprecation-warnings
branch
from
November 24, 2016 18:07
fe6e27c
to
8eba817
Compare
In numpy 1.12b passing the distribution.Continuous instance as the weight parameter to np.average triggers a: File "..numpy/lib/function_base.py", line 1138, in average if (scl == 0.0).any(): AttributeError: 'bool' object has no attribute 'any'
Passing a ndarray subclass to numpy.average triggers a: FutureWarning: np.average currently does not preserve subclasses, but will do so in the future to match the behavior of most other numpy functions such as np.mean. In particular, this means calls which returned a scalar may return a 0-d subclass object instead. In this case this is not what we want.
Compute a 'weighted count' of NaNs if weights vector is supplied
lanzagar
approved these changes
Nov 25, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue
Current output from test shows quite a lot of warnings, which means that new ones are hard to spot.
Description of changes
Fix most of the easily avoidable warnings.
Includes