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

Argparse #46

Open
wants to merge 7 commits into
base: gh-pages
Choose a base branch
from
Open

Argparse #46

wants to merge 7 commits into from

Conversation

pletzer
Copy link

@pletzer pletzer commented Jan 13, 2022

Hi @DamienIrving

This PR replaces argparse by the defopt module. Defopt automates a lot in terms of creating command line arguments. All the user needs to do is to document the code and define interfaces, which is good practice anyway. It's also easier to have default arguments.

I kept the argparse module in some files, we're not completely replacing argparse with defopt, just encouraging the use of defopt.

@DamienIrving
Copy link
Collaborator

Thanks, @pletzer. I wasn't aware of defopt - it looks great.

I think you should definitely go ahead and use defopt for your workshop at ICSHMO (i.e. directing participants to your forked lesson materials at https://pletzer.github.io/python-aos-lesson). I'll need to have a bit of think about whether to switch to defopt for the official PyAOS Data Carpentry lessons. The rationale for using argparse was that unless there's a very widely used alternative, I like to stick with the python standard library. I don't get the sense defopt has separated itself as the clear winner from all the other command line parsers out there, but I could be wrong?

At the very least, one thing I could do is add an information box to the command line programs lesson to tell people that defopt is a good alternative. That's what I've done in the package management lesson with mamba. It's much better than conda but hasn't overtaken it in terms of popularity/usage, so the lesson uses conda but mentions mamba in an information box.

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

Successfully merging this pull request may close these issues.

None yet

2 participants