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

Jupyter notebook progress bar #308

Closed
palakpsheth opened this issue Jul 24, 2023 · 4 comments
Closed

Jupyter notebook progress bar #308

palakpsheth opened this issue Jul 24, 2023 · 4 comments

Comments

@palakpsheth
Copy link

Using dorado, after v0.3.0, the progress bar when duplex basecalling in an interactive jupyter notebook no longer appears. I understand that there was an intentional change made. Any recommendations on how to get the progress bar back when calling dorado commands via subprocess call in python?

thank you!

@GeorgeNikitinNV
Copy link
Contributor

Had the same problem, fixed in #310.

@palakpsheth
Copy link
Author

@GeorgeNikitinNV thanks for the fix but looks like the ONT team didnt merge? any feedback there?

@iiSeymour
Copy link
Member

@palakpsheth it seems more people are using the progress bar in none tty environments than expected so I think we should enable it by default again?

fyi you can fake it with Python's pty module like so:

import os
import pty
import subprocess

master, slave = pty.openpty()

# Run the subprocess with the slave side of the pty as its stdin, stdout, and stderr
process = subprocess.Popen(['python3', '-c', 'import sys; print(sys.stdout.isatty())'],
                           stdin=slave, stdout=slave, stderr=slave)

os.close(slave)  # Close the slave side in the parent process

# Read output from the master side
output = os.read(master, 1024).decode('utf-8')
print(output)  # This should print "True"

# Clean up
os.close(master)
process.wait()

@palakpsheth
Copy link
Author

@iiSeymour Thanks for the python tip! In my experience, a command line flag to control the progress bar visibility would be most robust. Off by default seems fair to me for user experience consistency with previous release.

Appreciate all the hard work!

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

No branches or pull requests

4 participants