Skip to content
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

Notebook streaming output is appended when it should replace #184657

Closed
amunger opened this issue Jun 8, 2023 · 4 comments · Fixed by #184675
Closed

Notebook streaming output is appended when it should replace #184657

amunger opened this issue Jun 8, 2023 · 4 comments · Fixed by #184675
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release notebook-output verified Verification succeeded

Comments

@amunger
Copy link
Contributor

amunger commented Jun 8, 2023

Inconsistent repro, not sure what triggers it yet.

image
@amunger amunger self-assigned this Jun 8, 2023
@amunger amunger added bug Issue identified by VS Code Team member as probable bug notebook-output labels Jun 8, 2023
@amunger
Copy link
Contributor Author

amunger commented Jun 9, 2023

this is caused by the first one or two lines of output to be in one output item and the rest in another. In the case above:

"outputs": [
    {
        "name": "stdout",
        "output_type": "stream",
        "text": [
         "0\n"
        ]
    },
    {
         "name": "stdout",
         "output_type": "stream",
         "text": [
          "1\n",
          "2\n",
          "3\n",
          "4\n",
          ...

While the second output keeps streaming in, it is supposed to be replaced each time, but we were looking in the wrong element for the previous output to be replaced.

I don't know why the outputs are split like this and is the first time I've ever noticed it happening.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Jun 9, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the June 2023 milestone Jun 9, 2023
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Jun 9, 2023
@amunger amunger added the candidate Issue identified as probable candidate for fixing in the next release label Jun 12, 2023
@amunger amunger reopened this Jun 12, 2023
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label Jun 12, 2023
@DonJayamanne
Copy link
Contributor

Another progress with simple ASCII output (previous sample was HTML)
(install using !pip install tqdm)

from tqdm import trange
from time import sleep

print("Hello World")
for i in trange(50):
    sleep(1)

@DonJayamanne
Copy link
Contributor

Some other samples, that seems to be flaky
!pip install fastprogress

Code

from fastprogress.fastprogress import master_bar, progress_bar
from time import sleep
mb = master_bar(range(2))
for i in mb:
    for j in progress_bar(range(3), parent=mb):
        sleep(0.01)
        mb.child.comment = f'second bar stat'
    mb.main_bar.comment = f'first bar stat'
    mb.write(f'Finished loop {i}.')
    #mb.update_graph(graphs, x_bounds, y_bounds)

	# just the minimum to get the progress bars to work
from time import sleep
from fastprogress.fastprogress import master_bar, progress_bar

mb = master_bar(range(10))
progress_bar(range(100), parent=mb)

for i in mb:
    for j in progress_bar(range(100), parent=mb):
        sleep(0.01)

@amunger
Copy link
Contributor Author

amunger commented Jun 14, 2023

verification steps:
run the example that Don provided in a notebook cell

from tqdm import trange
from time import sleep

print("Hello World")
for i in trange(50):
    sleep(1)

only one progress bar should appear and refresh

@rebornix rebornix added the verified Verification succeeded label Jun 14, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release notebook-output verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@rebornix @DonJayamanne @amunger @VSCodeTriageBot and others