-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Remove deprecated mlab code #12165
Conversation
8ee4db9 to
6a89da9
Compare
|
This is going to be a monster diff by the time it's done! |
|
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) |
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.
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.)
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.
I'll fix this all in one go at the end
| ## 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.
This comment was marked as resolved.
Sorry, something went wrong.
0010d18 to
efa385f
Compare
27f94c7 to
ddf38fe
Compare
|
If CI passes, I think this is ready to be reviewed! |
|
|
||
| return ind | ||
|
|
||
| def dist(self, x, y): |
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.
make these free-standing functions instead of methods?
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.
pending ci
lib/matplotlib/pyplot.py
Outdated
| that changes the axis scaling will set the scaling for all | ||
| columns. | ||
| *comments*, *skiprows*, *checkrows*, *delimiter*, and *names* |
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.
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`` |
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.
There's a replacement for these two norms above.
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.
Ahh, thanks for catching these!
| - ``frange`` (use `numpy.arange` instead) | ||
| - ``get_sparse_matrix`` | ||
| - ``get_xyz_where`` | ||
| - ``griddata`` |
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.
There's a replacement for this above.
| - ``dist_point_to_segment`` | ||
| - ``distances_along_curve`` | ||
| - ``entropy`` (use `scipy.stats.entropy` instead) | ||
| - ``exp_safe`` |
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.
There's a replacement for this above.
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.
This looks good to me. Lets merge; it could use a workout on master sooner rather than later I imagine...
| - ``binary_repr`` | ||
| - ``bivariate_normal`` | ||
| - ``center_matrix`` | ||
| - ``csv2rec`` (use `numpy.recarray.tofile` instead) |
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.
Does csv2rec have a replacement? tofile seems like a replacement for rec2csv not csv2rec.
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.
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.
If I remember correctly we do 2 major cycles for deprecation, which means it's time to get rid of lots of
mlabcode! 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.