Coder Social home page Coder Social logo

Comments (9)

nmwsharp avatar nmwsharp commented on August 17, 2024 1

Ok. I just pushed some updates that address this in C++ and Python (Python version 0.1.5, already on pip and percolating to conda soon). Now, clicking the close button will actually close the window, so the OS doesn't angry and users get clear visual feedback.

It's still true that when you call polyscope.show(), the function blocks and does not return until you close the GUI. Changing this would require a fundamental architectural change. However, hopefully with GUI closing like a normal window it will be more clear to users.

I also confirmed that Polyscope is usable in Jupyter notebooks in its current form, at least when the kernel is running locally.

I'm closing this as fixed. However, if you still have lingering issues/crashes related to this feel free to reopen.

from polyscope.

mhogg avatar mhogg commented on August 17, 2024 1

I realize this issue is closed, but just wanted to add that v0.1.6 fixes the issue I had on Windows 10 where Polyscope crashed the Jupyter notebook kernel when its window was closed.

Thanks!

from polyscope.

nmwsharp avatar nmwsharp commented on August 17, 2024

Hi, thanks for checking out the library and the report!

I've haven't seen this issue on my end, but I'll try to reproduce it. Did you install via pip or conda? Any chance you could collect a stack trace for the crash? (don't actually know how best to get a stack trace on Windows).

I think soon I'll push a new minor version which adds a runtime options to include some debugging checks, which will help us get to the bottom of these issues more quickly.

from polyscope.

mhogg avatar mhogg commented on August 17, 2024

I installed via pip, but into a conda environment (python 3.7). I may try to uninstall the pip version and use conda instead.

I am not sure how to get a stack trace from within jupyter, but I am happy to help test your new minor release on windows and report back.

from polyscope.

akshayka avatar akshayka commented on August 17, 2024

I just discovered polyscope, and it's really awesome. Great work @nmwsharp!

Unfortunately, I'm running into the same problem that @mhogg hit. When invoking polyscope from a Python shell (or IPython shell, or Jupyter notebook), attempting to close the polyscope GUI (by hitting the 'x' button) crashes the Python process. Specifically, the GUI freezes, I'm forced to force quit it, and Python is killed.

I'm using Ubuntu 20.10, Python 3.8.6.

Here's a minimum-working example.

Python 3.8.6 (default, Sep 25 2020, 09:36:53) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import polyscope as ps
>>> import numpy as np
>>> 
>>> try:
...         ps.init()
... except:
...         pass
... 
[polyscope] Backend: openGL3_glfw -- Loaded openGL version: 3.3.0 NVIDIA 450.80.02
>>> # generate some points
>>> points = np.random.rand(100, 3)
>>> 
>>> # visualize!
>>> ps_cloud = ps.register_point_cloud("my points", points)
>>> ps.show()
>>> Killed

Any idea what might be happening? I'm building a library that relies heavily on visualizing point clouds, and I'd love to be able to recommend polyscope to my users. The only thing stopping me is this particular issue.

Thanks again for your awesome work!

from polyscope.

nmwsharp avatar nmwsharp commented on August 17, 2024

Ah, thank you for raising this again. I looked in to it before but could not find a solution and eventually got distracted.

I'm not an experienced IPython/Jupyter programmer myself, but I certainly why this is an issue! I will look in to it again and see if I can find some fix or workaround.

I'm a little surprised to hear that this also arises from a plain old Python shell in Ubuntu, since I use Polyscope there fairly often. Note that the current behavior of Polyscope is that the show() function blocks while the GUI is interactive. Then once you close the window the show() function returns and the prompt becomes usable again, and the GUI window sits there unresponsive until you call show() the next time.

Is this what you are seeing? Or is it really that the prompt and GUI window are both simultaneously unresponsive after closing the window? I realize that this behavior is potentially confusing; if this is what's happening perhaps we just need to communicate it more clearly to the user.

from polyscope.

akshayka avatar akshayka commented on August 17, 2024

Thanks for the quick response!

Note that the current behavior of Polyscope is that the show() function blocks while the GUI is interactive. Then once you close the window the show() function returns and the prompt becomes usable again, and the GUI window sits there unresponsive until you call show() the next time.

You're totally right. This is in fact what is happening. The GUI does become unresponsive, and control is returned to the Python/IPython shell.

I guess this is a bit confusing because after a few seconds, a dialog box opens up asking whether I'd like to force quit the GUI.

image

It's the force quit that causes Python to crash. So I suppose the solution is simply to choose "wait" instead.

I realize that this behavior is potentially confusing; if this is what's happening perhaps we just need to communicate it more clearly to the user.

Yes, I think that might be helpful. At least, you'd have fewer people opening issues about this behavior :)

from polyscope.

nmwsharp avatar nmwsharp commented on August 17, 2024

Yes, totally agree.

I will see if I can change this behavior in the python bindings, or at least make it more intuitive.

(due to the death of TravisCI, my workflow for deploying Python versions is broken 😢 this may delay the rollout of an updated version while I sort that out on Github Actions or something)

from polyscope.

nmwsharp avatar nmwsharp commented on August 17, 2024

Glad to hear it! Please reach out again if you encounter other issues.

from polyscope.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.