Giter VIP home page Giter VIP logo

Comments (5)

christian-oreilly avatar christian-oreilly commented on July 18, 2024

Actually, I had not paid attention to the comment The following is in a separate cell because we have to wait for the typescript end of the widget to update .meshes variable in the python end. which is useful here. On my Mac, the load_meshes just seems not to return (at least not within a few minutes)...

from ipyniivue.

christian-oreilly avatar christian-oreilly commented on July 18, 2024

I guess this is linked to #33 although I find it strange that it would run on Windows, and not on Mac and Linux. If it is, it points out to another deeper issue: that called functions can crash silently, leaving the kernel waiting forever for a response.

from ipyniivue.

christian-oreilly avatar christian-oreilly commented on July 18, 2024

I think I have been able to further narrow down the issue. Running notebooks/examples/tractography.ipynb in a jupyter notebook, if I hit "run all cells" it crashes the same way as with CI. If I run cells one at a time, it works. The issue with "run all cells" can be fixed by changing the notebook like this:

timeout = 10
start = time()
i = 1
with ui_events() as poll:
    while True:
        poll(1)
        if len(nv.meshes):
            break
        if time() > start + timeout:
            raise TimeoutError

nv.set_mesh_property(nv.meshes[0].id, "colormap", "blue")
nv.set_clip_plane([-0.1, 270, 0])

This allows the notebook to run its events while the cell is waiting for the mesh to be loaded. I'll fix the notebook like this for now so that the CI works, but I think it would require some more fundamental changes to ipyniivue to abstract away this complexity from the end user. I am not sure I have a clear and general solution for now...

from ipyniivue.

christian-oreilly avatar christian-oreilly commented on July 18, 2024

Well, it looks like this change solved one issue but did not solve the issue initially reported in this ticket: the CI still works in Windows but fails for the other OS. The code timeout (after 60s) in these OS, indicating that the meshes are never added to the list of meshes available. AFAIK, the addition of meshes is made by the callback associated with updateMeshes

elif event_data[0] == 'updateMeshes':
self.meshes = [NVMesh(m) for m in json.loads(event_data[1])]
... maybe this event never gets sent (for some reason) in these OS?

from ipyniivue.

christian-oreilly avatar christian-oreilly commented on July 18, 2024

@cdrake This issue is waiting for your input.

from ipyniivue.

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.