-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 GeoJSON display class #10253
Add GeoJSON display class #10253
Conversation
Oops, I approved twice. It must be really good, since I also approved of it in the JupyterLab extension. 😉 |
I tested locally and it's working: from IPython.display import GeoJSON
GeoJSON({
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [-118.4563712, 34.0163116]
},
"properties": {
"name": "Clover Park"
}
}) |
Do we have tests for the HTML or other display functions that we could use here as well to make sure this gets covered? |
Good call. There is a |
Great!
…Sent from my iPhone
On Feb 7, 2017, at 10:19 AM, Grant Nestor ***@***.***> wrote:
Good call. There is a test_json that I could use for reference: https://github.com/ipython/ipython/blob/master/IPython/core/tests/test_display.py#L137-L164
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
We might want to add that in the what's new. We can refine in subsequent PR. |
@Carreau Can you clarify?
I'm happy to do this. I assume a new release section will be added to version5.rst? |
I'm so looking forward to the next IPython release now that we have updating displays and GeoJSON built-in. 🦅 |
Yes! Going to be really nice, fun to see ipython moving along!
…On Tue, Feb 7, 2017 at 11:17 AM, Kyle Kelley ***@***.***> wrote:
I'm so looking forward to the next IPython release now that we have
updating displays and GeoJSON built-in. 🦅
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0HTJ7jUp-HkZPdWUxSYNkbsfr8L6ks5raMM7gaJpZM4L51yg>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com
|
@rgbkrk So I haven't been able to get display updates to work in notebook or lab. It's implemented in both, isn't it? I'm running them and ipython from master... |
Should be in notebook, we certainly merged it. Has to be master of ipython, ipykernel, and notebook. |
We haven't implemented it yet in lab:
jupyterlab/jupyterlab#1227
…On Tue, Feb 7, 2017 at 12:15 PM, Kyle Kelley ***@***.***> wrote:
Should be in notebook, we certainly merged it. Has to be master of
ipython, ipykernel, and notebook.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0Fm13MzbqlB1WZjMh8DRTx2Hp4voks5raNDXgaJpZM4L51yg>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com
|
Basically any update to the display mechanism need update to IPython itself that can take a year or so to get released. It would be better to provide a mechanism for other packages to provide this. In Python that would be entry-points. Then you can "just" update/publish an ipython-geosjon, ipython-vegalite, ipython-mp3 , ipython-pdf , ipython-midi ... and have IPython auto discover these. Then in case of updates needed, a new release of IPython is not necessary. |
On Tue, Feb 7, 2017 at 1:09 PM, Matthias Bussonnier < ***@***.***> wrote:
@Carreau <https://github.com/Carreau> Can you clarify?
Basically any update to the display mechanism need update to IPython
itself that can take a year or so to get released. It would be better to
provide a mechanism for other packages to provide this. In Python that
would be entry-points.
I don't understand what would take a year. The GeoJSON class isn't an
update to the display protocol. It is just a new class that a bunch of us
are needing/using across different frontends. We already have common
display classes for JSON, HTML, Image, etc. - this is yet another one of
those. We are putting the more specialized ones (Vega, Plotly) in their
respective libraries (altair, plotly, etc.).
Then you can "just" update/publish an ipython-geosjon, ipython-vegalite,
ipython-mp3 , ipython-pdf , ipython-midi ... and have IPython auto discover
these.
Ahh, OK I think I am understanding. This would allow third party developers
to put things under the IPython.display namespace, while shipping things
separately. Is this entry point already in place?
For things like Vega/Plotly that (the entry point) makes sense, but for the
GeoJSON case 1) it is a very common standard and 2) there isn't a python
package for us to put it in - it is literally just that class. Grant, Kyle
and I thought that putting it directly into IPython made the most sense.
Then in case of updates needed, a new release of IPython is not necessary.
Got it!
… —
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0HZaGawmAkRZBDSJlAy6O4dAxAgmks5raN11gaJpZM4L51yg>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com
|
One other reason is that this is targeted as IPython 6.0, so only Python 3 users will have access to it. |
Hmmm...good point. Overall, I don't mind if we have nice things in 6.0 that
aren't going to be available for users in python2. That is the carrot part
of moving people to python 3...
So maybe in this case I am ok with that.
…On Tue, Feb 7, 2017 at 2:13 PM, Matthias Bussonnier < ***@***.***> wrote:
One other reason is that this is targeted as IPython 6.0, so only Python 3
users will have access to it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10253 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABr0C-0t-Hytcxs6LoT-urAMGcBcXksks5raOxwgaJpZM4L51yg>
.
--
Brian E. Granger
Associate Professor of Physics and Data Science
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
bgranger@calpoly.edu and ellisonbg@gmail.com
|
I agree but, as someone have to play devil advocate this will put some extra weight on implementers of libraries if they want to be Py2 and Py3. And to disagree with myself, anyway if py2/py3 is not a lot more complicated than checking IPython version, so I'm unsure it really matters. |
A long time ago I remember voting in favor of Python3 only for the server, it's been annoying that we're not doing ipykernel and ipython fixes across 2 and 3. However, I haven't been putting maintainership cycles into ipython (except for some small things), so I feel I don't have much sway on this. |
To come back around to the GeoJSON display class, currently the tile layer options are hard-coded in the renderer but perhaps they should be configurable from the GeoJSON class? E.g. GeoJSON(data, tileUrlTemplate, tileLayerOptions) |
To add on, we're thinking |
@ellisonbg Are you aware of a way to access the |
Follow up from discussion with @ellisonbg jupyter/jupyterlab_geojson#18 (comment)