cgat-developers / ruffus

CGAT-ruffus is a lightweight python module for running computational pipelines
MIT License
173 stars 34 forks source link

Unable to reuse pipeline names #78

Open rulai-huajunzeng opened 8 years ago

rulai-huajunzeng commented 8 years ago

Hi, I have a use case where pipeline names can be reused after the previous pipeline has finished, which is not possible currently. For example, the code below:

p1=Pipeline("my_pipeline")
...
p1.run()
p1=None
p2=Pipeline("my_pipeline")

will generate an error msg: "Error: Duplicate pipeline. A pipeline named 'my_pipeline' already exists." Any suggestion how I can workaround it?

AndreasHeger commented 6 years ago

Ruffus keeps a dictionary of all pipelines that are defined. To delete a pipeline, try:

from ruffus import Pipeline
...
del Pipeline.pipelines["my_pipeline"]