-
Notifications
You must be signed in to change notification settings - Fork 150
Add HoloViews based plotting API #129
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
FYI I've changed the base of this PR to master |
Okay, sounds good if you're happy with this living on master already. I should have some time over the weekend to go through this more thoroughly and make sure all the options that are currently exposed are hooked up correctly and make a list of other options that might be nice to expose. |
Codecov Report
@@ Coverage Diff @@
## master #129 +/- ##
==========================================
- Coverage 92.49% 86.56% -5.93%
==========================================
Files 13 14 +1
Lines 1465 1593 +128
==========================================
+ Hits 1355 1379 +24
- Misses 110 214 +104
Continue to review full report at Codecov.
|
Happy to work on some tests over the weekend. |
Things are going well. I'm running into some issues in the Jupyter Notebook when my Stream is on a different IOLoop than the Jupyter Notebook's. This commonly arises whenever we are using a Dask Stream, such as can be created in the following example. |
Looks like it's being passed a |
Ah, I've added a |
@philippjfr checking on your time availability here. Are you available to work on tests here? "No" is a fine answer, I'm just planning things. |
I probably can't devote a lot of time to it, but I should be able to at least write some tests for the core functionality over the weekend. |
OK, I appreciate it. This was a hit at PyData NYC
…On Thu, Nov 30, 2017 at 8:48 AM, Philipp Rudiger ***@***.***> wrote:
I probably can't devote a lot of time to it, but I should be able to at
least write some tests for the core functionality over the weekend.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszHzcMwZOZwrxlRvRQxg7waoUROqoks5s7rIegaJpZM4QqFro>
.
|
I apologize for letting this linger for so long. Thank you @philippjfr for your recent efforts. One last thought is that we should maybe add a small docpage or section to the dataframes page? |
I'm curious if anyone else has time to review this as well. Maybe @CJ-Wright ? |
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.
@@ -0,0 +1,672 @@ | |||
from __future__ import absolute_import |
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.
Top level docs?
That definitely sounds like a good idea, that leaves the question of how to build the page. Since they are streaming plots and empty to begin with it doesn't make much sense to include interactive bokeh plots. Should I record some gifs or just static images to include? I obviously also don't want to bloat the repository too much. |
We don't necessarily even need to have images in the documentation to start
with, just a brief description of how things work and what to expect in
different situations.
…On Thu, Dec 28, 2017 at 11:24 AM, Philipp Rudiger ***@***.***> wrote:
That definitely sounds like a good idea, that leaves the question of how
to build the page. Since they are streaming plots and empty to begin with
it doesn't make much sense to include interactive bokeh plots. Should I
record some gifs or just static images to include? I obviously also don't
want to bloat the repository too much.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszMADjCK5cv_xtrLgYokgbnNRwOVlks5tE-rygaJpZM4QqFro>
.
|
I've added a draft of some fairly detailed documentation, which you can view here. It does include a fair number of images, which take up about 1.8 MB. That would quadruple the size of the repo, so alternatively I could add a script which generates the images. It would complicate the doc building process a bit and take a little bit of time though. Let me know what you'd prefer. |
Personally I'd prefer the doc building option, but I don't know how read the docs will handle that. However, my preference is not particularly strong. |
Looks great to me! I'd also love to see HoloViews+Bokeh support like this in pandas itself as discussed for pandas-dev/pandas#14130 .
Can you add a brief example of doing that? It's not obvious to me where those keyword arguments would go. |
That's a good point, I might be able to do it with the IPython Sphinx Directive. That's what pandas seems to do. |
|
||
The plotting interface on streamz DataFrame and Series objects | ||
attempts to mirror the pandas plotting API, but instead of plotting | ||
with matplotlib_ uses HoloViews_ to generate dynamically streaming |
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.
Do we need an a pronoun? "with matplotlib it uses HoloViews".
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.
Yes, reads better that way.
Sure I'll add an example. |
Sorry I've left this sitting for so long, been completely swamped with other stuff. The one good thing about that is that I've now designed a very similar plotting API for the intake project which is about to be open-sourced (intake/intake#36). The API is a bit more comprehensive and robust so I'll likely be porting some of those ideas back here. I'll try to finish this off after the HoloViews 1.10 release next week. |
Quick update, as I mentioned above I've been working on a similar project as part of intake. Given that this is a common need, I've therefore decided that the plotting API should be in a separate repository (https://github.com/pyviz/hvplot). This has the benefit that the code doesn't get duplicated across a bunch of libraries, stopping the API from diverging and that it will be one shared API with the goal that it can be used by pandas, dask, streamz, xarray and geopandas. |
Sounds sensible to me. What is the right way for streamz to leverage this
approach?
…On Wed, Mar 21, 2018 at 1:09 PM, Philipp Rudiger ***@***.***> wrote:
Quick update, as I mentioned above I've been working on a similar project
as part of intake. Given that this is a common need, I've therefore decided
that the plotting API should be in a separate repository (
https://github.com/pyviz/hvplot). This has the benefit that the code
doesn't get duplicated across a bunch of libraries, stopping the API from
diverging and that it will be one shared API with the goal that it can be
used by pandas, dask, streamz, xarray and geopandas.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszOZ4Yt4zRQJn-rtY_fDXMmjtHG_Jks5tgolegaJpZM4QqFro>
.
|
Probably very similarly to the way it works now, you'd have a |
Is this something that you anticipate having the time to do or is this
something that others here would have to take on? (happy either way, just
curious)
…On Wed, Mar 21, 2018 at 1:29 PM, Philipp Rudiger ***@***.***> wrote:
Probably very similarly to the way it works now, you'd have a .plot
property on the DataFrame/Series objects passing itself to the hvplot
object, which offers the varying plotting methods.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszDpozflDekrIdp_SkDKY2Hxnh7Obks5tgo3qgaJpZM4QqFro>
.
|
Would be happy to do it, basically I'm hoping to get an initial release out and then start shopping the API around with the various projects and help integrate it if desired. I expect to natively support the following datatypes:
Optional but essentially supported for free by HoloViews:
|
Cool. I'm looking forward to this.
…On Wed, Mar 21, 2018 at 1:35 PM, Philipp Rudiger ***@***.***> wrote:
Is this something that you anticipate having the time to do or is this
something that others here would have to take on? (happy either way, just
curious)
Would be happy to do it, basically I'm hoping to get an initial release
out and then start shopping the API around with the various projects and
help integrate it if desired. I expect to natively support the following
datatypes:
- pandas: DataFrame, Series
- streamz: DataFrame(s), Series(s)
- dask: DataFrame, Series, Array
- xarray: Dataset, DataArray
- geopandas: DataFrame
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszA9w_keifl17HliIO6tKiHjP3UJpks5tgo9DgaJpZM4QqFro>
.
|
Would it be possible to support |
Working on that right now, I want to port the material I've written in this PR to the HvPlot site. |
Sorry I wrote the wrong thing, I meant the |
Ah good question, I haven't played around with these much yet but at least in theory I see no reason why we couldn't support them as long as they emit one of the aforementioned data types. |
Do you mean that the |
@philippjfr , should this issue be closed now, with the emergence of "pyviz"? At the very least, I am assuming that any work on the streamz side will now be very different than this PR, so probably best to start over. |
Yes, I'll close. Hoping to have an initial release of holoplot in next week and will open a new PR here. |
"holoplot" - that will do :) I did not see the name change before. |
It's the best we've got for now, not too late to find something better though :-) |
I'll be giving a talk on real-time dask things about a week from now.
Having some ability to do streaming plots would be valuable for that if
that is possible.
…On Tue, Apr 3, 2018 at 2:12 PM, Philipp Rudiger ***@***.***> wrote:
It's the best we've got for now, not too late to find something better
though :-)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#129 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AASszN0oRljWhzbFMGJV13Cxg9tKkGY-ks5tk7uHgaJpZM4QqFro>
.
|
If you're not averse to installing from master you can see how to do it here: https://pyviz.github.io/holoplot/user_guide/Streaming_Plots.html Currently holoplot simply provides a hook to monkey-patch streamz objects with the plot methods. I can probably also get an early conda dev release out by then if needed. |
Is it still structured, that you can call |
Yes, in fact that's precisely how libraries that want to integrate it properly should use it. They'd define a plot property on the data containers like this: @property
def plot(self):
from holoplot import HoloPlot
return HoloPlot(self) |
Adds handling for bar plots on
Series
andSeriess
objects. Also fixesSeriess.plot.line
,Seriess.plot.scatter
andSeriess.plot.area
, ensuring the index is reset and therefore made visible to HoloViews.