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

MAINT: adds copydoc decorator #277

Merged
merged 2 commits into from Aug 7, 2015

Conversation

@llllllllll
Copy link
Member

commented Aug 7, 2015

we have this pattern a lot which prevents us from using decorators as we would normally use them. I also ran into this issue with blaze where I couldn't mutate the __doc__ of an unbound method in python 2. If this change looks good, I will refactor blaze to use this too.

@cpcloud

This comment has been minimized.

Copy link
Member

commented Aug 7, 2015

this looks good, can you just confirm locally that you can see the docstring as desired?

@cpcloud

This comment has been minimized.

Copy link
Member

commented Aug 7, 2015

also pls add a blurb in whatsnew

@cpcloud cpcloud added this to the 0.3.4 milestone Aug 7, 2015

@llllllllll

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2015

What section should I put this in?

@llllllllll

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2015

Looks like it is getting copied correctly

In [10]: print(URL.__doc__)
 Parent class for data accessed through ``URLs``

    Parameters
    ----------

    url : str
        full url to file
    chunk_size : int (default 1024)
        Size of chunks streamed into memory
    decode_unicode : bool (default False)
        If True, content will be decoded using the best available
        encoding based on the response.

     Examples
    --------

    >>> from odo import URL, CSV
    >>> u = URL(CSV)('http://foo.com/myfile.csv')

    Normally create through resource uris

    >>> data = resource('http://foo.com/myfile.csv')
    >>> data.url
    'http://foo.com/myfile.csv'
    >>> data.filename
    'myfile.csv'
@cpcloud

This comment has been minimized.

Copy link
Member

commented Aug 7, 2015

What section should I put this in?

Could make a new Miscellaneous section

@llllllllll llllllllll force-pushed the quantopian:copydoc branch from 090b4c7 to ccbeeaa Aug 7, 2015

Miscellaneous
-------------

* Adds ``~odo.utils.copydoc`` function to copy docstrings from one object onto

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

i think this needs to be :func:~odo.utils.copydoc``

-------------

* Adds ``~odo.utils.copydoc`` function to copy docstrings from one object onto
another. This helps with the pattern of explicitly setting the __doc__

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

the __doc__s need double backticks surrounding them

@llllllllll llllllllll force-pushed the quantopian:copydoc branch from ccbeeaa to 4725c9b Aug 7, 2015

Miscellaneous
-------------

* Adds :func:``~odo.utils.copydoc`` function to copy docstrings from one object

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

i don't think double ticks will compile

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

sorry for the churn btw

This comment has been minimized.

Copy link
@llllllllll

llllllllll Aug 7, 2015

Author Member

I don't mind putting in the extra work for better docs. How do I build the docs locally to test the changes?

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

you need sphinx, then just cd docs && make clean && make html

This comment has been minimized.

Copy link
@cpcloud

cpcloud Aug 7, 2015

Member

then open build/html/index.html in your browser of choice

@llllllllll llllllllll force-pushed the quantopian:copydoc branch from 4725c9b to 5de11fd Aug 7, 2015

@cpcloud

This comment has been minimized.

Copy link
Member

commented Aug 7, 2015

LGTM

llllllllll added a commit that referenced this pull request Aug 7, 2015

Merge pull request #277 from quantopian/copydoc
MAINT: adds copydoc decorator

@llllllllll llllllllll merged commit 7d8419d into blaze:master Aug 7, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@llllllllll llllllllll deleted the quantopian:copydoc branch Aug 7, 2015

@llllllllll

This comment has been minimized.

Copy link
Member Author

commented Aug 7, 2015

I will open a PR soon on blaze that uses this new feature. That should fix that issue that we needed to revert with Node.map

@cpcloud

This comment has been minimized.

Copy link
Member

commented Aug 7, 2015

awesome thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.