Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subparser parents #60

Open
bernt-matthias opened this issue May 29, 2018 · 6 comments
Open

subparser parents #60

bernt-matthias opened this issue May 29, 2018 · 6 comments

Comments

@bernt-matthias
Copy link
Collaborator

bernt-matthias commented May 29, 2018

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

@hexylena
Copy link
Owner

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?

@bernt-matthias
Copy link
Collaborator Author

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).

@hexylena
Copy link
Owner

Perfect, thanks!

@hexylena
Copy link
Owner

hexylena commented Sep 6, 2018

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.

@bernt-matthias
Copy link
Collaborator Author

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

@bgruening
Copy link
Collaborator

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants