Automatically changing matplotlib style
Greetings,
I've been happily using PCAFold recently and my only gripe to this point is that the import statements
from PCAfold import preprocess
from PCAfold import reduction
from PCAfold import analysis
change the behavior of matplotlib. In my opinion that is an undesirable side effect. For certain platforms it leads to warnings from matplotlib about not finding certain fonts. It also introduces order-dependence if some other package is also silently changing matlotlib style settings - the last package imported wins but only in conflicting settings. That's a strange thing to see.
I suggest moving matplotlib style settings to their own dedicated sub-package that does not get imported internally in the core packages (above). Setting matplotlib style should require an explicit package import (from PCAfold import matplotlib_style
perhaps).
Another consideration is that usually style settings differ based on the format - papers vs presentations for instance - and it can be helpful to provide a function interface. The way I've done this before follows this pattern that you might consider:
from plotting_helper import set_style
set_style(linewidth=4, include_legend_frame=True, ...) # with loads of default arguments for paper/presentation format
or
from plotting_helper import set_presentation_style, set_journal_article_style
set_presentation_style()
#set_journal_article_style()
Mike