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

DOC: Add more examples for np.c_ #8668

Merged
merged 2 commits into from
Feb 22, 2017
Merged

Conversation

flying-sheep
Copy link
Contributor

I mostly use that object to bind 1D arrays as columns, so I added an example for that use case.

@@ -468,6 +468,10 @@ class CClass(AxisConcatenator):

Examples
--------
>>> np.c_[np.array([1,2,3]]), np.array([4,5,6])]
Copy link
Member

Choose a reason for hiding this comment

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

Extra ] here

@eric-wieser
Copy link
Member

Wait, if this passed does that mean we're not running doctests, @charris?

@seberg
Copy link
Member

seberg commented Feb 22, 2017

@eric-wieser yup, we have not been running doc tests for years.

@eric-wieser
Copy link
Member

@seberg: What was the rationale behind their removal? (And the commit/issue that removed them)

Copy link
Contributor Author

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

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

ouch, sorry about that blunder

@eric-wieser
Copy link
Member

Commits need squashing, and the message should start with DOC:

@eric-wieser
Copy link
Member

And while you're there, might be nice to add a See Also section for column_stack

@flying-sheep
Copy link
Contributor Author

flying-sheep commented Feb 22, 2017

sure, i’ll add the section.

can’t you generally just squash from github? (well, until i added the doc change as separate commit, that is)

I mostly use that object to bind 1D arrays as columns, so I added an example for that use case.
@eric-wieser
Copy link
Member

Looks good to me

@eric-wieser
Copy link
Member

Little concerned about the smart quotes in the commit message. @charris - is this an issue?

@charris
Copy link
Member

charris commented Feb 22, 2017

@eric-wieser doctests are hard to maintain, harder to make both python2 and python3 compatible, depend on the details of formatting, which may change, and generally don't make for good tests. That isn't to say they aren't somewhat maintained as examples, but we don't use them for testing purposes.

@eric-wieser
Copy link
Member

harder to make both python2 and python3 compatible,

Perhaps we should just enable them on python3 then?

generally don't make for good tests

They make for good tests for whether the documentation is up to date :)

@charris charris changed the title Added more common example for np.c_ DOC: Add more examples for np.c_ Feb 22, 2017
@charris
Copy link
Member

charris commented Feb 22, 2017

What are the smart quotes?

EDIT: Ah, different beginning and ending quotes. I don't know that the issue has come up before. ASCII is always safe, UTF-8 seems to be the new standard. Things change.

@eric-wieser
Copy link
Member

eric-wieser commented Feb 22, 2017

DOC: Added See Also section for c_

vs

DOC: Added " See Also " section for c_

Just checking that we have tooling that supports non-ascii characters in commit messages (I assume those are utf8-encoded)

@charris
Copy link
Member

charris commented Feb 22, 2017

IIRC, MIcrosoft uses latin-1 or UTF-16, neither of which is compatible with UTF-8, so it is probably best to stick with the "dumb" quotes.

@eric-wieser
Copy link
Member

Apparently git encodes in utf8 automatically, so I think we should be good

@eric-wieser eric-wieser merged commit f24da28 into numpy:master Feb 22, 2017
@flying-sheep flying-sheep deleted the patch-1 branch February 23, 2017 13:21
@flying-sheep
Copy link
Contributor Author

great!

@ev-br
Copy link
Contributor

ev-br commented Feb 26, 2017

Re doctests: numpy might want to reuse https://github.com/scipy/scipy/blob/master/tools/refguide_check.py

@charris charris changed the title DOC: Add more examples for np.c_ DOC: Add more examples for np.c_ May 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants