Comments (5)
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.
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.
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.
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
Lines 417 to 418 in 262d967
from ipyniivue.
@cdrake This issue is waiting for your input.
from ipyniivue.
Related Issues (20)
- Pythonic Way to implement addVolume HOT 3
- Build does not work on windows
- Testing for examples HOT 3
- MNE source files are not displayed HOT 3
- run_custom_code is painfully slow HOT 5
- add_volume should accept a pathlib Path object as input
- ipyniivue installting correctly but viewer window not showing up
- a
- Graph features
- Add custom colormaps
- devDependency requirement on @jupyterlab/builder@^4.0.0
- load_meshes HOT 1
- Building documentation HOT 8
- Review code of NiiVue Jupyter notebook integration in IPyNiiVue HOT 4
- Restarting the kernel fails to destroy the NiiVue object
- jupyterlab 4 support HOT 4
- ENH: Integration with MNE-Python
- Possible to add overlays and/or possibly saving the whole scene as .html file to harddrive?
- Prototype of ipyniivue using anywidget HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ipyniivue.