Skip to content

add assign_attrs method #1286

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 3 commits into from
Mar 7, 2017
Merged

add assign_attrs method #1286

merged 3 commits into from
Mar 7, 2017

Conversation

hsharrison
Copy link
Contributor

  • closes update_attrs method #1281
  • tests added / passed
  • passes git diff upstream/master | flake8 --diff (except for whatsnew... wasn't sure there)
  • whatsnew entry

Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

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

Can you please add links to doc/api.rst? Otherwise this looks good to go to me.

@@ -346,6 +346,28 @@ def assign_coords(self, **kwargs):
data.coords.update(results)
return data

def assign_attrs(self, *args, **kwargs):
"""Assign new attrs to this object, returning a new object equivalent
Copy link
Member

Choose a reason for hiding this comment

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

Can you move the second half of this to a new line? We try to keep the title to one line.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm sorry, I don't follow. I tried to match the conventions of the rest of the file. Do you mean this:

def assign_attrs(self, *args, **kwargs):
    """
    Assign new attrs to this object, returning a new object equivalent
    to...

or

def assign_attrs(self, *args, **kwargs):
    """Assign new attrs to this object.

    Returns a new object equivalent to...

Copy link
Member

Choose a reason for hiding this comment

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

The second version is preferred. But you're right that assign_coords also has a docstring that violates this.

Copy link
Member

Choose a reason for hiding this comment

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

If you like, it would be awesome to clean that up, too.

@shoyer shoyer merged commit 1cad803 into pydata:master Mar 7, 2017
@shoyer
Copy link
Member

shoyer commented Mar 7, 2017

Awesome, thank you!

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.

update_attrs method
2 participants