Skip to content
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

py.examples do not work in conda installed ipyvolume and install from source does not work #36

Closed
cvisl opened this issue Jul 31, 2017 · 8 comments

Comments

@cvisl
Copy link
Contributor

cvisl commented Jul 31, 2017

I tried to get ipyvolume running on my system but I only get several parts to work when I install ipyvolume via anaconda install and the other methods don't work at all.
For the anaconda version it installed perfectly and the volume examples work but when I try the klein_bottle example it says that examples don't exist:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-3c58397b310f> in <module>()
      1 import ipyvolume.pylab as p3
----> 2 x, y, z, u, v = p3.examples.klein_bottle(draw=False)
      3 p3.figure()
      4 m = p3.plot_mesh(x, y, z, wireframe=False)
      5 p3.squarelim()

AttributeError: module 'ipyvolume.pylab' has no attribute 'examples'

And when I try to install ipyvolume through pip or through installing it with the source code I get the following errors in the chrome developer tools:


menubar.js:303 actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later...
MenuBar.bind_events @ menubar.js:303
utils.js:60 load_extensions Arguments(1)
(unknown) loading custom/custom
session.js:54 Session: kernel_created (5ca191a9-935c-47df-b316-099b571db1e2)
kernel.js:459 Starting WebSockets: ws://localhost:8888/api/kernels/ef365974-354e-46b8-8a19-77496eb1cf44
(unknown) loading nbextensions/ipyvolume/extension
utils.js:37 Loading extension: ipyvolume/extension
(unknown) loading codemirror/mode/javascript/javascript
:8888/nbextensions/widgets/notebook/js/extension.js?v=20170731141024 Failed to load resource: the server responded with a status of 404 (Not Found)
main.js:223 Widgets are not available.  Please install widgetsnbextension or ipywidgets 4.0
(anonymous) @ main.js:223
(unknown) loading nbextensions/ipyvolume/index
kernel.js:103 Kernel: kernel_connected (ef365974-354e-46b8-8a19-77496eb1cf44)
kernel.js:103 Kernel: kernel_ready (ef365974-354e-46b8-8a19-77496eb1cf44)
VM93:3 loading nbextensions/ipyvolume/index
utils.js:910 Could not open comm  --  Error: Class jupyter.widget not found in registry 
    at utils.js:874
    at new Promise (<anonymous>)
    at Object.load_class (utils.js:859)
    at CommManager.comm_open (comm.js:84)
    at i (jquery.min.js:4)
    at Kernel._handle_iopub_message (kernel.js:1223)
    at Kernel._finish_ws_message (kernel.js:1015)
    at kernel.js:1006
    at <anonymous>
(anonymous) @ utils.js:910
kernel.js:1007 Couldn't process kernel message WrappedError

@chrisjsewell
Copy link
Contributor

So, given the error message, I guess the first question to ask is; have you (pip) installed ipywidgets >= 4.0

@maartenbreddels
Copy link
Collaborator

Hi Casper,

the conda forge version is 0.3.x, pip has the 0.4.x alpha release, which you can install using the --pre argument. Make sure you install ipywidgets 7:

$ pip install ipywidgets~=7.0.0b1

should work (b3 might also work, but I didn't test it yet)
Hope this is useful, please let me know if there can be something improved for the installation instructions. I have to update setup.py to avoid this.

cheers,

Maarten

@cvisl
Copy link
Contributor Author

cvisl commented Aug 4, 2017

@chrisjsewell Yes I have ipywidgets installed:

(hemosphere) casperl@surfsara-nghk:~$ pip list | grep ipywidgets
ipywidgets (7.0.0b2)

But ok, I found out what I did wrong I only used the github installation instructions which miss the activation of the ipywidgets nbextension given in the documentation page of ipyvolume

I wanna run it from the source code cause I am trying to figure out how to plot a mesh and how the mesh is formatted within ipyvolume so I can plot my own meshes. I see that as an input in the example you have 3, 40x40, np arrays? How does that for example relate to a set of vertices and a set triangles defined by the vertices, which is normally used to draw meshes? In the code their is no/sparse documentations and comments to figure out how it works.

Sorry for all the questions that might be obvious but wanna try it out with my own geometry and test the limits of ipyvolume when it comes to high poly simulation data.

But besides the questions the issue can be closed, cause the initial problems are solved.

Cheers,
Casper

@maartenbreddels
Copy link
Collaborator

Hi Casper,

I've updated the installation instructions.
Yes, there is no documentation yet on meshes, there should be once 0.4 will be released. For now, you could take a look at https://github.com/maartenbreddels/ipyvolume/blob/8445780cb9cb44c84be974cc8804c55e775bfde0/docs/source/mesh.ipynb .
Take a look at plot_mesh, and plot_trisurf, where the first assumes a regular grid, and the last a series of triangles. Hope to have more proper documentation soon, and feedback is always welcome!

cheers,

Maarten

@maartenbreddels
Copy link
Collaborator

maartenbreddels commented Aug 4, 2017

The documentation is a bit better now at:
http://ipyvolume.readthedocs.io/en/latest/mesh.html
API docs still needs some work (will keep this open until)

@cvisl
Copy link
Contributor Author

cvisl commented Aug 7, 2017

Hey Maarten,
Thanks for pointing me to the trisurf function that is indeed what I need. Now I am gonna stress test ipyvolume and see if it can take high poly simulations ;).

Was wandering though, why do you pass the x, y and z coords for the vertices separately? Not that it really matters but was wandering what the idea behind it was, cause it caused my initial confusion on how the mesh was formatted.

Thanks again, I think all of this looks very valuable for me. Besides that I have not thought about customized widgets within Jupyter notebook which for me is an eye opener for a lot of other problems I have.

@maartenbreddels
Copy link
Collaborator

I think i'm gonna change that, for performance it's better to have the vertices in a single array. The idea was that you can do:

scatter.x = x * 2 +1

for instance. But this behaviour can be emulated using properties.
Let me know what you think of the performance!

@maartenbreddels
Copy link
Collaborator

Since you've got it working, I'll close this, I'm happy to hear performance issues separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants