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

consider adding/testing simple way to create an args object for use with sourmash.commands etc. #2684

Closed
ctb opened this issue Jul 24, 2023 · 1 comment · Fixed by #2691
Closed

Comments

@ctb
Copy link
Contributor

ctb commented Jul 24, 2023

ref #2521
and #245

@ctb
Copy link
Contributor Author

ctb commented Jul 25, 2023

code!

import sourmash
args = sourmash.cli.get_parser().parse_args(['plot', 'cmp'])

import sourmash.commands
sourmash.commands.plot(args)

so I guess the only simplification would be to provide a shorter version of sourmash.cli.get_parser().parse_args(...).

luizirber pushed a commit that referenced this issue Aug 12, 2023
Fixes #2684

This PR adds a function that creates an `args` object for a particular
sourmash command - so that you can do something like this:
```python
import sourmash.commands, sourmash.cli

# create args object:
args = sourmash.cli.parse_args(['plot', 'cmp'])

# run 'sourmash plot'
sourmash.commands.plot(args)
```

For convenience, this PR also makes all of the `sourmash sig` functions
available in Python via `sourmash.sig.<fn>`.
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 a pull request may close this issue.

1 participant