-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
DOC: Fix code that generates the table in the 'Casting Rules' section. #14558
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
Conversation
d6764b3
to
c9d5334
Compare
c9d5334
to
387fe19
Compare
Seems like a small enough fix, I am good if you just put it in when you feel you are done @WarrenWeckesser. The unicode characters are a nice touch. Hmmm, we have a script flying around somewhere that prints similar tables, but I am too stupid to find it right now. |
387fe19
to
9ccd5bf
Compare
... for col in ntypes: | ||
... print int(np.can_cast(row, col)), | ||
>>> print_table(np.typecodes['All']) |
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.
Sorry, did this line vanish completely? I had missed that.
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.
Oops, fixed. I'll stop force-pushing until everything looks right.
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.
I honestly do not care for this small change. Lets juts get it done :).
905cfc9
to
e4bc314
Compare
Hmmm... looks like shippable took off early for the weekend. |
OK, nvm shippable. Let me put this in, the snippet runs fine for me. |
@seberg wrote
Just happened to find it: print_coercion_tables.py |
thanks! I've seen the output of that messing up failed tests recently, but I couldn't locate the source of it |
Argh, apparently those Unicode checkmarks aren't drawn with the correct fixed-width when rendered on the web site (at least not with Firefox): https://numpy.org/devdocs/reference/ufuncs.html#casting-rules If anyone sees a way to get the checkmarks to render correctly, let me know. Otherwise, I'll change the checkmark to, say, the letter |
Hmmm, that is annoying, it works fine for me. My guess is that your font is missing the character, so that it switches over to another one for it? But if that is not just an outlier, we need to replace. |
As far as I can tell (a few minutes of searching makes me an expert, right?), there isn't such a thing as a monospace font for all Unicode. Further investigation doesn't seem worthwhile at the moment. I submitted a pull request to change the checkmark to |
The old code was Python 2 only.