by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 16:26
    kmuehlbauer commented #1568
  • Jan 31 2019 16:15
    kmuehlbauer commented #1568
  • Jan 31 2019 15:53
    djhoese commented #1568
  • Jan 31 2019 15:46
    kmuehlbauer edited #1568
  • Jan 31 2019 15:44
    kmuehlbauer opened #1568
  • Jan 31 2019 15:32
    djhoese commented #1566
  • Jan 31 2019 15:30
    djhoese commented #1567
  • Jan 31 2019 14:18
    GuillaumeFavelier commented #1561
  • Jan 31 2019 14:15
    GuillaumeFavelier commented #1561
  • Jan 31 2019 12:46
    opekar synchronize #1130
  • Jan 31 2019 09:54
    kmuehlbauer commented #1567
  • Jan 31 2019 09:53
    kmuehlbauer synchronize #1567
  • Jan 31 2019 09:37
    kmuehlbauer labeled #1567
  • Jan 31 2019 09:37
    kmuehlbauer labeled #1567
  • Jan 31 2019 09:37
    kmuehlbauer labeled #1563
  • Jan 31 2019 09:36
    kmuehlbauer labeled #1563
  • Jan 31 2019 09:28
    kmuehlbauer commented #1567
  • Jan 31 2019 09:27
    kmuehlbauer synchronize #1567
  • Jan 31 2019 09:19
    kmuehlbauer assigned #1563
  • Jan 31 2019 09:17
    kmuehlbauer opened #1567
Kai Mühlbauer
@kmuehlbauer
Good, regarding the vispy jupyter extension, @djhoese might know something.
chriskuku
@chriskuku

I got to this point so far:

Christophs-MBP:vispy kuku$ jupyter nbextension enable vispy --py --sys-prefix
Enabling notebook extension vispy/extension...
      - Validating: problems found:
        - require?  X vispy/extension
Christophs-MBP:vispy kuku$

Is there some vispy test I can run in jupyter notebook for verification?

David Hoese
@djhoese
@chriskuku There are some example notebooks in the examples directory in the repository with very simple cases. I think the --no-use-pep517 has been removed in recent versions of pip (@kmuehlbauer may know more), we'll have to update the instructions with this new version. Otherwise, the _jupyter_nbextension_paths() error is unexpected but jupyter widgets do evolve pretty quickly so it's possible we're missing something from recent updates.
@chriskuku Do you need to use the jupyter notebook extension. Maybe jupyter lab would have been luck (a couple sections below the notebook installation instructions)
chriskuku
@chriskuku
@djhoese Thanks, David. As a casual user I hadn't yet taken a look at jupyterlab but will do so now.
chriskuku
@chriskuku

I ran the commands from the installation section:

conda install -c conda-forge nodejs  # or some other way to have a recent node
jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install vispy

and got:

grafik.png
My vispy directory is a git clone
chriskuku
@chriskuku
Got around it by removing this vispy directory.
chriskuku
@chriskuku

If I run the rotating cube example in the examples/ipynb/RotatingCube.ipynb, nothing happens.

I also ran >>>vispy.test()
that gave a couple of errors, although most of all the 179 examples ran through. I could post the log here if it is of any interest. I have it still in the paste buffer and could drop it in here :)

chriskuku
@chriskuku
FWIW, the rotating "cube" - shows up in the brwoser window when run in a jupyter notebook. But it doesn't show up in a jupyterlab browser window.
David Hoese
@djhoese
@chriskuku well that's odd (the last bit about it showing in the notebook after a failed installation but not in the jupyterlab window)
and about the jupyterlab installation, the documentation mentions using vispy@latest if you are running from a directory with a vispy directory in it. So your workaround makes sense
Regardless, I consider the jupyter stuff experimental. Running vispy.test() if very likely to not work because there are some low-level GL features that aren't supported for that backend right now.
if it shows in the notebook then that must mean it was actually installed correctly
chriskuku
@chriskuku
OK. Thanks so far. Yes, I saw this vispy@latest, when it was already too late :) ALl the best until next time here.
Michael Lingelbach
@mjlbach
Hi! I'm having some trouble getting the jupyter lab extension running: I've followed the instructions (including installing the lab extension with and without @latest) and get Error displaying widget: model not found. I realize it's experimental, but it looks like other people around here have gotten it working.
Everything seems to be fine in jupyter notebook
Michael Lingelbach
@mjlbach
Seems like if I don't manually enable the magic function %load_ext vispy it gets stuck on Loading Widget...
locT15
@locT15
Hi. I am new to Vispy. I would like to create a canvas with an infinite line on it such that whenever I press and move the cursor, the infinite line moves along.

import numpy as np

from vispy import app, scene

class EditLineVisual(scene.visuals.InfiniteLine):
def init(self, args, **kwargs):
scene.visuals.InfiniteLine.init(self,
args, **kwargs)
self.unfreeze()
self.is_selected = False
self.last_position = np.inf
self.freeze()

def on_draw(self, event):
    scene.visuals.InfiniteLineLine.draw(self)

def on_mouse_press(self, pos_scene):
    if(abs(pos_scene[0] - self.last_position) >= 1):
        self.set_data(pos = round(pos_scene[0]), color=self.color)
        self.is_selected = True
        self.last_position = round(pos_scene[0])

def on_mouse_release(self, event):
    print("release")
    self.is_selected = False

def on_mouse_move(self, pos_scene):
    if(self.is_selected == True and abs(pos_scene[0] - self.last_position) >= 1):
        self.set_data(pos = round(pos_scene[0]), color=self.color)
        self.last_position = round(pos_scene[0])
        print(round(pos_scene[0]))

