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

Refactor argument parsers to avoid duplication #55

Merged
merged 5 commits into from
Jun 18, 2024
Merged

Conversation

dennisbrookner
Copy link
Member

The arguments for the three matchmaps utilities are largely overlapping (and for matchmaps and matchmaps.mr, identical!!) but they all existed separately in the code base. This made adding or changing arguments time-intensive and error-prone. Inspired by careless, I have refactored things extensively. In this PR, I:

  • add a file _args.py which declares the description for each function, a dictionary of base/mr args, a dictionary of ncs args, and a dictionary of common args
  • add a file _parsers.py which imports the above from _args.py and declares an argparse.ArgumentParser object for each utility
  • delete the parse_arguments() function from each utility script, and instead just import the relevant parser from _parsers.py
  • change cli.md to point towards the new locations of the parsers

@dennisbrookner dennisbrookner merged commit 4256ad9 into main Jun 18, 2024
4 checks passed
@dennisbrookner dennisbrookner deleted the refactor-args branch June 18, 2024 18:25
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.

1 participant