pnkraemer/tueplots

Collect "opinionated" modules in a dedicated subpackage

pnkraemer opened this issue · 0 comments

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!