Skip to content

DOC: Autoreformat all docstrings. #5122

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

Merged
merged 1 commit into from
Apr 7, 2021
Merged

DOC: Autoreformat all docstrings. #5122

merged 1 commit into from
Apr 7, 2021

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Apr 7, 2021

Surprisingly not many changes, most of them are adding leading /* to
args, kwargs which is not clear according to numpydoc but seem like the
thigs to do, plus it's already done in a few other places.

A couple of spaces before :, that semantically matter. Numpydoc
improperly parse the types if there is no space before the :,
a documented parameter that does not exist on the function, and
some casing of section names.

There are a couple errors that this was not able to autofix (like
missing blank line before Returns section leading Numpydoc to
inpterprete "Returns" as a parameter of the function in
xarray/core/dataset.py:roll extra parameters: {'-------', 'rolled', 'Returns'}

  • Closes #xxxx
  • Tests added
  • Passes pre-commit run --all-files
  • User visible changes (including notable bug fixes) are documented in whats-new.rst
  • New functions/methods are listed in api.rst

Surprisingly not many changes, most of them are adding leading */** to
args, kwargs which is not clear according to numpydoc but seem like the
thigs to do, plus it's already done in a few other places.

A couple of spaces before `:`, that semantically matter. Numpydoc
improperly parse the types if there is no space before the :,
a documented parameter that does not exist on the function, and
some casing of section names.

There are a couple errors that this was not able to autofix (like
missing blank line before `Returns` section leading Numpydoc to
inpterprete "Returns" as a parameter of the function in
   xarray/core/dataset.py:roll  extra parameters: {'-------', 'rolled', 'Returns'}
@max-sixty
Copy link
Collaborator

Thanks @Carreau ! Looks good. Cc @keewis .

Is this from a tool? I guess we can't use it as a linter if there are unavoidable errors?

@dcherian
Copy link
Contributor

dcherian commented Apr 7, 2021

Surprisingly not many changes,

Because we're already bug fans of your work! (#4872). Thank you!

I think we're just waiting for it to stabilize before activating the pre-commit hook:

# - repo: https://github.com/Carreau/velin
# rev: 0.0.8
# hooks:
# - id: velin
# args: ["--write", "--compact"]

Copy link
Collaborator

@keewis keewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we're already bug fans of your work!

😄

I agree, this really is useful. Unfortunately it still seems a bit too unstable, and it is missing a few features (I'll try to open issues for those).

Numpydoc improperly parse the types if there is no space before the :

we use napoleon which doesn't have that issue but it's still nice to keep the style consistent

@max-sixty max-sixty merged commit afd231b into pydata:master Apr 7, 2021
@Carreau
Copy link
Contributor Author

Carreau commented Apr 8, 2021

Because we're already bug fans of your work!

Haha indeed.

we use napoleon which doesn't have that issue but it's still nice to keep the style consistent

Yeah, I agree numpydoc could be improved, though at the same time consistent styling is nice. And I'm working on a terminal renderer for IPython that need slightly stricter syntax.

Screen Shot 2021-04-08 at 10 39 29

I agree, this really is useful. Unfortunately it still seems a bit too unstable, and it is missing a few features (I'll try to open issues for those).

Looking forward to it.

@keewis
Copy link
Collaborator

keewis commented Apr 8, 2021

I'm working on a terminal renderer for IPython

that looks cool. Do you have a link for that project?

@Carreau
Copy link
Contributor Author

Carreau commented Apr 9, 2021

that looks cool. Do you have a link for that project?

I just updated the readme a bit and made the repo public. Feedback welcome; though it's in an extremely alpha stage.

https://github.com/Carreau/papyri

Don't trust any of the current documentation/info right now most things are in my head.
There is a currently build step necessary for the documentation; I've done it for xarray 0.17.0, so if you have another version locally it may not work.

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.

4 participants