Skip to content

Deprecate rcParams["datapath"] in favor of mpl.get_data_path(). #16722

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 4 commits into from
Mar 17, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Mar 10, 2020

The rcParam cannot be meaningfully set by the end user from their
matplotlibrc or Python code.

(This is a manual backport to 3.2.x of #16417; see discussion there.)

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

The rcParam cannot be meaningfully set by the end user from their
matplotlibrc or Python code.

(This is a manual backport to 3.2.x.)
@anntzer anntzer added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 10, 2020
@anntzer anntzer added this to the v3.2.1 milestone Mar 10, 2020
@anntzer
Copy link
Contributor Author

anntzer commented Mar 13, 2020

@tacaswell I don't think this will help if the user directly assigns to rcParams["datapath"]?

@tacaswell
Copy link
Member

It will not, but I thought the OP was loading it from a file? The other option is to add a flag to suppress checking the rcParams so it works no matter what.

@anntzer
Copy link
Contributor Author

anntzer commented Mar 13, 2020

OK, I guess your solution works for that case...

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

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

AFAICT, this correctly raises the deprecation warning and sets the path, but I have a couple questions.

Closes matplotlib#16678

This does a bit of jiggery-pokery to respect the datapath set in
the users matplotlibrc.   This is going to have an expedited
deprecation cycle as we don't think end-users should be setting this
rcparam.
@tacaswell tacaswell force-pushed the deprecate-rcdatapath-32 branch from 5f62526 to ecd95c4 Compare March 16, 2020 22:28
Co-Authored-By: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@tacaswell
Copy link
Member

So this fixes the thing we broke for the OP but does not fully restore the functionality.

I am 👍 on this being good enough, but open to the argument we should fully restore the rcparam functionality.

@anntzer
Copy link
Contributor Author

anntzer commented Mar 17, 2020

@tacaswell's patch looks fine to me.

Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

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

despite my having written a bunch of this.

@tacaswell tacaswell merged commit 4897c4d into matplotlib:v3.2.x Mar 17, 2020
@anntzer anntzer deleted the deprecate-rcdatapath-32 branch March 17, 2020 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants