-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
Conversation
numpy/lib/index_tricks.py
Outdated
@@ -468,6 +468,10 @@ class CClass(AxisConcatenator): | |||
|
|||
Examples | |||
-------- | |||
>>> np.c_[np.array([1,2,3]]), np.array([4,5,6])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra ]
here
Wait, if this passed does that mean we're not running doctests, @charris? |
@eric-wieser yup, we have not been running doc tests for years. |
@seberg: What was the rationale behind their removal? (And the commit/issue that removed them) |
There was a problem hiding this 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
Commits need squashing, and the message should start with |
And while you're there, might be nice to add a |
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.
4b16d83
to
5e725ac
Compare
Looks good to me |
Little concerned about the smart quotes in the commit message. @charris - is this an issue? |
@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. |
Perhaps we should just enable them on python3 then?
They make for good tests for whether the documentation is up to date :) |
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. |
vs
Just checking that we have tooling that supports non-ascii characters in commit messages (I assume those are utf8-encoded) |
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. |
Apparently git encodes in utf8 automatically, so I think we should be good |
great! |
Re doctests: numpy might want to reuse https://github.com/scipy/scipy/blob/master/tools/refguide_check.py |
np.c_
I mostly use that object to bind 1D arrays as columns, so I added an example for that use case.