-
Notifications
You must be signed in to change notification settings - Fork 7
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
load_meshes does not add the mesh to self.meshes in MacOS and Linux #38
Comments
Actually, I had not paid attention to the comment |
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. |
I think I have been able to further narrow down the issue. Running 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... |
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
|
@cdrake This issue is waiting for your input. |
As can be seen from https://github.com/niivue/ipyniivue/actions/runs/5906991594/job/16024117873?pr=37, Windows CI works fine but not MacOS and Linux. The problem seems to be due to that part of the notebook
tractography.ipynb
Apparently, in these two OS, the call to
nv.load_meshes
fails to add the mesh tonv.meshes
so the indexing of that list at[0]
fails. Looking under the hood a bit, what seems to fail isnv._send_custom(['loadMeshes', [mesh_list]])
which just seems to use thesend
method inherited from theipywidgets
DOMWidget
class to send the command to NiiVue... so could the problem be on the NiiVue/JS side? @cdrake or @AnthonyAndroulakis , do you mind having a peak at it?The text was updated successfully, but these errors were encountered: