Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

LOG: added printout of rcParams at debug level#10039

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
jklymak wants to merge1 commit intomatplotlib:masterfromjklymak:log-rcparams

Conversation

jklymak
Copy link
Member

PR Summary

In helping to debug#10016 I noted that there is no good way to see what the rcParams are in the debug interface. This seemed easy to add

PR Checklist

  • Has Pytest style unit tests
  • Code is PEP 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

Copy link
Member

@tacaswelltacaswell left a comment

Choose a reason for hiding this comment

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

Slightly concerned about the verbosity.

@jklymak
Copy link
MemberAuthor

Yeah if you set level to DEBUG you get a lot of output and it basically needs to go in a file. OTOH I don’t think there is any reason to be shy about verbose output when using debug.

The motivation here is to just ask the user for one file rather than the debug output and the matpltolibrc. But I don’t feel strongly if this is seen as cluttering up the debug info.

FWIW I usually put the logging info after the matpltolib import to keep the log shorter without all the startup info

Copy link
Member

@efiringefiring left a comment

Choose a reason for hiding this comment

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

In addition, it might be good to include the output ofmatplotlib.get_fname(), which shows the source of the matplotlibrc file that might have modified thercParams. This is probably more valuable for debugging than the fullrcParams.

@@ -1181,6 +1182,9 @@ def rc_params_from_file(fname, fail_on_error=False, use_default_template=True):
if rcParams['axes.formatter.use_locale']:
locale.setlocale(locale.LC_ALL, '')

_log.debug('rcParams: ')
_log.debug(rcParams)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested consolidation:

_log.debug('rcParams:\n%s', rcParams)

I think this will result in a more nicely-formatted output because it will not have the extra header info from the logging formatter at the start of thercParams list.

jklymak reacted with thumbs up emoji
@jklymak
Copy link
MemberAuthor

I think@anntzer has a PR to log the names of the various files, so I think that takes care of@efiring meta comment.

@anntzer
Copy link
Contributor

it's#9761.

@jklymak
Copy link
MemberAuthor

OK, I think I agree that this is very very verbose, and indeed a more reliable way of asking a user for their rcParams is:

frommatplotlibimportrcParamsprint(rcParams)

So I think I'll close this.

@jklymakjklymak deleted the log-rcparams branchMarch 5, 2019 16:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@efiringefiringefiring requested changes

@tacaswelltacaswelltacaswell approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@jklymak@anntzer@efiring@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp