Skip to content
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

Collect "opinionated" modules in a dedicated subpackage #130

Open
4 tasks
pnkraemer opened this issue Jan 10, 2024 · 0 comments
Open
4 tasks

Collect "opinionated" modules in a dedicated subpackage #130

pnkraemer opened this issue Jan 10, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@pnkraemer
Copy link
Owner

What

Tueplots centres around the content of figsizes.py, fonts.py, fontsizes.py, and bundles.py.

Other modules, namely axes.py, cycler.py, and markers.py, provide easy access to some plot-style changes that are otherwise a bit more involved to update. For example, axes.lines() changes all linewidths to a consistent base_width via rcParams. This functionality is helpful but somewhat opinionated.

Why

I would like to collect modules with such (potentially) opinionated content in a dedicated subpackage, e.g., tueplots.style.*, to distinguish them from the core content: figure sizes, font sizes, and so on.
This would simplify the API a little bit:

  • Make it easier to find the "important" content in the online docs
  • Add a new template by adding a function to all of the (then) top-level modules
  • Guarantee that the top-level content does not contain any opinionated configurations
  • We could split the tutorial notebooks into tutorials for the central content and tutorials for using the style (name undecided) subpackage

How

The current API looks like

import matplotlib.pyplot as plt
from tueplots import bundles, axes

plt.rcParams.update(bundles.icml2022())
plt.rcParams.update(axes.lines(base_width=0.75))

The new API would look like

import matplotlib.pyplot as plt 
from tueplots import bundles
from tueplots.style import axes

plt.rcParams.update(bundles.icml2022())
plt.rcParams.update(axes.lines(base_width=0.75))

To be decided

  • Is this change useful? (I think yes, but I would love to hear what people think)
  • What should the name of the subpackage be? (Currently, I think style is decent but there might be a more suitable one, maybe something like tueplots.opinion)
  • Do we use a deprecation policy or just go ahead with it?
  • Do we bump the patch version afterwards, or do we go to v0.1.0 (which should happen soon anyway in my opinion)

Everyone's feedback is welcome!

@pnkraemer pnkraemer added enhancement New feature or request help wanted Extra attention is needed labels Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant