Skip to content

Conversation

Splines
Copy link
Member

@Splines Splines commented Oct 31, 2024

This fixes #52. At least I hope I've fixed the problem identified by @VladimirFokow in the first log. Please tell me if this PR also fixes the other problems of that issue. If not, I will take a look at them as well.

The issue could be identified by comparing logs on different machines. Here only the most relevant parts:

On Linux (WSL)
2024-10-31 10:49:18.109 [trace] [manimShell.ts:514:28] [unknown] 🧾 Terminal data:
In [1]:  checkpoint_paste()In [1]:  checkpoint_paste()


2024-10-31 10:49:18.109 [debug] [manimShell.ts:536:32] [unknown] 📦 IPython cell 1 detected
2024-10-31 10:49:18.109 [debug] [manimShell.ts:475:24] [unknown] 🕒 While waiting for command to finish, iPythonCellCount=1, currentExecutionCount=1
2024-10-31 10:49:18.109 [debug] [manimShell.ts:475:24] [unknown] 🕒 While waiting for command to finish, iPythonCellCount=1, currentExecutionCount=1
2024-10-31 10:49:18.474 [trace] [manimShell.ts:514:28] [unknown] 🧾 Terminal data:
1
2

In [2]: In [2]: 

















































 �
2024-10-31 10:49:18.474 [debug] [manimShell.ts:536:32] [unknown] 📦 IPython cell 2 detected
On MacOS
2024-10-30 23:20:39.611 [trace] [manimShell.ts:514:28] [unknown] 🧾 Terminal data:
In [1]:  checkpoint_paste()

































 �In [1]:  checkpoint_paste()

1
2

In [2]: In [2]: 

























 �
2024-10-30 23:20:39.612 [debug] [manimShell.ts:536:32] [unknown] 📦 IPython cell 1 detected
2024-10-30 23:20:39.612 [debug] [manimShell.ts:475:24] [unknown] 🕒 While waiting for command to finish, iPythonCellCount=1, currentExecutionCount=1

See the difference? On Linux I get two separate data streams and each one only contains one IPython Cell identifier. This is not the case for MacOS. Therefore, I changed the RegEx to globally match multiple occurrences in a data stream and then just take the maximum number I have found, in this example: 2.

Note the fixed approach is coherent with

https://github.com/bhoov/manim-notebook/blob/b4ec9bbe242a3d120d2674091c046f1962f29809/src/manimShell.ts#L478

since this will evaluate to true if the seen cell count is higher than the current cell count. So even if we skip over cells via this new tactic, we will definitely end the old ones when a cell higher than the current execution count is seen.

@Splines Splines self-assigned this Oct 31, 2024
@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 31, 2024

  • logs 1-4 in that issue - aren't new problems, but rather
    they explore the behavior of THIS problem - from different angles

  • now it doesn't hang, so this PR fixed it

  • new concern:
    the notification stays for around 1 second even if I'm only printing (should be instant).
    Do you know why it's not instant? notification stays longer than code is executing (MacOS) #65

@Splines Splines merged commit b278ded into main Oct 31, 2024
@Splines Splines deleted the fix/hanging-preview branch October 31, 2024 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

some "Preview Manim Cell" execute but progress bar hangs (MacOS)
2 participants