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

Skip to content

Validate assignments to rcParams-like dictionaries #69

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

Closed
lukelbd opened this issue Nov 26, 2019 · 3 comments
Closed

Validate assignments to rcParams-like dictionaries #69

lukelbd opened this issue Nov 26, 2019 · 3 comments

Comments

@lukelbd
Copy link
Collaborator

lukelbd commented Nov 26, 2019

The rcParamsShort and rcParamsCustom dictionaries in rctools.py (used to power the rc_configurator) should have restricted keys and automatic entry validation, like rcParams. This can be done using the existing public matplotlib API and the RcParams class. It's a minor issue, maybe post-v1.

@lukelbd
Copy link
Collaborator Author

lukelbd commented Jan 8, 2020

This change is ready to be added after the #91 merge

It probably does need to be included in v1 because otherwise incorrect entries in .proplotrc or assignments to plot.rc are extremely difficult to debug. We can borrow the various validate_* fucntions from matplotlib/rcsetup.py, and might want to also design a new "units" validator (inches, centimeters, etc.) and refactor the units function to use this validator.

@lukelbd
Copy link
Collaborator Author

lukelbd commented Jul 30, 2021

This should also pass assignments to rc.cmap and rc.cycle through their respective constructor functions (see #169).

@lukelbd
Copy link
Collaborator Author

lukelbd commented Aug 18, 2021

This is finally done 🎉 . All assignments are validated using an rc_proplot dictionary analogous to rc_matplotlib. Decided it would be better to just have a separate minimal validated dictionary for storing my own settings and continuing to use Configurator rather than trying to sync both of them into some giant RcParams overall.

@lukelbd lukelbd closed this as completed Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant