8000 rcsetup cleanups. by anntzer · Pull Request #15894 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

rcsetup cleanups. #15894

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
Dec 31, 2019
Merged

rcsetup cleanups. #15894

merged 1 commit into from
Dec 31, 2019

Conversation

anntzer
Copy link
Contributor
@anntzer anntzer commented Dec 10, 2019
  • Deprecate passing text.latex.unicode/pgf.preamble as None, "None", or
    a list of strings -- it's really just a plain string.
  • In validators that take "lists", disable passing sets/frozensets,
    which are unordered, but not dicts, which have deterministic iteration
    order now -- making the code consistent with the comment immediately
    above.
  • Correctly set __name__ and __qualname__ on some more validators,
    which helps e.g. troubleshooting test failures.

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

@anntzer anntzer force-pushed the 2rc branch 2 times, most recently from 84b8b13 to c97f510 Compare December 10, 2019 09:52
Copy link
Member
@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Not 100% sure if deprecation of lists as preamble is necessary. Linebreaks matter in LaTeX. And it might(?) be more difficult if the preamble is all in one line.

@anntzer
Copy link
Contributor Author
anntzer commented Dec 23, 2019

Linebreaks matter in LaTeX.

Do they really?

And it might(?) be more difficult if the preamble is all in one line.

You can always pass a multiline (triple quoted) string.

@anntzer anntzer force-pushed the 2rc branch 2 times, most recently from 16d3cef to 4ea3c91 Compare December 23, 2019 18:11
@timhoffm
Copy link
Member

Linebreaks matter in LaTeX.

Do they really?

Well, whitespace matters (sometimes). A \n could be replaced by a space. So it's not too critical.

@anntzer
Copy link
Contributor Author
anntzer commented Dec 24, 2019

Note that this is also only supposed to be a TeX preamble, where the importance of whitespace is even less... (not nonexistent, but again, you can always pass in a multiline string if you really want).

@jklymak
Copy link
Member
jklymak commented Dec 30, 2019

Not really sure I understand why you are deprecating a list of strings. Is there some advantage?

@anntzer
Copy link
Contributor Author
anntzer commented Dec 30, 2019

In the syntax of rcsetup files (which is not particularly great, but whatever, it's what we have right now), "string lists" would mean "comma-separated strings", e.g. foo, bar, baz would mean ["foo", "bar", "baz"] (e.g., for the font.* or keymap.* entries -- also, "int list" is comma-separated, etc.)... except that tex preambles cannot split on commas, because they legitimately need commas as normal characters (\usepackage[option,option]{package}), so they use their own validator. So it's not really a string list to start with, but rather a single string.

- Deprecate passing text.latex.unicode/pgf.preamble as None, "None", or
  a list of strings -- it's really just a plain string.
- In validators that take "lists", disable passing sets/frozensets,
  which are unordered, but not dicts, which have deterministic iteration
  order now -- making the code consistent with the comment immediately
  above.
- Correctly set `__name__` and `__qualname__` on some more validators,
  which helps e.g. troubleshooting test failures.
@timhoffm timhoffm added this to the v3.3.0 milestone Dec 31, 2019
@timhoffm timhoffm merged commit d42b36d into matplotlib:master Dec 31, 2019
@anntzer anntzer deleted the 2rc branch December 31, 2019 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0