Open dpsanders opened 9 years ago
Depends on stevengj/PyCall.jl#89
@stevengj, I've looked through the code for nbagg backend. The only thing communicating to kernel is CommSocket class object, which is subtype of ipython's Comm class.
It seems that the similar functionality for the IJulia kernel is realised with Comm type and its methods. The solution I can think of is to create via PyCall NewComm class, which will store reference to IJulia Comm type and transmit python methods to Julia functions, defined for Comm type. Then somehow make the figure manager instantiate this NewComm class instead of CommSocket in this line.
What do you think about it? Is it possible to use PyCall to define Python Class which references Julia structures and uses Julia functions?
Also, I am not really sure how can one modify the behaviour of @pyimported PyClass (which is needed to correct figure manager method).
If I were to modify some method of Class, I would think about doing PyClass[:some_method] = new_julia_func
. Is it possible? Does it have something to do with monkey-patching you mention in stevengj/PyCall.jl#89?
Is it possible to use PyCall to define Python Class which references Julia structures and uses Julia functions?
Yes.
If I were to modify some method of Class, I would think about doing PyClass[:some_method] = new_julia_func. Is it possible?
I think so. Or rather, I think you have to modify the instance and not the class. This is monkey patching.
Is there any hope of someone reviving this? The widget stuff in mpl just keeps getting cooler (https://twitter.com/martinRenou/status/1440617060640247815) and I'd love to be able to use it from Julia.
Starting with version 1.4.3 (I believe) of
matplotlib
, there is annbagg
backend which allows interactive manipulation of figures. EDIT: In IPython, this is available using%matplotlib notebook
Would it be possible to make this available? (At least, I have not worked out how to use it from
IJulia
.)