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

Skip to content

Doc: Do not write default for non-existing rcParams #15231

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
Sep 10, 2019

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Sep 8, 2019

PR Summary

#15115 introduced automatic documentation of rcParams defaults. We have some special-named references such as wildcards. They were documented as defaulting to None:

image

This PR changes the behavior to simply not show any default in such a case.

Note: If one wanted to be more strict, one could alternatively exclude wildcard references and error out/warn if other references are encountered.

@@ -4,8 +4,12 @@


def rcparam_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
param = rcParamsDefault.get(text)
rendered = nodes.Text(f'rcParams["{text}"] = {param!r}')
try:
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason to use try... except... instead of if text in rcParamsDefault?

@dstansby dstansby added this to the v3.2.0 milestone Sep 10, 2019
@dstansby dstansby added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Sep 10, 2019
@tacaswell tacaswell merged commit 8ed827e into matplotlib:master Sep 10, 2019
@timhoffm timhoffm deleted the doc-rcparams-none branch September 10, 2019 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation 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