Skip to content
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

BUG: Address `numpy.matrix` `PendingDeprecation` warnings. #1707

Merged

Conversation

@jhlegarreta
Copy link
Contributor

commented Dec 26, 2018

Address numpy.matrix PendingDeprecation warnings:

  • Change the uses of numpy.matrix to numpy.array.
  • Change the use of numpy.matrix.trace to numpy.trace.

Fixes warnings:

/home/travis/build/nipy/dipy/venv/lib/python3.4/site-packages/numpy/matrixlib/defmatrix.py:68:
PendingDeprecationWarning: the matrix subclass is not the recommended
way to represent matrices or deal with linear algebra (see
https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html).
Please adjust your code to use regular ndarray.
  return matrix(data, dtype=dtype, copy=False)

This should complete the work in PR #1678.

@pep8speaks

This comment has been minimized.

Copy link

commented Dec 26, 2018

Hello @jhlegarreta, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated on December 26, 2018 at 16:35 Hours UTC
@jhlegarreta

This comment has been minimized.

Copy link
Contributor Author

commented Dec 26, 2018

317c5c9 addresses the PEP8 warnings.

There could potentially be many more PEP8 warnings thrown on unchanged lines on that file. But since the file is in the scratch folder, unless the contrary is said, addressing all of them is not necessary at this time IMHO.

@jhlegarreta

This comment has been minimized.

Copy link
Contributor Author

commented Dec 26, 2018

The reported test failure is related to #1698.

jhlegarreta added 2 commits Dec 26, 2018
BUG: Address `numpy.matrix` `PendingDeprecation` warnings.
Address `numpy.matrix` `PendingDeprecation` warnings:
- Change the uses of `numpy.matrix` to `numpy.array`.
- Change the use of `numpy.matrix.trace` to `numpy.trace`.

Fixes warnings:
```
/home/travis/build/nipy/dipy/venv/lib/python3.4/site-packages/numpy/matrixlib/defmatrix.py:68:
PendingDeprecationWarning: the matrix subclass is not the recommended
way to represent matrices or deal with linear algebra (see
https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html).
Please adjust your code to use regular ndarray.
  return matrix(data, dtype=dtype, copy=False)
```

This should complete the work in PR #1678.
STYLE: Address PEP8 warnings.
Address PEP8 warnings.

Fix:
```
E225 missing whitespace around operator
```
and
```
E231 missing whitespace after ','
```

PEP8 warnings.

@jhlegarreta jhlegarreta force-pushed the jhlegarreta:FixNumpyMatrixPendingDeprecationWarnings branch from 317c5c9 to 65a072c Dec 30, 2018

@codecov-io

This comment has been minimized.

Copy link

commented Dec 30, 2018

Codecov Report

Merging #1707 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1707      +/-   ##
==========================================
+ Coverage   84.26%   84.27%   +<.01%     
==========================================
  Files         114      114              
  Lines       13556    13556              
  Branches     2139     2139              
==========================================
+ Hits        11423    11424       +1     
  Misses       1637     1637              
+ Partials      496      495       -1
Impacted Files Coverage Δ
dipy/viz/projections.py 20% <ø> (ø) ⬆️
dipy/reconst/qtdmri.py 93.94% <100%> (ø) ⬆️
dipy/core/graph.py 75% <0%> (+1.19%) ⬆️
1 similar comment
@codecov-io

This comment has been minimized.

Copy link

commented Dec 30, 2018

Codecov Report

Merging #1707 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1707      +/-   ##
==========================================
+ Coverage   84.26%   84.27%   +<.01%     
==========================================
  Files         114      114              
  Lines       13556    13556              
  Branches     2139     2139              
==========================================
+ Hits        11423    11424       +1     
  Misses       1637     1637              
+ Partials      496      495       -1
Impacted Files Coverage Δ
dipy/viz/projections.py 20% <ø> (ø) ⬆️
dipy/reconst/qtdmri.py 93.94% <100%> (ø) ⬆️
dipy/core/graph.py 75% <0%> (+1.19%) ⬆️
@skoudoro

This comment has been minimized.

Copy link
Member

commented Dec 30, 2018

LGTM, merging

@skoudoro skoudoro merged commit e90ac3f into nipy:master Dec 30, 2018

4 checks passed

codecov/patch 100% of diff hit (target 84.26%)
Details
codecov/project 84.27% (+<.01%) compared to 58393aa
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jhlegarreta jhlegarreta deleted the jhlegarreta:FixNumpyMatrixPendingDeprecationWarnings branch Dec 30, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.