Refactor and restructure plotting module
I think it's time for some refactoring and restructuring of the plotting capabilities of dantro.
Currently, the plot functions are tucked away in a subsubmodule, dantro.plot_creators.ext_funcs
, which is not only very nested but also somewhat obscure.
Furthermore, the name and scope of ExternalPlotCreator
seems no longer suitable, as we have specialised it quite a bit to work with matplotlib. For my taste, it does too much at the same time and becomes hard to handle ...
Proposal
- Make a light-weight plot creator that does what
ExternalPlotCreator
initially sought to do (tracked in #301 (closed))- Load a plot function or module file and carry out the plot function
- Suggested capabilities:
- Should have optional DAG support
- Should not make any assumptions about the plotting framework
- Subsequently, we can drop all the
style
andhelper
andanimation
features, which assume matplotlib
- Subsequently, we can drop all the
- Rename the
ExternalPlotCreator
toPyPlotCreator
- ... and drop support for all features that the new, light-weight
ExternalPlotCreator
takes care of
- ... and drop support for all features that the new, light-weight
- Elaborate whether the
ParamSpace
-based plot creators could actually be made independent from the currentExternalPlotCreator
- Ideally, we would implement them as mixins, such that the other plot creators can also make use of these features. I think we are at a point where that becomes feasible ...
- Remove the unused
pcr_vega
andpcr_decl
modules - Move plot functions into
dantro.plot_funcs
and sort them more consistently:- The
generic
module no longer seems like a helpful qualifier, because almost all plot functions are in there - Plot functions can and should have their separate modules
- I think we don't need to single out
facet_grid
ormultiplot
, they too can have their own modules
- The
Edited by Yunus Sevinchan