Closed cortner closed 8 years ago
To follow up on this: my next step was to turn off numba. (should have thought of that earlier). Ok so far, I can now import chemview
into Julia. The next problem I have is
mv = chemview.MolecularViewer(coordinates, topology=Dict("atom_types" => atomic_types, "bonds" => bonds))
gives
LoadError: PyError (:PyObject_Call) <class 'traitlets.traitlets.TraitError'>
TraitError("The 'kernel' trait of a Comm instance must be a Kernel, but a value of type 'NoneType' (i.e. None) was specified.",)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/chemview-0.6-py2.7.egg/chemview/viewer.py", line 22, in __init__
super(MolecularViewer, self).__init__(width, height)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/chemview-0.6-py2.7.egg/chemview/widget.py", line 71, in __init__
super(RepresentationViewer, self).__init__()
File "/Users/ortner/anaconda/lib/python2.7/site-packages/ipywidgets/widgets/widget.py", line 505, in __init__
super(DOMWidget, self).__init__(*pargs, **kwargs)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/ipywidgets/widgets/widget.py", line 175, in __init__
self.open()
File "/Users/ortner/anaconda/lib/python2.7/site-packages/ipywidgets/widgets/widget.py", line 192, in open
self.comm = Comm(**args)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/ipykernel/comm/comm.py", line 63, in __init__
self.open(data=data, metadata=metadata, buffers=buffers)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/ipykernel/comm/comm.py", line 94, in open
comm_manager = getattr(self.kernel, 'comm_manager', None)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/traitlets/traitlets.py", line 529, in __get__
return self.get(obj, cls)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/traitlets/traitlets.py", line 508, in get
value = self._validate(obj, dynamic_default())
File "/Users/ortner/anaconda/lib/python2.7/site-packages/traitlets/traitlets.py", line 564, in _validate
value = self.validate(obj, value)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/traitlets/traitlets.py", line 1589, in validate
self.error(obj, value)
File "/Users/ortner/anaconda/lib/python2.7/site-packages/traitlets/traitlets.py", line 1436, in error
raise TraitError(e)
I'm afraid I am lost what this actually means?
Hi! First of all, really nice job putting this together!
It looks like ipywidgets is having some problems communicating with the kernel. Does using ipywidgets works at all?
You could try an example of those... http://ipywidgets.readthedocs.io/en/latest/examples/Widget%20Basics.html
If you're using latest version of ipywidgets, you should try the branch new-widget of the chemview repository.
Yes - ipywidgets
creates the same error message, or the following code to be precise:
using PyCall
@pyimport ipywidgets
ipywidgets.IntSlider()
I'll try to follow up on your suggestions. I really appreciate the help!
I found that Interact.jl uses ipywidgets
, but looking through their code I don't see at all how. I'll keep trying but I fear this may be beyond my skill-set (and available time).
You need to figure out how to make ipywidgets work in Julia first.
I'm trying to talk to the Interact.jl people. It may turn out impossible.
The only example in Julia that I know uses ipywidgets
is Interact.jl
and according to its author "Interact.jl doesn't directly deal with ipywidgets, instead it only sends messages to jupyter according to its widgets protocol".
It looks like it would not be a straightforward modification for chemview
to make it work in Julia, so I'll unfortunately have to drop this idea for now. Maybe I'll come back to this at a later time. Thank you for the help anyways.
I work mostly from Julia and I'd love to use chemview for visualising within an IJulia notebook. I appreciate that you may not be interested in fixing anything related to this, but I am hoping you can give me some pointers.
I use Julia 0.5 and Anaconda. To import python packages I use
PyCall
. When I first tried, evennumba
import failed, but eventually I builtllvmlite
from source, pointing to the LLVM 3.7.1 library that comes included with Julia. I can now successfully@pyimport numba
.But when I try
@pyimport chemview
I get the following error message (in the Julia REPL; from the notebook I don't get anything useful at all): (sorry for the very long output)