uplot-python 0.0.1__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- uplot_python-1.1.0/.woodpecker/changelog.yml +10 -0
- uplot_python-1.1.0/.woodpecker/coverage.yml +8 -0
- uplot_python-1.1.0/.woodpecker/lint.yml +8 -0
- uplot_python-1.1.0/.woodpecker/pypi.yml +9 -0
- uplot_python-1.1.0/.woodpecker/test.yml +14 -0
- uplot_python-1.1.0/CHANGELOG.md +30 -0
- uplot_python-1.1.0/MANIFEST.in +1 -0
- uplot_python-1.1.0/NOTICE +4 -0
- uplot_python-1.1.0/PKG-INFO +83 -0
- uplot_python-1.1.0/README.md +56 -0
- uplot_python-1.1.0/examples/left_right_axes.py +158 -0
- uplot_python-1.1.0/examples/simple_plot.py +33 -0
- uplot_python-1.1.0/examples/simple_plot2.py +17 -0
- uplot_python-1.1.0/pixi.lock +3434 -0
- uplot_python-1.1.0/pyproject.toml +107 -0
- uplot_python-1.1.0/tests/__init__.py +6 -0
- uplot_python-1.1.0/tests/test_color_picker.py +26 -0
- uplot_python-1.1.0/tests/test_exceptions.py +17 -0
- uplot_python-1.1.0/tests/test_generate_html.py +39 -0
- uplot_python-1.1.0/tests/test_plot.py +29 -0
- uplot_python-1.1.0/tests/test_plot2.py +61 -0
- uplot_python-1.1.0/tests/test_utils.py +26 -0
- uplot_python-1.1.0/tests/test_write_html_tempfile.py +25 -0
- uplot_python-1.1.0/uplot/__init__.py +16 -0
- {uplot_python-0.0.1 → uplot_python-1.1.0}/uplot/color_picker.py +0 -2
- {uplot_python-0.0.1 → uplot_python-1.1.0}/uplot/exceptions.py +0 -2
- uplot_python-1.1.0/uplot/generate_html.py +120 -0
- uplot_python-1.1.0/uplot/plot.py +26 -0
- uplot_python-1.1.0/uplot/plot2.py +166 -0
- uplot_python-1.1.0/uplot/utils.py +38 -0
- uplot_python-0.0.1/uplot/write_tmpfile.py → uplot_python-1.1.0/uplot/write_html_tempfile.py +3 -5
- uplot_python-0.0.1/CHANGELOG.md +0 -16
- uplot_python-0.0.1/MANIFEST.in +0 -1
- uplot_python-0.0.1/PKG-INFO +0 -31
- uplot_python-0.0.1/README.md +0 -3
- uplot_python-0.0.1/examples/simple_plot.py +0 -12
- uplot_python-0.0.1/pyproject.toml +0 -71
- uplot_python-0.0.1/uplot/__init__.py +0 -14
- uplot_python-0.0.1/uplot/generate_html.py +0 -228
- uplot_python-0.0.1/uplot/plot.py +0 -36
- {uplot_python-0.0.1 → uplot_python-1.1.0}/.gitignore +0 -0
- {uplot_python-0.0.1 → uplot_python-1.1.0}/LICENSE +0 -0
- {uplot_python-0.0.1/uplot/uplot → uplot_python-1.1.0/uplot/static}/__init__.py +0 -0
- {uplot_python-0.0.1/uplot/uplot → uplot_python-1.1.0/uplot/static}/uPlot.iife.js +0 -0
- {uplot_python-0.0.1/uplot/uplot → uplot_python-1.1.0/uplot/static}/uPlot.min.css +0 -0
- {uplot_python-0.0.1/uplot/uplot → uplot_python-1.1.0/uplot/static}/uPlot.mousewheel.js +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
when:
|
|
2
|
+
- event: pull_request
|
|
3
|
+
|
|
4
|
+
steps:
|
|
5
|
+
- name: changelog
|
|
6
|
+
image: alpine/git
|
|
7
|
+
commands:
|
|
8
|
+
- git fetch --unshallow origin 2>/dev/null || true
|
|
9
|
+
- git fetch origin ${CI_COMMIT_TARGET_BRANCH}
|
|
10
|
+
- git diff --name-only origin/${CI_COMMIT_TARGET_BRANCH}...HEAD | grep -q "^CHANGELOG.md$" || (echo "CHANGELOG.md was not updated" && exit 1)
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.1.0] - 2026-05-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- CICD: CI workflow
|
|
15
|
+
- CICD: Changelog workflow
|
|
16
|
+
- Performance: faster serialization of large NumPy arrays to JavaScript
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Bump minimum Python version to 3.10 as 3.8 and 3.9 have reached end-of-life
|
|
21
|
+
- Migrate the project from GitHub to Codeberg
|
|
22
|
+
|
|
23
|
+
## [1.0.0] - 2024-10-29
|
|
24
|
+
|
|
25
|
+
- Extract this project from [foxplot](https://codeberg.org/stephane-caron/foxplot)
|
|
26
|
+
- Start this changelog
|
|
27
|
+
|
|
28
|
+
[unreleased]: https://codeberg.org/stephane-caron/uplot-python/compare/v1.1.0...HEAD
|
|
29
|
+
[1.1.0]: https://codeberg.org/stephane-caron/uplot-python/releases/tag/v1.1.0
|
|
30
|
+
[1.0.0]: https://codeberg.org/stephane-caron/uplot-python/releases/tag/v1.0.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
include uplot/static/uPlot.*
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: uplot-python
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Python wrapper for μPlot time series.
|
|
5
|
+
Keywords: json,time,series,plot
|
|
6
|
+
Author-email: Stéphane Caron <stephane.caron@normalesup.org>
|
|
7
|
+
Maintainer-email: Stéphane Caron <stephane.caron@normalesup.org>
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: ipython >=8.0.1
|
|
20
|
+
Requires-Dist: msgpack >=1.0.4
|
|
21
|
+
Requires-Dist: numpy >=1.15.4
|
|
22
|
+
Project-URL: Changelog, https://codeberg.org/stephane-caron/uplot-python/blob/master/CHANGELOG.md
|
|
23
|
+
Project-URL: Homepage, https://codeberg.org/stephane-caron/uplot-python
|
|
24
|
+
Project-URL: Source, https://codeberg.org/stephane-caron/uplot-python
|
|
25
|
+
Project-URL: Tracker, https://codeberg.org/stephane-caron/uplot-python/issues
|
|
26
|
+
|
|
27
|
+
# uplot-python
|
|
28
|
+
|
|
29
|
+
[](https://ci.codeberg.org/repos/17009)
|
|
30
|
+
[](https://anaconda.org/conda-forge/uplot-python)
|
|
31
|
+
[](https://pypi.org/project/uplot-python/)
|
|
32
|
+
|
|
33
|
+
Python wrapper for [μPlot](https://github.com/leeoniya/uPlot) 📈
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
### From PyPI
|
|
38
|
+
|
|
39
|
+
```console
|
|
40
|
+
pip install uplot-python
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Usage
|
|
44
|
+
|
|
45
|
+
The `plot` function has the same API as µPlot's `uPlot.plot`:
|
|
46
|
+
|
|
47
|
+
```py
|
|
48
|
+
import numpy as np
|
|
49
|
+
import uplot
|
|
50
|
+
|
|
51
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
52
|
+
data = [t, np.exp(0.42 * t)]
|
|
53
|
+
opts = {
|
|
54
|
+
"width": 1920,
|
|
55
|
+
"height": 600,
|
|
56
|
+
"title": "Example with plot",
|
|
57
|
+
"series": [{}, { "stroke": "red", }, ],
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
uplot.plot(opts, data)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
For convenience, the library also provides a `plot2` function with additional defaults aimed at time series and line plots, for an experience closer to `matplotlib.pyplot.plot`:
|
|
64
|
+
|
|
65
|
+
```py
|
|
66
|
+
import numpy as np
|
|
67
|
+
import uplot
|
|
68
|
+
|
|
69
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
70
|
+
uplot.plot2(
|
|
71
|
+
t,
|
|
72
|
+
[np.exp(0.1 * t), np.exp(-10.0 * t), np.cos(t)],
|
|
73
|
+
title="Example with plot2",
|
|
74
|
+
left_labels=["exp(A t)", "exp(-B t)", "cos(t)"],
|
|
75
|
+
)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## See also
|
|
79
|
+
|
|
80
|
+
- [µPlot](https://github.com/leeoniya/uPlot): A small (~45 KB min), fast chart for time series, lines, areas, ohlc & bars.
|
|
81
|
+
- [Matplotlib](https://matplotlib.org/stable/): Comprehensive library for creating static, animated, and interactive visualizations.
|
|
82
|
+
- [matplotlive](https://codeberg.org/stephane-caron/matplotlive): Stream live plots to a Matplotlib figure.
|
|
83
|
+
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# uplot-python
|
|
2
|
+
|
|
3
|
+
[](https://ci.codeberg.org/repos/17009)
|
|
4
|
+
[](https://anaconda.org/conda-forge/uplot-python)
|
|
5
|
+
[](https://pypi.org/project/uplot-python/)
|
|
6
|
+
|
|
7
|
+
Python wrapper for [μPlot](https://github.com/leeoniya/uPlot) 📈
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
### From PyPI
|
|
12
|
+
|
|
13
|
+
```console
|
|
14
|
+
pip install uplot-python
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
The `plot` function has the same API as µPlot's `uPlot.plot`:
|
|
20
|
+
|
|
21
|
+
```py
|
|
22
|
+
import numpy as np
|
|
23
|
+
import uplot
|
|
24
|
+
|
|
25
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
26
|
+
data = [t, np.exp(0.42 * t)]
|
|
27
|
+
opts = {
|
|
28
|
+
"width": 1920,
|
|
29
|
+
"height": 600,
|
|
30
|
+
"title": "Example with plot",
|
|
31
|
+
"series": [{}, { "stroke": "red", }, ],
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
uplot.plot(opts, data)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
For convenience, the library also provides a `plot2` function with additional defaults aimed at time series and line plots, for an experience closer to `matplotlib.pyplot.plot`:
|
|
38
|
+
|
|
39
|
+
```py
|
|
40
|
+
import numpy as np
|
|
41
|
+
import uplot
|
|
42
|
+
|
|
43
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
44
|
+
uplot.plot2(
|
|
45
|
+
t,
|
|
46
|
+
[np.exp(0.1 * t), np.exp(-10.0 * t), np.cos(t)],
|
|
47
|
+
title="Example with plot2",
|
|
48
|
+
left_labels=["exp(A t)", "exp(-B t)", "cos(t)"],
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## See also
|
|
53
|
+
|
|
54
|
+
- [µPlot](https://github.com/leeoniya/uPlot): A small (~45 KB min), fast chart for time series, lines, areas, ohlc & bars.
|
|
55
|
+
- [Matplotlib](https://matplotlib.org/stable/): Comprehensive library for creating static, animated, and interactive visualizations.
|
|
56
|
+
- [matplotlive](https://codeberg.org/stephane-caron/matplotlive): Stream live plots to a Matplotlib figure.
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
import uplot
|
|
9
|
+
|
|
10
|
+
v1 = np.array(
|
|
11
|
+
[
|
|
12
|
+
0.35189867,
|
|
13
|
+
0.33440887,
|
|
14
|
+
0.31187567,
|
|
15
|
+
0.29372533,
|
|
16
|
+
0.28205933,
|
|
17
|
+
0.28579414,
|
|
18
|
+
0.29055172,
|
|
19
|
+
0.29449164,
|
|
20
|
+
0.28745652,
|
|
21
|
+
0.27642006,
|
|
22
|
+
0.26409361,
|
|
23
|
+
0.24920144,
|
|
24
|
+
0.21968901,
|
|
25
|
+
0.1903474,
|
|
26
|
+
0.14416688,
|
|
27
|
+
0.1013935,
|
|
28
|
+
0.06975446,
|
|
29
|
+
0.05133968,
|
|
30
|
+
0.0492436,
|
|
31
|
+
0.05916173,
|
|
32
|
+
0.06069822,
|
|
33
|
+
0.05255136,
|
|
34
|
+
0.03641129,
|
|
35
|
+
0.01232885,
|
|
36
|
+
-0.02340249,
|
|
37
|
+
-0.06951351,
|
|
38
|
+
-0.12411359,
|
|
39
|
+
-0.18078907,
|
|
40
|
+
-0.23323237,
|
|
41
|
+
-0.27583448,
|
|
42
|
+
-0.31259793,
|
|
43
|
+
-0.33245975,
|
|
44
|
+
-0.32182605,
|
|
45
|
+
-0.27193381,
|
|
46
|
+
-0.1870999,
|
|
47
|
+
-0.09126389,
|
|
48
|
+
-0.01173261,
|
|
49
|
+
0.01668092,
|
|
50
|
+
0.00449685,
|
|
51
|
+
-0.03245584,
|
|
52
|
+
-0.07189206,
|
|
53
|
+
-0.09525084,
|
|
54
|
+
]
|
|
55
|
+
)
|
|
56
|
+
v2 = np.array(
|
|
57
|
+
[
|
|
58
|
+
0.40215528,
|
|
59
|
+
0.38603891,
|
|
60
|
+
0.35140285,
|
|
61
|
+
0.3215263,
|
|
62
|
+
0.27873781,
|
|
63
|
+
0.27077387,
|
|
64
|
+
0.24593958,
|
|
65
|
+
0.28406281,
|
|
66
|
+
0.29895396,
|
|
67
|
+
0.28722011,
|
|
68
|
+
0.25734356,
|
|
69
|
+
0.27006701,
|
|
70
|
+
0.27350706,
|
|
71
|
+
0.25635396,
|
|
72
|
+
0.21898472,
|
|
73
|
+
0.17379291,
|
|
74
|
+
0.08331504,
|
|
75
|
+
0.03039491,
|
|
76
|
+
-0.00202633,
|
|
77
|
+
-0.00801106,
|
|
78
|
+
0.01757721,
|
|
79
|
+
0.03845309,
|
|
80
|
+
0.04877323,
|
|
81
|
+
0.03812323,
|
|
82
|
+
0.03562566,
|
|
83
|
+
0.03322234,
|
|
84
|
+
-0.01041438,
|
|
85
|
+
-0.06894225,
|
|
86
|
+
-0.13345486,
|
|
87
|
+
-0.18703472,
|
|
88
|
+
-0.24862564,
|
|
89
|
+
-0.31921723,
|
|
90
|
+
-0.40314488,
|
|
91
|
+
-0.44697009,
|
|
92
|
+
-0.40724466,
|
|
93
|
+
-0.29188537,
|
|
94
|
+
-0.12044866,
|
|
95
|
+
0.03199712,
|
|
96
|
+
0.10329557,
|
|
97
|
+
0.10706548,
|
|
98
|
+
0.01050863,
|
|
99
|
+
-0.04231725,
|
|
100
|
+
]
|
|
101
|
+
)
|
|
102
|
+
u = np.array(
|
|
103
|
+
[
|
|
104
|
+
6.31617203,
|
|
105
|
+
6.14966762,
|
|
106
|
+
5.69570748,
|
|
107
|
+
4.84433587,
|
|
108
|
+
4.62913678,
|
|
109
|
+
4.51132705,
|
|
110
|
+
3.91756604,
|
|
111
|
+
4.66997748,
|
|
112
|
+
4.9165925,
|
|
113
|
+
5.0029863,
|
|
114
|
+
4.78307482,
|
|
115
|
+
4.5333182,
|
|
116
|
+
4.75794207,
|
|
117
|
+
4.43121644,
|
|
118
|
+
3.68980057,
|
|
119
|
+
2.83057498,
|
|
120
|
+
1.02101761,
|
|
121
|
+
0.04555309,
|
|
122
|
+
0.18064158,
|
|
123
|
+
-0.02199115,
|
|
124
|
+
0.40840704,
|
|
125
|
+
0.80896011,
|
|
126
|
+
0.94561939,
|
|
127
|
+
0.69272118,
|
|
128
|
+
0.49480084,
|
|
129
|
+
0.44610616,
|
|
130
|
+
-0.0408407,
|
|
131
|
+
-1.22836273,
|
|
132
|
+
-2.37975644,
|
|
133
|
+
-3.24212362,
|
|
134
|
+
-4.06836249,
|
|
135
|
+
-5.40353936,
|
|
136
|
+
-6.76227819,
|
|
137
|
+
-7.06544188,
|
|
138
|
+
-6.70572952,
|
|
139
|
+
-5.23703495,
|
|
140
|
+
-1.99805293,
|
|
141
|
+
0.25289821,
|
|
142
|
+
1.52053084,
|
|
143
|
+
1.53623881,
|
|
144
|
+
0.01413717,
|
|
145
|
+
-0.73356188,
|
|
146
|
+
]
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
if __name__ == "__main__":
|
|
150
|
+
t = np.linspace(0.0, 1.0, len(v1))
|
|
151
|
+
uplot.plot2(
|
|
152
|
+
t,
|
|
153
|
+
left=[v1, v2],
|
|
154
|
+
right=[u],
|
|
155
|
+
title="Plot with left and right axes",
|
|
156
|
+
left_labels=["v1", "v2"],
|
|
157
|
+
right_labels=["u"],
|
|
158
|
+
)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
import uplot
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
12
|
+
data = [
|
|
13
|
+
t,
|
|
14
|
+
np.exp(0.42 * t),
|
|
15
|
+
]
|
|
16
|
+
opts = {
|
|
17
|
+
"width": 1920,
|
|
18
|
+
"height": 600,
|
|
19
|
+
"title": "Simple plot",
|
|
20
|
+
"scales": {
|
|
21
|
+
"x": {
|
|
22
|
+
"time": False,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
"series": [
|
|
26
|
+
{},
|
|
27
|
+
{
|
|
28
|
+
"stroke": "red",
|
|
29
|
+
"fill": "rgba(255,0,0,0.1)",
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
}
|
|
33
|
+
uplot.plot(opts, data)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
8
|
+
import uplot
|
|
9
|
+
|
|
10
|
+
if __name__ == "__main__":
|
|
11
|
+
t = np.linspace(0.0, 1.0, 10)
|
|
12
|
+
uplot.plot2(
|
|
13
|
+
t,
|
|
14
|
+
[np.exp(0.1 * t), np.exp(-10.0 * t), np.cos(t)],
|
|
15
|
+
title="Simple plot",
|
|
16
|
+
left_labels=["exp(0.1 t)", "exp(-K t)", "cos(t)"],
|
|
17
|
+
)
|