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

Add pretty Jupyter repr of Projections #1196

Merged
merged 4 commits into from
Nov 16, 2018
Merged

Conversation

pelson
Copy link
Member

@pelson pelson commented Nov 16, 2018

Rationale

Replacement of #951 based on review feedback.
Adds a pretty Jupyter repr for Projection instances:

screenshot 2018-11-16 at 04 35 04

cc: @dkillick

@pelson pelson added this to the 0.17 milestone Nov 16, 2018
@pelson pelson changed the title Repr html Add pretty Jupyter repr of Projections Nov 16, 2018
@QuLogic
Copy link
Member

QuLogic commented Nov 16, 2018

So I don't know why you need _repr_html_ if you're now returning None when you can't make the SVG.

@pelson
Copy link
Member Author

pelson commented Nov 16, 2018

I'm not producing just an SVG, I actually want an SVG+repr(projection).

@QuLogic
Copy link
Member

QuLogic commented Nov 16, 2018

There is a downside there that this probably only helps the notebook. I would guess (but don't know for sure) that other viewers like qtconsole might not support HTML (but do support say, PNG).

But also note that every one implemented gets called since the viewers are independent of the kernel, so implementing all of them could be a bit heavy.

@pelson
Copy link
Member Author

pelson commented Nov 16, 2018

There is a downside there that this probably only helps the notebook. I would guess (but don't know for sure) that other viewers like qtconsole might not support HTML (but do support say, PNG).

That is entirely believable. It had crossed my mind to try inserting the repr(projection) inside the SVG body, but I decided that I didn't have enough hours in the day 🤣

@pelson
Copy link
Member Author

pelson commented Nov 16, 2018

@QuLogic - For the sake of tidying up, I suggest we merge this if you are happy with it. @dopplershift can add further feedback after the fact.

@QuLogic QuLogic merged commit 6d095db into SciTools:master Nov 16, 2018
@pelson pelson deleted the repr_html branch November 16, 2018 07:09
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.

3 participants