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

Skip to content

DOC change normed to density in matplotlib calls in examples #12718

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 2 commits into from
Dec 6, 2018

Conversation

adrinjalali
Copy link
Member

As pointed out in #12654 by @qinhanmin2014 , the normed to density issue may be more urgent than the other fixes. Hence here's a fix for those only, in our examples.

@TomDLT
Copy link
Member

TomDLT commented Dec 4, 2018

It breaks on old matplotlib though.

@adrinjalali
Copy link
Member Author

Yes it does break on really old matplotlib, but not on the matplotlib LTS.
According to our installation doc, we don't even mention a minimum matplotlib version requirement.

So I guess the right way would be to raise the minimum requirements on our python 2 CI, and then merge this one. If we do that, maybe we could also raise the min versions for other dependencies such as skimage?

@qinhanmin2014
Copy link
Member

According to our installation doc, we don't even mention a minimum matplotlib version requirement.

See README: for running the examples Matplotlib >= 1.4 is required.

I think we need to fix this one before deprecating python2, because normed will be deprecated in matplotlib 3.1. At that time, 0.20.X is likely to be the latest stable version.

So I guess the right way would be to raise the minimum requirements on our python 2 CI

Apart from raising the minimal version, we have other solutions, see e.g., https://github.com/scikit-learn/scikit-learn/blob/master/examples/decomposition/plot_sparse_coding.py (introduce different solutions for different versions).

@adrinjalali
Copy link
Member Author

@qinhanmin2014 I see. So our website doesn't mention a min dependency, but our README (which is mirrored on PyPi) does. Hmm, do we have a strong attachment to those requirements? I'd say since these changes don't change anything regarding the usage of our API, and they're only examples, we can just change the README to move the min requirement a bit upward.

Otherwise I can make the examples support both matplotlib APIs.

Also, the README says matplotlib >= 1.4, and I guess moving to 2.1.2 or 2.2.3 would be reasonable since matplotlib lists:

  • 3.0.2 Stable version.
  • 2.2.3 LTS LTS version.
  • 3.x Latest git master (unstable)
  • 2.1.2 Older stable version.

That said, Ubuntu 14.04 has matplotlib 1.3.1, and 16.04 matplotlib 1.5.1, I guess.

@qinhanmin2014
Copy link
Member

I think the min dependency comes from Ubuntu 14.04. We'll need more consensus to change the min dependency (not so easy I think).

@qinhanmin2014
Copy link
Member

@adrinjalali Do you have time to investigate when (which version) did matplotlib introduce the density parameter?

@rth
Copy link
Member

rth commented Dec 5, 2018

I think, for 0.21 we can use 16.04 LTS as the oldest "supported" Ubuntu. That's what we were planning to do for numpy and scipy in #12184

So it might make sense to do the same for matplotlib and scikit-image.

@qinhanmin2014
Copy link
Member

I think, for 0.21 we can use 16.04 LTS as the oldest "supported" Ubuntu. That's what we were planning to do for numpy and scipy in #12184

@rth But I'd rather hurry this one into 0.20.2, see my comment above:
I think we need to fix this one before deprecating python2, because normed will be deprecated in matplotlib 3.1. At that time, 0.20.X is likely to be the latest stable version.

@adrinjalali Do you have time to investigate when (which version) did matplotlib introduce the density parameter?

Sorry for the stupid mistake. density parameter is introduced in matplotlib 2.1, which is indicated in the deprecation message.

Hmm, @rth the minimal version of matplotlib for Ubuntu 16.04 is 1.5.1? Do you have time to check it (and provide the URL)?

@rth
Copy link
Member

rth commented Dec 5, 2018

But I'd rather hurry this one into 0.20.2

Sure

the minimal version of matplotlib for Ubuntu 16.04 is 1.5.1?

it's 1.5.1 for matplotlib (https://packages.ubuntu.com/xenial/python3-matplotlib) and 0.10.1 for scikit-image (https://packages.ubuntu.com/xenial/python3-skimage).

@qinhanmin2014
Copy link
Member

Thanks @rth, so seems that we need version comparison here even if we don't want to include the change in 0.20.2. Do you want to complete it? @adrinjalali

@adrinjalali
Copy link
Member Author

Sure, I'll fix the examples here.

Copy link
Member

@qinhanmin2014 qinhanmin2014 left a comment

Choose a reason for hiding this comment

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

You don't need to [doc build], our Circle CI is often overburdened :)

@qinhanmin2014 qinhanmin2014 merged commit f70b1ff into scikit-learn:master Dec 6, 2018
@adrinjalali adrinjalali deleted the doc/normed branch December 6, 2018 08:44
amueller pushed a commit to amueller/scikit-learn that referenced this pull request Dec 14, 2018
amueller pushed a commit to amueller/scikit-learn that referenced this pull request Dec 17, 2018
adrinjalali added a commit to adrinjalali/scikit-learn that referenced this pull request Jan 7, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
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.

5 participants