class Canvas(scene.SceneCanvas):
""" A simple test canvas for testing the EditLineVisual """

def __init__(self):
    scene.SceneCanvas.__init__(self, keys='interactive',
                               size=(800, 800))

    self.unfreeze()


    self.view = self.central_widget.add_view()
    self.view.camera = scene.PanZoomCamera(rect=(-100, -100, 200, 200),
                                           aspect=1.0)
    self.view.camera._viewbox.events.mouse_move.disconnect(
        self.view.camera.viewbox_mouse_event)

    self.line = EditLineVisual(pos=5.0, color=[1.0, 1.0, 0.5, 0.5], vertical=True, parent = self.view.scene)

    self.show()
    self.selected_point = None
    self.freeze()

def on_mouse_press(self, event):
    tr = self.scene.node_transform(self.line)
    pos = tr.map(event.pos)
    self.line.on_mouse_press(pos)

def on_mouse_move(self, event):
    tr = self.scene.node_transform(self.line)
    pos = tr.map(event.pos)
    self.line.on_mouse_move(pos)

def on_mouse_release(self, event):
    self.line.on_mouse_release(event)

if name == 'main':
win = Canvas()
app.run()

my code problem is that the infinite line does not move when I move the cursor.
David Hoese
@djhoese
@mjlbach sorry, I just saw your message. Must have missed the gitter notification email. Have you had any better luck with things?
@locT15 It seems your combining code from multiple examples. You have a SceneCanvas and are setting the camera but you also have defined on_mouse_move and on_mouse_press. Normally you would let the camera handle these events and do what it needs to do. I would recommend commenting out your on_mouse_X methods and see what happens.
Philip Winston
@pwinston

Are there any projects using vispy with huge 2D images (say 100's of GB) where you can pan/zoom around like on google maps?

We use vispy for https://github.com/napari/napari and we have a synchronous version for "multiscale images". On disk the images are in Zarr format, or any similar type of chunked storage.

It's decent but it will hitch/pause as tiles load. We are looking at doing an asynch version. So always 60Hz and tiles load in the background. Has anyone done anything like this on top of vispy? Thanks.

We just want to be aware of any similar projects so we can coordinate or compare notes.
David Hoese
@djhoese
@pwinston That is exactly the use case that got me involved in vispy and now I maintain it :D
one sec...
not sure we have a lot of screenshots/videos though to show how the tiling works
and the code is a real mess
also note, this is not 100s of GB at a time
but it loads satellite imagery data using the Satpy library (another project I work on), stores them as flat binary files, then loads individual tiles into the GPU
Michael Lingelbach
@mjlbach
@djhoese no worries! Know you are busy and I appreciate the response :) Still only can get the renderer working on jupyter notebook (not lab)
I'm using with notebook for now, but wondering if this is isolated to just me or if I should open an issue. I don't know much about the inner workings of jupyter extensions but I can try to look into this as well
David Hoese
@djhoese
if you check the chat just before your message there was a conversation on this exact issue. It is possible that the vispy extension no longer works with newer versions of jupyter lab/notebooks so it may need some updating. Or maybe if we're lucky only the installation steps need to change. Regardless, the vispy jupyter extensions are considered experimental so I would not plan on using them for any long term work (my personal opinion)...that is unless you plan on trying to optimize things :wink:
Michael Lingelbach
@mjlbach
Yeah, I thought he may have gotten it working based on his last message (re: installing with vispy@latest) and just wanted to make sure I wasn't missing anything :)
But happy to take a look! Jupyterlab updates seem to break a lot of the visualization libraries regularly
David Hoese
@djhoese
:wink:
You're telling me. I was the one who took the original maintainer's implementation of the "ipython notebook" widget and made it work for modern jupyter notebooks and lab. That was...fun
pmendoncaphysics
@pmendoncaphysics
I'm new to VisPy and I am able to run the spectrogram example via Anaconda 3 prompt. I would like to use it in Spyder IDE (python 3.7.4, PyQt5, Windows 10) but get errors. Any one tried running it on Spyder?
Michael Lingelbach
@mjlbach
Screenshot from 2020-05-23 11-23-51.png
@djhoese I was trying to fix the jupyter lab extension, and I found several packages that had similar issues (edited the semver in lib/webgl-backend.js and vispy/app/backends/ipython/_widget.py). What's weird is that the numbers match; I checked PRs resolving similar issues in other libraries (mostly people were not exporting the model/view version number) but it loks like you're already doing that in _widget.py
The other main issue I saw people having was that they weren't appropriately defining the version range for jupyter-widgets, but you're already allowing 1.X/2.X/3.X
Michael Lingelbach
@mjlbach
Ahhh fixed it
Michael Lingelbach
@mjlbach
David Hoese
@djhoese
Thanks @mjlbach! I'll take a look later today

@pmendoncaphysics Hard to say without knowing what the errors were :wink:

Usually though in spyder you'll have to explicitly say what backend you want to use. Otherwise, vispy's default will mistakenly think it is running in a notebook and use the webgl backend when it shouldn't.

Emily Cheng
@wingemilyyan
Hi! How to embed the vispy scene canvas into a web page. Thanks.
iPsych
@iPsych
@djhose, Based on your script in vispy/vispy#1250, I got the 4 columns data from canvas via "self.view.canvas.render()", but it's binary, (only 255, 127). The shape is proper, so, maybe something wrong between projection? transportation to canvas? The depth vector of transported vertices are -1 to 1 so, seems normal.