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

M2 docstring #2

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

pckroon
Copy link

@pckroon pckroon commented Mar 2, 2022

I rebased on marrink-lab#407, and adapted the docstring of the martinize2 function so that sphinx accepts it.

pckroon and others added 6 commits March 2, 2022 14:13
Also add some napoleon config. Setting preprocess_types to True
might (have been) a good idea, but will currently cause about 200
warnings, since that will break with e.g. `list[str]`. Instead we'd
need to change it to e.g. `list of str`, and IMHO it results in
less pretty html
Split argument parsing and argument processing in different functions.
Bash command martinize2 is now a function in vermouth.martinize2.
The bash command directly refers to it, so only one function needs
to be modified.

One issue for the lazy or forgetful: arguments and their documentation
now need to be modified two times (in the CLI and the python API).
This should however make martinize2 more easily testable.

Type hints could be added to the martinize2 function.
Plus implement two esthetic suggestions by pckroon.
Adapt the martinize2 docstring so that sphinx/napoleon can work
with it. In essence, wrap lists of options and defaults in
backticks. Remove a lot of defaults from the docstring, since they
are the same as in the signature.

Also remove the parameter subsections. It /is/ possible to add
those to napoleon (napoleon_custom_sections in conf.py), but they're
not as pretty as the normal parameters section, plus, it bloats the
conf.py
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.

2 participants