sjmikler / progress-table Goto Github PK
View Code? Open in Web Editor NEWDisplay progress as a pretty table in the command line.
License: MIT License
Display progress as a pretty table in the command line.
License: MIT License
Currently, when progress bar is embedded and the head is behind some text it will not be visible. Add an option (possibly default) to have a colorful bar that would be visible behind the text (like htop has)
Hello. Thank you for your amazing work. Looks really interesting and I really would like to implement it in my pytorch training loop.
However, when installing using pip and trying your proposed example, the import fails with error:
File "/usr/local/lib/python3.10/site-packages/progress_table/init.py", line 3, in
from progress_table.v0.progress_table import ProgressTableV0
ModuleNotFoundError: No module named 'progress_table.v0'
I'm working in a conda environment with python 3.10.
Maybe there's some issue with the Pypi installer? Thank you for any help you could give me.
Thanks for the library, been using it in a personal project and its been nice, just opening up a few issues that I'll hopefully be able to pitch in on.
I have a use case for setting color on the row level, somewhat dynamically. Each of my rows can either pass or fail (sort of like a test) and it would be nice to highlight them when they do fail.
Most modern terminal support cursor movements well. After playing with nested progress bars I think we could support rows with multiple lines in progress-table.
Adding this functionality will require a minor rewrite of the library.
Going further, we could allow to modify previously finished cells.
Example API:
table = ProgressTable(
wrap=True, # enables wrapping lines that are overflowing instead of clipping (which is default)
)
...
# Editing existing column
row_number = 10
column_name = "test"
new_cell_value = "new value"
table[row_number, column_name] = new_cell_value
This is a handy feature in tqdm and it works well for a row based table UX like progress-table
has. I'd like to use it to show both the overall progress of the table (since the user doesn't know how many rows are to come) as well as the progress for the current row.
Tqdm has their tqdm.write()
that allows you to print stuff without breaking progress bars.
We could use a similar solution to allow user to print without breaking the table and progress bars.
It would be nice to be able to treat progress bars as objects and update them manually.
This is available in tqdm
:
pbar = tqdm(total=100)
for i in range(10):
sleep(0.1)
pbar.update(10)
pbar.close()
The suggestion is to have the equivalent in progress-table
:
pbar = table.pbar(total=100)
for i in range(10):
sleep(0.1)
pbar.update(10)
pbar.close()
Code below is a workaround, I am running tests separately
progress-table/.github/workflows/check-with-pytest.yaml
Lines 31 to 36 in 6400af2
I'm currently using monkey patching to customize the appearance of the embedded progress bar
SymbolsUnicodeBare.embedded_pbar_filled = "-"
It looks like there is a dataclass that defines Symbol
, which could potentially just be accepted by the table constructor and used as an override for all of the symbols that are used.
There might be a little x-y problem here too. I was content using the default progress bar but I want my current row to be visible and that option is tangled up in the embedded progress bar atm. I would be content with the default embedded progress bar style but it's the same color as my tmux toolbar and it rubs right up against it which makes it barely visible. Having an empty line at the bottom of the table to separate the embedded progress bar wold probably also fix my issue.
Since I'm monkey patching anyway, I was going to use some cool symbols like ╼
, but that doesn't really work unless we can also specify separate symbols for the past progress vs the current head of the progress line, which would let you make nice progress bars like this
──────────╼
If one replaces sys.stdout
with a custom stream, progress-table does still output to the old stream (usually standard out), even if the table is created and initialized AFTER the stream has been replaced.
The reason for this is the default argument file=sys.stdout, that gets evaluated when the module is imported for the first time and NOT when an actual table object is created. This can be hard to spot!
Replace the default argument with file=None
and set it to sys.stdout
in the constructor. This delays the evaluation of sys.stdout
to the time at which a table object is actually created.
Even better: Officially accept None
values for file
as part of the interface and, in that case, retrieve sys.stdout
on each write/flush instead of on object creation. This would allow one to redirect the output of progress-table even long after a table object has been created. The old behavior, i.e. sticking to a single, specific stream for all eternity, can still be achieved by explicitly passing file=sys.stdout
to the constructor.
I would like the progress bar to be something like 4/1000 steps, and have it update each time we get a step update from a training run.
Whenever filling cells when header was not yet printed, they won't be displayed.
This is because the header can be changed (new columns can be added).
This should be overcome by modifying the existing header. New values should be displayed and whenever a new column is added, header should be re-printed.
For my table, I don't actually know when the items will finish. They shell out to a subprocess where anything can happen. Having a spinner/bouncing option would be nice there so highlight that things are happening but the end isn't known. I think I'd have to manually fake this by just making it fill up slowly and then rush to 100% when the subprocess finishes without this feature.
It looks like pandas is only being used to export data from the table. It's a rather large dependency for a feature that I don't plan on using. Any opposition to making it an optional dependency and surrounding the import with an exception error message that tells you to install pandas if you want to export the table in pandas format?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.