neopyter icon indicating copy to clipboard operation
neopyter copied to clipboard

Cell Synchronization

Open singledoggy opened this issue 1 year ago • 1 comments

Hi,

I've encountered an issue with the neopyter plugin that seems to be related to its cell synchronization mechanism. It appears that the plugin only synchronizes the current cell to improve speed. However, this leads to a problem when the number of cells in a *.ju.py file changes, as the changes are not always synchronized promptly.

For example, when I adjust or delete cells from the bottom, the synchronization does not reflect the changes immediately. I have to enter the 'i' mode to see the updates. Consider the following scenario:

Initial state:

#  %% 
# something cell1
# %%
# if I delete the above line
# something cell2
# %%

The changes are not synchronized until I enter 'i' mode. @AbaoFromCUG

singledoggy avatar Feb 07 '25 11:02 singledoggy

After I checked the code, I think we have full sync and partial sync, if we choose to use :Neopyter sync current. we can full sync all the cell. However, I wonder if it's better to check the number of the cell or something to use full sync when it's necessary. At least in my case, the number of the cell might be wrong.

singledoggy avatar Feb 13 '25 12:02 singledoggy

Sorry for the later reply.

The synchronization is based on msgpackRPC and websocket (direct mode), which is don't ensure the order of RPC. So cell count may be wrong sometimes (Especially the frequent creation and deletion of cells. )

You could use jupyter.partial_sync=false to disable partial synchronization, which will synchronize entire buffer content when buffer changed.

AbaoFromCUG avatar Jul 28 '25 10:07 AbaoFromCUG