Skip to content

Documentation error in doc/developers/contributing.rst #13097

Closed

Description

@fferrin

Description

I think there is an error in the example of the class ExampleEstimator in line 879.

In the fit method it says k instead of self.k. If that's the case, I can fix it.

Steps/Code to Reproduce

Doesn't apply.

Expected Results

class ExampleEstimator(BaseEstimator):
    def __init__(self, n_clusters=8, k='not_used'):
        self.n_clusters = n_clusters
        self.k = k

    def fit(self, X, y):
        if self.k != 'not_used':
            warnings.warn("'k' was renamed to n_clusters in version 0.13 and "
                          "will be removed in 0.15.", DeprecationWarning)
            self._n_clusters = self.k
        else:
            self._n_clusters = self.n_clusters

Actual Results

class ExampleEstimator(BaseEstimator):
    def __init__(self, n_clusters=8, k='not_used'):
        self.n_clusters = n_clusters
        self.k = k

    def fit(self, X, y):
        if k != 'not_used':
            warnings.warn("'k' was renamed to n_clusters in version 0.13 and "
                          "will be removed in 0.15.", DeprecationWarning)
            self._n_clusters = k
        else:
            self._n_clusters = self.n_clusters

Versions

Last commit: 18bac2e

Activity

  1. changed the title [-]Documentation error in `contributing.rst`[/-] [+]Documentation error in doc/developers/contributing.rst[/+] on Feb 6, 2019
  2. jnothman commented on Feb 6, 2019

    @jnothman
    Member
  3. fferrin commented on Feb 6, 2019

    @fferrin
    ContributorAuthor
  4. jnothman commented on Feb 6, 2019

    @jnothman
    Member

    I think #13096 is your first PR, but a separate one addressing the contributor docs issue would be welcome!!

  5. bharatr21 commented on Feb 6, 2019

    @bharatr21
    Contributor

    @fferrin May I work on this issue, if you're not working on it already?

  6. fferrin commented on Feb 6, 2019

    @fferrin
    ContributorAuthor

    I answered from my mailbox, so I thought I had answered the other issue. My bad. Effectively # 13096 is my first PR.

    When I read about the steps to document the code I found myself in the documentation of version 0.16 with the use of pyflakes, coverage and pep8, which was very helpful before doing the PR. In the stable version I think you removed it. If in future versions you plan to add it again, just remind that pep8 is going to be changed by pycodestyle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions