Code Monkey home page Code Monkey logo

stqdm's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar wirg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stqdm's Issues

p_tqdm support

Love this project and have been using it all the time with any ST apps I build.

just wondering if there's any plan to wrap stqdm on top of the equally amazing p_tqdm

[Question] How can I replace tqdm in library

I use a library foo which use tqdm in it:

from tqdm.auto import tqdm

And in my own code:

import streamlit as st
from foo import bar

bar()

How can I replace it with stqdm while I can not modify foo library?

frontend, backend option not available in 0.0.3

Hello, @Wirg

First of all, thanks for implementing this wonderful idea.

I tried to disable backend progressbar and only allow progressbar in streamlit application.
so I passed the parameter like this

for idx in stqdm(range(len(data)), backend=False, frontend=True):

However, it showed error.
TqdmKeyError: "Unknown argument(s): {'backend': False, 'frontend': True}"

My current library versions are as followed.
I installed stqdm via pip

tqdm == 4.61.1
stqdm == 0.0.3
streamlit == 0.83.0

[BUG] Interaction with Streamlit "Stop" button seems broken

While a for loop enclosed in stqdm is running, if you press the "Stop" button, in the top right corner of any Streamlit app, the code stops running (as expected) but then becomes non-functional. That is, if you try to again interact with the code, it misbehaves and doesn't do what is otherwise expected or .

To Reproduce

  1. Enclose a long running for loop in stqdm.
  2. Stop the execution using the "Stop" button in Streamlit (top right corner).
  3. Try interacting with the code again.

Example :

from time import sleep
from stqdm import stqdm
import streamlit as st

submit = st.button('Click me')
if submit:
    for _ in stqdm(range(50)):
        sleep(0.5)

Expected behavior

The code should function exactly as it was functioning before pressing the "Stop" button.

The code doesn't behave as expected as shown in the below.

stqdm_stop_bug.mp4

Desktop (please complete the following information):

  • OS: Windows Version 21H2 Build 19044.1645
  • Browser: Brave 1.43.93
  • Streamlit version: 1.12.2
  • STqdm veriosn: 0.0.4
  • tqdm version: 4.64.1

[BUG] bar_format parameter doesn't seem to be working

Describe the bug

Hi, first of all, thanks for this, it's great ! I'd like to report what I think is a bug. I'm trying to get to display only the progress bar and no additional info. Like this :

Capture d’écran 2023-11-30 à 11 45 27

Unfortunately, with stqdm, even when setting the bar_format parameter, additional info still shows.

Capture d’écran 2023-11-30 à 11 49 30

To Reproduce

Steps to reproduce the behavior :

from stqdm import stqdm
from time import sleep

for item in stqdm(range(10), bar_format="{bar}"):
    sleep(0.5)

I might be missing something, but since stqdm inherits from tdqm, I think this should be working ?

[BUG] Leave option is not connected

Describe the bug

The leave option of the stqdm progress bar should have an effect not only for the inherited tqdm. The change below should fix this.

Current:

   def close(self):
        super().close()
        self.st_clear()

Proposed change:

   def close(self):
        super().close()
        if self.leave is False:  #  <-- Check if leave is desired
            self.st_clear()

Feature: ability to change defaults

I would like to have "backend" and "frontend" set for all widgets. Would be nice to set it up once for as default for all.
Currently I think it is only possible to change each widget/instance separately.

[BUG] 'last_print_t' is preventing streamlit from reloading

Describe the bug

Traceback (most recent call last):
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1149, in __del__
    self.close()
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\stqdm\stqdm.py", line 109, in close
    super().close()
  File "C:\Users\rohit\anaconda3\envs\ws_st\lib\site-packages\tqdm\std.py", line 1278, in close
    if self.last_print_t < self.start_t + self.delay:       
AttributeError: 'stqdm' object has no attribute 'last_print_t'

To Reproduce

A simple app with two stqdm instances will produce the error upon a few reruns.

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Vivaldi
  • Version of streamlit : 1.33.0
  • Version of stqdm: 0.0.5
  • Version of tqdm: 4.66.1

Progress bar no longer launches [BUG]

Describe the bug

I'm using the progress bar to track a process in my script.
I can't set the bar like "for _ in stqdm(range(x)):" because I have several loops to control process and I only want one bar.

after several uses or when I do large calculations, the bar is no longer usable and the script no longer works. There is no error displayed and the bar is no longer displayed. However the st.spinner launches well before.

To Reproduce

import streamlit as st
from stqdm import stqdm

def exemple_run(test1, test2):
    total_iterations = len(test1) + len(test2)
    with stqdm(total=total_iterations, desc='Calculating...', mininterval=0.1) as pbar:
         for _ in test1:
            pbar.update(1)
         for _ in test2:
            pbar.update(1)

if st.button("Exemple"):
   with st.spinner("Processing..."):
      exemple_run(test1, test2)

Desktop (please complete the following information):

  • Browser: this is a Streamlit Cloud
  • Version of streamlit: latest
  • Version of stqdm: latest
  • Version of tqdm: latest

[BUG] stqdm in for loop with the enumerate function

Describe the bug

stqdm doesn't work on a python loop that uses the enumerate function

To Reproduce

values = ["a", "b", "c"]
for count, value in stqdm(enumerate(values)):
    sleep(1)

doesn't work.

However

values = ["a", "b", "c"]
for value in stqdm(values)):
    sleep(1)

works normally

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.