Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove deprecated mlab code #12165

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 66 commits into from
Oct 5, 2018
Merged

Remove deprecated mlab code #12165

merged 66 commits into from
Oct 5, 2018

Conversation

dstansby
Copy link
Member

If I remember correctly we do 2 major cycles for deprecation, which means it's time to get rid of lots of mlab code! I plan on doing this bit by bit, but I'll leave the PR open so CI gets run after each bit I do to check nothing breaks.

@dstansby dstansby added this to the v3.1 milestone Sep 19, 2018
@dstansby dstansby force-pushed the mlab-remove branch 2 times, most recently from 8ee4db9 to 6a89da9 Compare September 19, 2018 17:09
@dstansby
Copy link
Member Author

This is going to be a monster diff by the time it's done!

@tacaswell
Copy link
Member

Fun but scary!

Lots of code inside the :mod:`matplotlib.mlab` module which was deprecated
in Matplotlib 2.2 has been removed. See below for a list:

- `mlab.logspace` (use numpy.logspace instead)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former should be inline-code formatting (since there's nothing to link to now) and the replacement should be a link (since we should have intersphinx for these.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix this all in one go at the end

@@ -231,15 +229,15 @@
## We are still importing too many things from mlab; more cleanup is needed.

from matplotlib.mlab import (
amap, base_repr, binary_repr, bivariate_normal, center_matrix, csv2rec,

This comment was marked as resolved.

@dstansby dstansby force-pushed the mlab-remove branch 4 times, most recently from 0010d18 to efa385f Compare September 21, 2018 10:35
@dstansby dstansby changed the title [WIP] Remove deprecated mlab code Remove deprecated mlab code Sep 29, 2018
@dstansby
Copy link
Member Author

If CI passes, I think this is ready to be reviewed!

@@ -85,6 +84,32 @@ def get_ind_under_point(self, event):

return ind

def dist(self, x, y):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make these free-standing functions instead of methods?

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pending ci

@@ -2231,8 +2231,7 @@ def plotfile(fname, cols=(0,), plotfuncs=None,
columns.

*comments*, *skiprows*, *checkrows*, *delimiter*, and *names*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're probably going to have to copy these definitions in now since there's not going to be a csv2rec link.

- ``ispower2``
- ``isvector``
- ``l1norm``
- ``l2norm``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a replacement for these two norms above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, thanks for catching these!

- ``frange`` (use `numpy.arange` instead)
- ``get_sparse_matrix``
- ``get_xyz_where``
- ``griddata``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a replacement for this above.

- ``dist_point_to_segment``
- ``distances_along_curve``
- ``entropy`` (use `scipy.stats.entropy` instead)
- ``exp_safe``
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a replacement for this above.

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Lets merge; it could use a workout on master sooner rather than later I imagine...

@jklymak jklymak merged commit d99714f into matplotlib:master Oct 5, 2018
@dstansby dstansby deleted the mlab-remove branch October 6, 2018 11:54
- ``binary_repr``
- ``bivariate_normal``
- ``center_matrix``
- ``csv2rec`` (use `numpy.recarray.tofile` instead)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does csv2rec have a replacement? tofile seems like a replacement for rec2csv not csv2rec.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest using pandas instead. If you really need csv -> record array the best course of action is probably to vendor the code to your project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants