All Projects → kuk → Log Progress

kuk / Log Progress

Licence: mit
https://habr.com/ru/post/276725/

Projects that are alternatives of or similar to Log Progress

Juniper
🍇 Edit and execute code snippets in the browser using Jupyter kernels
Stars: ✭ 189 (-66.01%)
Mutual labels:  jupyter-notebook, jupyter, widget
Jupyter Dash
Develop Dash apps in the Jupyter Notebook and JupyterLab
Stars: ✭ 453 (-18.53%)
Mutual labels:  jupyter-notebook, jupyter
Jupyter tensorboard
Start Tensorboard in Jupyter Notebook
Stars: ✭ 446 (-19.78%)
Mutual labels:  jupyter-notebook, jupyter
Traceback with variables
Adds variables to python traceback. Simple, lightweight, controllable. Debug reasons of exceptions by logging or pretty printing colorful variable contexts for each frame in a stacktrace, showing every value. Dump locals environments after errors to console, files, and loggers. Works in Jupyter and IPython. Install with pip or conda.
Stars: ✭ 509 (-8.45%)
Mutual labels:  jupyter, logging
Ifsharp
F# for Jupyter Notebooks
Stars: ✭ 424 (-23.74%)
Mutual labels:  jupyter-notebook, jupyter
Py d3
D3 block magic for Jupyter notebook.
Stars: ✭ 428 (-23.02%)
Mutual labels:  jupyter-notebook, jupyter
Or Pandas
【运筹OR帷幄|数据科学】pandas教程系列电子书
Stars: ✭ 492 (-11.51%)
Mutual labels:  jupyter-notebook, jupyter
Quantitative Notebooks
Educational notebooks on quantitative finance, algorithmic trading, financial modelling and investment strategy
Stars: ✭ 356 (-35.97%)
Mutual labels:  jupyter-notebook, jupyter
Nbviewer App
A Jupyter notebook viewer for macOS
Stars: ✭ 521 (-6.29%)
Mutual labels:  jupyter-notebook, jupyter
Data Science Your Way
Ways of doing Data Science Engineering and Machine Learning in R and Python
Stars: ✭ 530 (-4.68%)
Mutual labels:  jupyter-notebook, jupyter
Digital Signal Processing Lecture
Digital Signal Processing - Theory and Computational Examples
Stars: ✭ 532 (-4.32%)
Mutual labels:  jupyter-notebook, jupyter
Hands On Nltk Tutorial
The hands-on NLTK tutorial for NLP in Python
Stars: ✭ 419 (-24.64%)
Mutual labels:  jupyter-notebook, jupyter
Enterprise gateway
A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
Stars: ✭ 412 (-25.9%)
Mutual labels:  jupyter-notebook, jupyter
Tensorflow Lstm Regression
Sequence prediction using recurrent neural networks(LSTM) with TensorFlow
Stars: ✭ 433 (-22.12%)
Mutual labels:  jupyter-notebook, jupyter
Pytorch Original Transformer
My implementation of the original transformer model (Vaswani et al.). I've additionally included the playground.py file for visualizing otherwise seemingly hard concepts. Currently included IWSLT pretrained models.
Stars: ✭ 411 (-26.08%)
Mutual labels:  jupyter-notebook, jupyter
Jupyterhub Deploy Docker
Reference deployment of JupyterHub with docker
Stars: ✭ 479 (-13.85%)
Mutual labels:  jupyter-notebook, jupyter
Justenoughscalaforspark
A tutorial on the most important features and idioms of Scala that you need to use Spark's Scala APIs.
Stars: ✭ 538 (-3.24%)
Mutual labels:  jupyter-notebook, jupyter
Whylogs
Profile and monitor your ML data pipeline end-to-end
Stars: ✭ 328 (-41.01%)
Mutual labels:  jupyter-notebook, logging
Vscodejupyter
Jupyter for Visual Studio Code
Stars: ✭ 337 (-39.39%)
Mutual labels:  jupyter-notebook, jupyter
Sklearn Classification
Data Science Notebook on a Classification Task, using sklearn and Tensorflow.
Stars: ✭ 518 (-6.83%)
Mutual labels:  jupyter-notebook, jupyter

log-progress functionality was integrated into tqdm. Please, use from tqdm.notebook import tqdm as log_progress.

Widget based progress bar for Jupyter (IPython Notebook)

Code

Just copy and paste it into your project:

def log_progress(sequence, every=None, size=None, name='Items'):
    from ipywidgets import IntProgress, HTML, VBox
    from IPython.display import display

    is_iterator = False
    if size is None:
        try:
            size = len(sequence)
        except TypeError:
            is_iterator = True
    if size is not None:
        if every is None:
            if size <= 200:
                every = 1
            else:
                every = int(size / 200)     # every 0.5%
    else:
        assert every is not None, 'sequence is iterator, set every'

    if is_iterator:
        progress = IntProgress(min=0, max=1, value=1)
        progress.bar_style = 'info'
    else:
        progress = IntProgress(min=0, max=size, value=0)
    label = HTML()
    box = VBox(children=[label, progress])
    display(box)

    index = 0
    try:
        for index, record in enumerate(sequence, 1):
            if index == 1 or index % every == 0:
                if is_iterator:
                    label.value = '{name}: {index} / ?'.format(
                        name=name,
                        index=index
                    )
                else:
                    progress.value = index
                    label.value = u'{name}: {index} / {size}'.format(
                        name=name,
                        index=index,
                        size=size
                    )
            yield record
    except:
        progress.bar_style = 'danger'
        raise
    else:
        progress.bar_style = 'success'
        progress.value = index
        label.value = "{name}: {index}".format(
            name=name,
            index=str(index or '?')
        )

Examples

Progress bar changes its color based on outcome:

Iterators are supported:

More then one progress bar can be in a sigle cell:

They can even be from different threads:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].