-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fixed most See Also
docstring formatting, quietened the last warnings coming from doctests
#3932
Fixed most See Also
docstring formatting, quietened the last warnings coming from doctests
#3932
Conversation
…st-all" (and they now pass with no warnings/errors)
Codecov Report
@@ Coverage Diff @@
## master #3932 +/- ##
==========================================
+ Coverage 62.42% 62.45% +0.02%
==========================================
Files 447 447
Lines 73773 73773
==========================================
+ Hits 46054 46075 +21
+ Misses 27719 27698 -21
Continue to review full report at Codecov.
|
Can we have an empty newline after |
Odd; looked like a formatting inconsistency. Which interpreter/env are you using? I see no issue here with/without a newline (in PyCharm, with/without ipython, using either There is currently no real consistency in the codebase as to whether or not docstring subsections have a newline beneath the "---", so if there's a reason to choose one format over the other it's probably worth standardising. |
I agree it is a good custom to end with a new line. I have requested people to do this with the examples as well. If I could I would check this in CI so that we can enforce that. |
They end with a newline - this is about adding a newline after (all?) the section underscores: Usual:
With extra newlines:
Is there a particular advantage to the latter? (I've not seen this style of docstring spaced-out like that before, so wondering if it's an editor-specific thing). I have no strong opinion either way, and am generally in favour of standardising. |
Right, sorry, I misunderstood. Let's take numpydoc as guideline then: https://numpydoc.readthedocs.io/en/latest/example.html They don't have it, so let us not do that as well. |
|
At least if the docstring formatting is consistent in all samples. |
I suspect a suitable regex can normalise everything - I'll take a look. |
Is it good to go @alexander-beedie ? |
@ritchie46: Yup, good to go; there weren't actually that many newlines to normalise in the end - think I got most (all?) of them. Can do a second-pass If anyone spots something else that would benefit from standardising. |
The formatting for most of the
See Also
subsections in docstrings was a bit off, so they weren't being rendered properly on the Sphinx Polars API website. This should fix them. Will be worth adding some more of these links/refs later.Also, found the last two or three
doctests
warnings and took care of them - everything there passes cleanly.As they now run clean, I added
doctests
to the recently introducedmake test-all
option in the py-polars Makefile; this is not currently run automatically anywhere, it's manual/opt-in (as it runs bothtests
andparametric_tests
), but as I have been bitten a couple of times by doctests not passing on commit, it will help prevent a few of those before they hit GitHub... ;)Reduced the default scale of parametric tests to speed them up a touch.