-
Notifications
You must be signed in to change notification settings - Fork 532
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 doctest #4618
Add doctest #4618
Conversation
'cluster', 'comm', and 'common' modules
Committing my changes to update the base branch and close out this PR
rerun tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look fantastic, took me a bit of time but just had very few minor requests
>>> print(X.compute()) # doctest: +SKIP | ||
[[-1.1273878 1.2844919 -0.32349187 0.1595734 ] | ||
[ 0.80521786 -0.65946865 -0.40753683 0.15538901] | ||
[ 1.0404129 -1.481386 1.4241115 1.2664981 ] | ||
[-0.92821544 -0.6805706 -0.26001272 0.36004275] | ||
[-1.0392245 -1.1977317 0.16345565 -0.21848428] | ||
[ 1.2273135 -0.529214 2.4799604 0.44108105] | ||
[-1.9163864 -0.39505136 -1.9588828 -1.8881643 ] | ||
[-0.9788184 -0.89851004 -0.08339313 0.1130247 ] | ||
[-1.0549078 -0.8993015 -0.11921967 0.04821599] | ||
[-1.8388828 -1.4063598 -0.02838472 -1.0874642 ]] | ||
>>> print(y.compute()) # doctest: +SKIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why these skips? Question applies to all instances in the dask docstrings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly because of numerical imprecision. The output for dask are harder to reproduce so they are skipped more often. I added a few lines to the developer guide regarding this.
rerun tests |
@gpucibot merge |
rerun tests |
Codecov Report
@@ Coverage Diff @@
## branch-22.04 #4618 +/- ##
===============================================
Coverage ? 83.97%
===============================================
Files ? 252
Lines ? 20336
Branches ? 0
===============================================
Hits ? 17078
Misses ? 3258
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
@lowener I think all the sphinx warnings that appear look like: /opt/conda/envs/rapids/lib/python3.9/site-packages/numpydoc/docscrape.py:434: UserWarning: potentially wrong underline length...
Returns
---------- in
KMeans.transform(self, X, convert_dtype=False) -> CumlArray and can be solved by changing this line: to: '\nReturns\n-------\n' |
Continuation of rapidsai#2975 to change docstring to a doctest format. I'm also adding a pytest file to execute doctest, similar to what's being done in [cudf](https://github.com/rapidsai/cudf/blob/branch-22.04/python/cudf/cudf/tests/test_doctests.py) Authors: - Micka (https://github.com/lowener) - Yuqiong Li (https://github.com/yuqli) - Dante Gama Dessavre (https://github.com/dantegd) - Michael Demoret (https://github.com/mdemoret-nv) Approvers: - Dante Gama Dessavre (https://github.com/dantegd) URL: rapidsai#4618
Continuation of #2975 to change docstring to a doctest format.
I'm also adding a pytest file to execute doctest, similar to what's being done in cudf