Proposal & discussion to use other distribution model
Inspired by this repo, distribution of styles could be done by exposing the style files with pkg_resources (see this file).
New use workflow would be including a SciencePlots package, and then type plt.style.use(styles) as usual. See README on linked repo.
New styles would be located on the package folder, instead of .matplotlib/stylelib. This means that for users that already have SciencePlots already installed there will be duplicates of the styles. If they don't include the package via include SciencePlots, they access the 'legacy' ones; once included, after some testing, plt.style.use will first read .matplotlib/stylelib styles, then overwrite the rcParams with the styles located in the package folder. So updating styles after this change is not a problem unless rcParams are deleted from newer styles. An uninstall option could be included to clear legacy styles.
New styles could be uninstalled normally via pip.
Upsides:
- Styles are stored in the package folder, allowing uninstall and preventing conflicts with other styles present in the system (in case someone decided to name their styles like SciencePlots ones and then install this package)
- Likely fixes #61 - I'm not sure because I haven't found a plot styles repo in them like the linked one Less important:
- Requires including, so lookup of projects that use this library publicly is easier
- We can store SP styles in subfolders, with a bit of hacking into the
__init__.py, so all is shipped with the current tree structure
Downsides:
- Remaining old styles in the
.matplotlib/stylelibfolder or creating a uninstall script to delete them - Changing docs
I'm willing to try to apply this changes, if you are happy with it.