linefold
linefold draws a long line by folding it into one column per pixel. Each column keeps the smallest and the largest sample that lands in it. Qt and matplotlib both stroke that envelope. Neither walks the samples again.
Python 3.11 or newer is required.
plotcore continues this project in C++, which makes it portable, and offers it for Python and Rust as well. When more features are needed, that project is warmly recommended.
Install
pip install linefold
numpy and rpc3-file are installed with the package. rpc3-file is still a pre-release; the dependency asks for 1.0.0rc6 or newer so pip will take it.
Optional extras:
pip install "linefold[qt]" # PySide6 widget
pip install "linefold[mpl]" # matplotlib host
pip install "linefold[hdf5]" # 1-D datasets as a line or as time
pip install "linefold[numba]" # faster column scans
A line
import numpy as np
from linefold import Plot
y = np.sin(np.linspace(0, 40, 200_000))
plot = Plot()
plot.add_line(y, name="sine")
plot.set_pane(800, 400)
pixels, runs, ticks = plot.project()
project folds the window into 800 columns and returns the pixels a host would stroke. A window, the wheel, and the file tree live in examples/demo.py (Qt) and examples/demo_mpl.py (matplotlib inside Tk). How those viewers behave is described in docs/demos.md.
The fold, the ladder that answers a wide column without rereading the line, and the way the two hosts draw that result are described in docs/linefold.md.
Licence
widget.py, examples/demo.py, and tests/test_widget.py are GPL-3.0-only. The rest of the package is BSD-2-Clause. The texts are LICENSE and LICENSES/GPL-3.0-only.txt. A file keeps the licence named in its SPDX header. The BSD modules can be used on their own under BSD-2-Clause. A distribution that includes the GPL files has to honour GPL-3.0 for those files.
Metadata
Release files for linefold 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| linefold-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for linefold-0.1.2-py3-none-any.whl |
Release files / linefold-0.1.2-py3-none-any.whl
| Download URL | linefold-0.1.2-py3-none-any.whl |
|---|---|
| Size | 63.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cf850804fad446e5ddc60128e9872974ac19d9c8f7dea19d905e43eb801d5eb3
|
|
BLAKE2b-256 checksum How to use checksums |
7cabcce4b40734f3cf5633f6987e4fc20cd99866c1ca474675b83335a9a50f98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.13
|
Security for linefold 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.