argparse2tool icon indicating copy to clipboard operation
argparse2tool copied to clipboard

subparser parents

Open bernt-matthias opened this issue 7 years ago • 6 comments

one more request on this way .. the tool I want to wrap uses the parent feature of subparser, i.e. it defines subparsers that are reused in many other subbarsers.

check for the "parent" argument (in combination with add_help=False) here :

checkm.py.txt

I guess macros would be a great way to do this.

for now I will do this manually

bernt-matthias avatar May 29 '18 07:05 bernt-matthias

Wow you were not kidding about a lot of argparse options. Oh my word.

Thanks for the example. I see that it's under GPL3, would you mind if I included it into the examples/ folder in this repository as an example of the complexity it can support?

hexylena avatar May 29 '18 08:05 hexylena

Sure, I took it from bioconda checkm-genome=1.0.11 (most recent version in https://github.com/Ecogenomics/CheckM/blob/master/bin/checkm) and adapted it to include only the argparse stuff (and replaced some imports by the actual code).

bernt-matthias avatar May 29 '18 08:05 bernt-matthias

Perfect, thanks!

hexylena avatar May 29 '18 08:05 hexylena

since I just stumbled across this again, still no time for development work, but

I guess macros would be a great way to do this.

I've often considered how nice it would be if I could find a good AST parser (or three), and then identify large common subsets (using the same code structure/same XML structure even if different parameter names) across N xml files and automatically rewrite it into a macro. But that's almost a masters-time/level project and hard to fit that in.

edit; @bgruening just in case you have any masters students who need another project? But I guess this isn't a very 'fun' or attractive project.

hexylena avatar Sep 06 '18 15:09 hexylena

I now "solved" this in a shell script generating the macros. Made small progress here: https://github.com/bernt-matthias/mb-galaxy-tools/tree/master/tools/checkm

bernt-matthias avatar Sep 06 '18 15:09 bernt-matthias

I've often considered how nice it would be if I could find a good AST parser (or three), and then identify large common subsets (using the same code structure/same XML structure even if different parameter names) across N xml files and automatically rewrite it into a macro. But that's almost a masters-time/level project and hard to fit that in.

Great idea! I would like to see this as a planemo feature I think. It should be useful to a lot of tools. A master student for planemo development would be great!

bgruening avatar Sep 06 '18 16:09 bgruening