Skip to content

Minor refactoring of docstring formatting in preprocess_data #10191

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

Merged
merged 1 commit into from
Jan 8, 2018

Conversation

timhoffm
Copy link
Member

@timhoffm timhoffm commented Jan 7, 2018

PR Summary

This is just a minor refactoring of the _preprocess_data decorator when I looked into #10189.
It extracts the docstring manipulation to a dedicated function. The functionality itself is unchanged so far. But it will help for working on #10189 further whatever will be decided there.

@tacaswell tacaswell added this to the v2.2 milestone Jan 7, 2018
@@ -1545,6 +1545,41 @@ def _replacer(data, key):
"""


def _add_data_doc(docstring, replace_names, replace_all_args):
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't these be keyword arguments if they're optional? (ie. docstring, replace_names=None, replace_all_args=False)

Copy link
Member Author

@timhoffm timhoffm Jan 8, 2018

Choose a reason for hiding this comment

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

No. This is just a private helper function which does not need the flexibility of keyword args. In particular, I do not want to duplicate the defaults of _preprocess_data.

The docstring was just a copy from _preprocess_data. I've now removed the optional, and default notes.

@timhoffm timhoffm force-pushed the preprocess-data-refactoring branch from 1358ce9 to 4eb99b4 Compare January 8, 2018 20:16
@dstansby dstansby merged commit fa0a4da into matplotlib:master Jan 8, 2018
@timhoffm timhoffm deleted the preprocess-data-refactoring branch January 8, 2018 22:08
@QuLogic QuLogic modified the milestones: needs sorting, v2.2.0 Feb 12, 2018
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.

4 participants