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

Moves __init__ docstrings to class docstrings and removes __init__ from docs, add missing docstrings, and general cleanup #2452

Merged
merged 35 commits into from
Jul 8, 2021

Conversation

angela97lin
Copy link
Contributor

@angela97lin angela97lin commented Jun 28, 2021

Closes #2392

This PR does the following:

  • Moves __init__ docstrings to class docstrings and removes __init__ from docs.
  • Adds docstrings that were missing (mostly estimators + some other classes)
  • Updates docstrings to include default values if missing.
  • Deletes some init methods that were not necessary: some init methods only had a docstring attached or called super()'s; I suspect this had to do with wanting a docstring for the class. Since I'm moving them to the class docstring, we can now delete these! (see data checks + ensemble estimators)

Example of how this change looks on a specific class: https://feature-labs-inc-evalml--2452.com.readthedocs.build/en/2452/generated/evalml.pipelines.components.StackedEnsembleClassifier.html#evalml.pipelines.components.StackedEnsembleClassifier

vs main: https://evalml.alteryx.com/en/stable/generated/evalml.pipelines.components.StackedEnsembleClassifier.html

@angela97lin angela97lin self-assigned this Jun 28, 2021
@codecov
Copy link

codecov bot commented Jun 28, 2021

Codecov Report

Merging #2452 (6c04062) into main (cda2c2e) will decrease coverage by 0.1%.
The diff coverage is 100.0%.

Impacted file tree graph

@@           Coverage Diff           @@
##            main   #2452     +/-   ##
=======================================
- Coverage   99.7%   99.7%   -0.0%     
=======================================
  Files        283     283             
  Lines      25574   25568      -6     
=======================================
- Hits       25472   25466      -6     
  Misses       102     102             
Impacted Files Coverage Δ
evalml/automl/automl_algorithm/automl_algorithm.py 100.0% <ø> (ø)
...lml/automl/automl_algorithm/iterative_algorithm.py 100.0% <ø> (ø)
evalml/automl/automl_search.py 99.4% <ø> (ø)
evalml/automl/engine/dask_engine.py 34.1% <ø> (ø)
evalml/automl/engine/sequential_engine.py 100.0% <ø> (ø)
evalml/data_checks/data_check_message.py 100.0% <ø> (ø)
evalml/data_checks/datetime_nan_data_check.py 100.0% <ø> (ø)
evalml/data_checks/default_data_checks.py 100.0% <ø> (ø)
evalml/data_checks/invalid_targets_data_check.py 100.0% <ø> (ø)
...lml/data_checks/natural_language_nan_data_check.py 100.0% <ø> (ø)
... and 82 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cda2c2e...6c04062. Read the comment docs.

@angela97lin angela97lin changed the title Add docstrings to class page Moves __init__ docstrings to class docstrings and removes __init__ from docs, add missing docstrings, and general cleanup Jul 6, 2021
@@ -266,6 +265,13 @@ class AccessorMethodDocumenter(AccessorLevelDocumenter, MethodDocumenter):
# lower than MethodDocumenter so this is not chosen for normal methods
priority = 0.6

def autodoc_skip_member(app, what, name, obj, skip, options):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hide private methods and attributes

Copy link
Contributor

@freddyaboulton freddyaboulton left a comment

Choose a reason for hiding this comment

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

@angela97lin Thanks for adding all these missing docstrings! I think there are some init docstrings we can delete now but apart from that this LGTM!

evalml/automl/engine/sequential_engine.py Outdated Show resolved Hide resolved
evalml/data_checks/invalid_targets_data_check.py Outdated Show resolved Hide resolved
evalml/data_checks/no_variance_data_check.py Outdated Show resolved Hide resolved
evalml/tuners/skopt_tuner.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bchen1116 bchen1116 left a comment

Choose a reason for hiding this comment

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

Wow, great work getting the docstrings all updated and cleaned up! This is huge, and the docs look real good.

Left a few comments on potential things to clean, but nothing blocking!

evalml/data_checks/no_variance_data_check.py Outdated Show resolved Hide resolved
@@ -5,12 +5,15 @@


class ColumnSelector(Transformer):
def __init__(self, columns=None, random_seed=0, **kwargs):
"""Initalizes an transformer that drops specified columns in input data.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do some lines have the quotes on one line and the description on the next, like the line here, while others are on the same line (like the description for SelectColumns on line 97)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, I don't think there's a difference tbh :d

evalml/tuners/skopt_tuner.py Outdated Show resolved Hide resolved
evalml/tuners/tuner.py Outdated Show resolved Hide resolved
@angela97lin angela97lin merged commit 3bb0ada into main Jul 8, 2021
@angela97lin angela97lin deleted the 2392_init_docstrings branch July 8, 2021 03:28
@chukarsten chukarsten mentioned this pull request Jul 22, 2021
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.

Add __init__ docstrings to main class page
3 participants