Code Monkey home page Code Monkey logo

Comments (2)

Wirg avatar Wirg commented on August 25, 2024

Hi @ohjho ,

Honnestly, I don't plan on this and I don't think I will ever.
However, I plan on adding a way to replace tqdm calls by stqdm ones.
This may be a way for you to achieve this.

Waiting for this, here are 2 ways that will probably do the trick for you :

  • do your own multiprocessing and use the resulting imap in stqdm :
from multiprocessing import Pool # you can probably call pathos in the same way
from time import sleep


def sleep_and_return(i):
    sleep(0.5)
    return i


N = 100
with Pool(processes=5) as pool:
    for i in stqdm(pool.imap(sleep_and_return, range(N)), total=N):
        st.write(i)

If you don't care about the order, you can call imap_unordered instead

  • Monkey patching tqdm in p_tqdm module by calling something like :
from stqdm import stqdm
from p_tqdm import p_tqdm as p_tqdm_base
p_tqdm_base.tqdm = stqdm

from stqdm.

Wirg avatar Wirg commented on August 25, 2024

Closing as stale and there are some workaround and a future for this.

from stqdm.

Related Issues (12)

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.