Skip to main content

Numba-progress

A progress bar implementation for numba functions using tqdm. The module provides the class ProgressBar that works as a wrapper around the tqdm.tqdm progress bar.

It works by spawning a separate thread that updates the tqdm progress bar based on an atomic counter which can be accessed and updated in a numba nopython function.

The progress bar works with parallel as well as sequential numba functions.

Installation

Using pip

pip install numba-progress

From source

git clone https://github.com/mortacious/numba-progress.git
cd numba-progress
python setup.py install

Usage

from numba import njit
from numba_progress import ProgressBar

num_iterations = 100

@njit(nogil=True)
def numba_function(num_iterations, progress_proxy):
    for i in range(num_iterations):
        #<DO CUSTOM WORK HERE>
        progress_proxy.update(1)

with ProgressBar(total=num_iterations) as progress:
    numba_function(num_iterations, progress)

The ProgressBar also works within parallel functions out of the box:

from numba import njit, prange
from numba_progress import ProgressBar

num_iterations = 100

@njit(nogil=True, parallel=True)
def numba_function(num_iterations, progress_proxy):
    for i in prange(num_iterations):
        #<DO CUSTOM WORK HERE>
        progress_proxy.update(1)

with ProgressBar(total=num_iterations) as progress:
    numba_function(num_iterations, progress)

Refer to the examples folder for more usage examples.

Release files for numba-progress 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for numba-progress 1.2.0
File Size Uploaded
numba_progress-1.2.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for numba-progress 1.2.0
File Interpreter ABI Platform
numba_progress-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / numba_progress-1.2.0.tar.gz

Download URL numba_progress-1.2.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c6189119ae901ad106b0cae3796319024d20bbbb3b7ae027b9bfcb08802585a8
BLAKE2b-256 checksum
How to use checksums
a2ae3f8e5e757badaf8e2fe6c596f183c6709c4e7af51cd4bdcbaec61c2c27ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / numba_progress-1.2.0-py3-none-any.whl

Download URL numba_progress-1.2.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9404c437d55f6454d907ebad28717baf64593405c68446675c1d0d10c833b21f
BLAKE2b-256 checksum
How to use checksums
ec4f71b6d8605d46fdf629f0e3f595a6bfd50ad6b731550cbd70ef79d0e3b692
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.3

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page