semvec/pypi-packages huggingface dataset:
blockplotlib 2023.1.4
Matplotlib-based library for the creation of block diagrams
License: BSD 3-Clause License

[![name](https://img.shields.io/pypi/v/blockplotlib?label=pypi%20package)](https://pypi.org/project/blockplotlib)
[![name](https://img.shields.io/pypi/dm/blockplotlib)](https://pypi.org/project/blockplotlib)

# Blockplotlib

Matplotlib-based library for the creation of block diagrams.
Besides this core functionality, blockplotlib provides a workflow
to include all kinds of matplotlib figures with the correct font size
into latex documents. While latex is also often used to render text
inside figures/block diagrams, blockplotlib (as matplotlib)
depends not on latex.

The functionality of the library is limited to the features
demonstrated in the examples but can be extended quite easily.

## Examples

How to draw a simple control loop is illustrated with the
example `blockplotlib/examples/control_loop_one_dof.py`.

<img src="https://github.com/riemarc/blockplotlib/assets/18379817/7be3ba47-7e22-4965-98a3-467b6b47969b" width="60%">

[control_loop_one_dof.pdf](https://github.com/riemarc/blockplotlib/files/11445397/control_loop_one_dof.pdf)

A more complex example is the block diagram of the
so-called hyperbolic observer canonical form:
`blockplotlib/examples/hyperbolic_ocf.py`

<img src="https://github.com/riemarc/blockplotlib/assets/18379817/5148f97a-12b8-4c1f-af6f-6d4b741f22c1" width="80%">

[hyperbolic_ocf.pdf](https://github.com/riemarc/blockplotlib/files/11445461/hyperbolic_ocf.pdf)

The inclusion of matplotlib figures with the correct
font size into a latex document can be adapted
from the example under `blockplotlib/examples/tex_article`.
It basically relies on two measurements of the height of a string.
One measurement is performed in the latex preamble and the
other one in the respective matplotlib figure using
a blockplotlib function.

More examples can be found under `blockplotlib/examples/`.

## Installation

One way to use blockplotlib is to install it via
pip (`pip install blockplotlib`).
Another way to use it is to copy the file `blockplotlib.py` in the folder
of the Python script from which it is to be imported.
juts 2023.4.2
Jupyter widgets for scheduling processes and visualizing the resulting (live) data
License: BSD 3-Clause License

[![name](https://img.shields.io/pypi/v/juts?label=pypi%20package)](https://pypi.org/project/juts)
[![name](https://img.shields.io/pypi/dm/juts)](https://pypi.org/project/juts)

# Juts

Jupyter widgets for scheduling processes and visualizing the resulting
(live) data. While it is designed to use custom data-specific visualizations
(plot widgets) based on ipywidgets, visualizations for time series data
(bqplot), animations (matplotlib) and 3D data (ipyvolume) are included.

## Quickstart

To start a process a so-called job has to be set up. A job consists of a Python
function and a configuration. The function contains the code (machine learning,
simulation, ....) to be executed,
for [example](juts/examples/minimal_example.ipynb):

```
import time as tim
def wait_n_times_x_ms(config, process_queue=None, return_dict=None):
    n = config["parameter"]["n"]
    x = config["parameter"]["x"]
    
    time = list()
    time_series = list()
    for i in range(n):
        time.append(i)
        time_series.append(i / x)
        
        process_queue.put(dict(progress=int(i/n * 100),
                               time=i,
                               time_series=i/x))
        tim.sleep(x)
```

The configuration(s) can be read from a yaml file like [this](juts/examples/wait_n_times_x_ms.yml):

```
wait_40_times_100_ms:
    parameter:
        n: 40
        x: 0.1
        
wait_10_times_300_ms:
    parameter:
        n: 10
        x: 0.3
```

or can be defined as python dictionary.

[Screencast min example.webm](https://github.com/riemarc/juts/assets/18379817/d711701a-4aea-4bd6-9d26-2e476c60b274)

Also live data can be monitored during script execution:

[Screencast min example live.webm](https://github.com/riemarc/juts/assets/18379817/c5ac1676-ceae-42ea-a652-8128c4e4c466)


## A simulation example

A more practical relevant example is the following simulation of a reaction
wheel pendulum under state feedback control.

[Screencast pendulum.webm](https://github.com/riemarc/juts/assets/18379817/f4cbbf97-d2cb-410d-a834-11c9422ddc27)

Widgets can be easily connected if required:

[Screencast pendulum link.webm](https://github.com/riemarc/juts/assets/18379817/e6342830-6258-4ca1-b8ed-0b1654e03444)

Since the simulation runs quite
fast, a loop was put after it which sends the data with a delay. This shows that
a job could also record live data from an experiment, so one could compare the
simulation data with the measurements from a real pendulum.

[Screencast pendulum live.webm](https://github.com/riemarc/juts/assets/18379817/dc0edbe0-8b5a-424a-91bf-eef0b944d14b)


## Visualizing 3D data

An example plot widget to view 3D data is also included.
This one relies on [ipyvolume](https://github.com/widgetti/ipyvolume).

[Screencast 3d.webm](https://github.com/riemarc/juts/assets/18379817/762806cf-38b1-4f6d-ba5c-071bcbbcb9e2)