databio / pypiper

Python toolkit for building restartable pipelines
http://pypiper.databio.org
BSD 2-Clause "Simplified" License
45 stars 9 forks source link

Idea: "describe" a pipeline #217

Open vreuter opened 5 months ago

vreuter commented 5 months ago

For a pipeline that uses Stages, what about adding a .describe() method? If given no arguments, it could operate on all the pipeline's stages. Or it could take the name of a specific stage, and then just describe that one. I could image the description coming from one of a couple places...

Even for a pipeline that doesn't use stages, .describe() could give a version of the __doc__ attribute on the Pipeline class, or a .describe() value if the pipeline defines such a classmethod as a member of the class.

I could image this being used interactively in a REPL or as part of a script, or even a command-line program could use this, like pypiper describe /path/to/my/pipeline.py, where the pipeline.py file would be inspected for any classes that inherit from pypiper.Pipeline

Admittedly thinking out loud here and a more detailed specification of what behaviors / use patterns we would or would not want to support would be needed, but WDYT overall of this idea @nsheff @donaldcampbelljr @khoroshevskyi @nleroy917 (tagging you all as those most currently involved in development, perhaps) ?