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

Add accepted format type to load_seq function #1634

Open
cthwe opened this issue Nov 21, 2023 · 2 comments
Open

Add accepted format type to load_seq function #1634

cthwe opened this issue Nov 21, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@cthwe
Copy link

cthwe commented Nov 21, 2023

Put format type in the help section so people know what's available

@KatherineCaley KatherineCaley added documentation Improvements or additions to documentation good first issue Good for newcomers minor labels Nov 21, 2023
@KatherineCaley
Copy link
Collaborator

add basic usage

@GavinHuttley
Copy link
Collaborator

GavinHuttley commented Dec 1, 2023

The supported file suffixes are the keys to cogent3.parse.sequence.PARSERS. Including these in the docstring is either done by:

  1. manually: which is bad because that can get out-of-date
  2. automagically: requires a decorator that operates like "cogent3.util.misc.extend_docstring_from"

Potentially modify the latter decorator so it can be used like

import textwrap

_known_parsers = textwrap.wrap(", ".join(PARSERS), width=80, break_long_words=False, break_on_hyphens=False)

@extend_docstring_from(replace="KNOWN", with=_known_parsers)
def some_func():
    """my summary line
    
    Notes
    ------
    support suffixes are: KNOWN
    """

which results in

>>> help(some_func)
Help on function some_func in module __main__:

some_func()
    my summary line
    
    Notes
    ------
    support suffixes are: fa, fasta, ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants