8000 Do not warn-depreacted when iterating over rcParams by timhoffm · Pull Request #12658 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Do not warn-depreacted when iterating over rcParams #12658

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 1 commit into from
Oct 29, 2018

Conversation

timhoffm
Copy link
Member

PR Summary

Closes #12649.

This is an alternative approach to #12652. In contrast to #12652 we still return the deprecated rcParams

@anntzer
Copy link
Contributor
anntzer commented Oct 28, 2018

Ah, of course!

@timhoffm timhoffm added this to the v3.0.x milestone Oct 28, 2018
@jklymak
Copy link
Member
jklymak commented Oct 29, 2018

doc error seems to be something wrong w CI not this PR....

@jklymak jklymak merged commit c921e2e into matplotlib:m 8000 aster Oct 29, 2018
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Oct 29, 2018
jklymak added a commit that referenced this pull request Oct 29, 2018
…658-on-v3.0.x

Backport PR #12658 on branch v3.0.x (Do not warn-depreacted when iterating over rcParams)
@timhoffm timhoffm deleted the iter-deprecated-rcparams branch October 29, 2018 20:20
@pllim
Copy link
pllim commented May 29, 2019

I still see the warning reported by @astrofrog in #12649 with Matplotlib 3.1.0, even when theoretically, this patch would have silenced it. Is what I am seeing something different? Should I open a new issue?

>>> import matplotlib
>>> matplotlib.__version__
'3.1.0'
>>> {}.update(matplotlib.rcParams)
... MatplotlibDeprecationWarning:
The examples.directory rcparam was deprecated in Matplotlib 3.0 and will be removed
in 3.2. In the future, examples will be found relative to the 'datapath' directory.
$ conda list matplotlib
# packages in environment at C:\...\Miniconda3\envs\py37:
#
# Name                    Version                   Build  Channel
matplotlib                3.1.0                    py37_1    conda-forge
matplotlib-base           3.1.0            py37h2852a4a_1    conda-forge

@timhoffm
Copy link
Member Author
timhoffm commented May 30, 2019

This is not contained in 3.1.0.

@tacaswell can it be that some fixes in 3.0.x are not contained in 3.1.0?

@tacaswell
Copy link
Member

I'm very confused what is going on here...

@timhoffm
Copy link
Member Author

Was this ever working? I suspect that catching the warn 8000 ings in __iter__ does not help because that only protects obtaining the keys. We would actually have to protect the __getitem__ - but only for the case while we're iterating through it. Sound not like that's possible.

@timhoffm
Copy link
Member Author
timhoffm commented May 30, 2019

Can this be a strange interference between the warning suppression context and the generator? I checked that the warning is displayed after __iter__ is complete and the context is closed.

@timhoffm
Copy link
Member Author
timhoffm commented May 30, 2019

I've checked that the following happens for {}.update(matplotlib.rcParams):

  1. All keys are fetched via __iter__.
  2. __iter__ is finished and the warnings-filter context is closed.
  3. All items are obtained via __getitem__.

So it's clear that the filter has no effect. But why did we commit this? Did it maybe work in 3.6? - Nope. Doesn't work in 3.6 either.

Given the above. I don't think, we can suppress the warning selectively for {}.update(matplotlib.rcParams).

@pllim
Copy link
pllim commented Nov 26, 2019

Hello. I still see the deprecation warning. Should I open a new issue at this point?

@timhoffm
Copy link
Member Author

Yes, please open a new issue and provide an example.

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.

Over-verbose deprecation warning about examples.directory
5 participants
0