On Jun 4, 2016, at 5:48 AM, Peter Wang <pwang@continuum.io> wrote:
On Fri, Jun 3, 2016 at 11:17 PM, Bryan Van de Ven <bryan@bokeh.org> wrote:
I can't say we have any plans, tho if you wanted to submit a PR it could be discussed. However, I don't think it would be entirely trivial. In order to support automated docs generation and boilerplate reduction, the glyph functions are actually derived programmatically, e.g. here:
https://github.com/bokeh/bokeh/blob/master/bokeh/plotting/figure.py#L52
And the issue is that this type of capability would only be appropriate for a subset of the glyph methods, not all of them, which means modifying the automation machinery in a way that makes it works on the subset of glyphs that it makes sense for. It would probably involve adding some kind of static class metadata to the Glyph classes that woudl support this optimization, and then having _glyph_function inspect for that.
I agree that doing it this way would be non-trivial. But, I like this idea of having other constructor classmethods, possibly decorated in some way to indicate how they match arguments. So, in spirit, similar to the MultipleDispatch library, but matching based on the number (and perhaps, the shape) of positional args, rather than their types. And you would want to generically handle positional vs keyword arguments.
The real challenge will be the logic involved shape transformation, e.g. "unzipping" lists of 2-tuples into two lists of scalars. This seems like a very common and useful capability to have in the library, but it doesn't fit with how things are implemented. (This also gets into things like, lists of dicts, and transposing that into a ColumnDataSource...)
-Peter
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CABGrp%2B9oxffdQF3T6HaYfvaSYAcetweE%2BSRi7hf%3DZg0vdAu_DQ%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.