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

Numpy docstring for fixed set of values #212

Closed
pawamoy opened this issue Sep 28, 2023 · 0 comments
Closed

Numpy docstring for fixed set of values #212

pawamoy opened this issue Sep 28, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@pawamoy
Copy link
Member

pawamoy commented Sep 28, 2023

Discussed in mkdocstrings/mkdocstrings#617

Originally posted by blaylockbk September 26, 2023
I apologize if this isn't the right place to post this (I'm just starting with mkdocstrings and am loving it! It's much easier than sphinx. Thank you).

The numpy docstring style guide says1

When a parameter can only assume one of a fixed set of values, those values can be listed in braces, with the default appearing first:

order : {'C', 'F', 'A'}
   Description of `order`. 

So, when I document this...

Parameters
----------
order : {'C', 'F', 'A'}
    Description of `order`.
something_else : list
    Description of `something_else`.
a : int
    Description of `a`
b : str
    Description of `b`

...I expected mkdocstring to render the options for "order" in the "Type" column, but they are not rendered.

image

If I break away from the numpy style, I can get a list, but I'd rather follow the official numpy style.
image

Is this a bug in mkdocstring?

Footnotes

  1. https://numpydoc.readthedocs.io/en/latest/format.html#parameters

@pawamoy pawamoy transferred this issue from mkdocstrings/mkdocstrings Sep 28, 2023
@pawamoy pawamoy added the bug Something isn't working label Sep 28, 2023
pawamoy added a commit that referenced this issue Sep 28, 2023
@pawamoy pawamoy closed this as completed Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant