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
[DOC] added usage examples to multiple estimator docstrings #6187
Conversation
Thanks, that's a lot of examples! Code formatting is failing, probably an oversight. Just in case, here's the guide on setting it up locally: |
Updated Example according to standards (Code quality checked with |
still failing - there's one line that goes over the character limit (see logs) |
I had overlooked on one example, |
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.
Thanks for your contribution. I think you missed few section headers in docstrings, which leads to build failures in Read the Docs. Can you please fix these?
Example header added |
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.
Thanks for adding the example headers.
- Please revert argument type change for
estimator
. - Please use consistent example style for all examples, e.g. indentation, line length, etc. You can explore blacken-docs locally if it seems useful to you.
|
||
Examples | ||
-------- | ||
>>> from sktime.classification.deep_learning.inceptiontime import InceptionTimeClassifier # doctest: +SKIP # noqa |
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.
What is this noqa
for? Is it for line length? Please fix by splitting into multiple lines instead of adding noqa.
Also, I think doctest need not be skipped in this line, but it's okay to have as well.
>>> clf = ShapeDTW(n_neighbors=1, | ||
... subsequence_length=30, | ||
... shape_descriptor_function="raw", | ||
... shape_descriptor_functions=None, | ||
... metric_params=None | ||
... ) # 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.
It'll be good to add indentation after ...
, otherwise it looks bad in the hosted docs (and inconsistent with other examples).
@@ -188,7 +203,7 @@ class labels (multi-output problem). | |||
|
|||
def __init__( | |||
self, | |||
estimator=None, | |||
estimator, |
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.
I am not sure if this is acceptable in a example addition PR. Plus it's potentially a breaking change as it now wants makes estimator a positional argument from a keyword argument. In fact this is what causes the test failure in CI
FYI @fkiraly
requested changes done |
I'm not able to understand why tests are failing? |
sktime/classification/distance_based/_time_series_neighbors_pyts.py
Outdated
Show resolved
Hide resolved
sktime/classification/distance_based/_time_series_neighbors_tslearn.py
Outdated
Show resolved
Hide resolved
sktime/classification/feature_based/_random_interval_classifier.py
Outdated
Show resolved
Hide resolved
sktime/classification/feature_based/_random_interval_classifier.py
Outdated
Show resolved
Hide resolved
sktime/classification/distance_based/_time_series_neighbors_tslearn.py
Outdated
Show resolved
Hide resolved
changes done |
You need to add a doctest skip to those estimators that rely on soft dependencies, so the doctest is not executed, see |
Adding usage example to estimator In PR #6187 I had added multiple usage example, but due to some reason I'm not able to understand where test failing. so on this Pr I will added usage example one by one
Example added in Docstring of Estimators belongs classification task