rsplotlib 0.1.6__tar.gz → 0.2.6__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.
- rsplotlib-0.2.6/.github/workflows/ci.yml +82 -0
- rsplotlib-0.2.6/.github/workflows/release.yml +132 -0
- rsplotlib-0.2.6/.github/workflows/rust.yml +61 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/.gitignore +4 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/Cargo.lock +104 -23
- rsplotlib-0.2.6/Cargo.toml +33 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/PKG-INFO +32 -25
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/README.md +41 -30
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/README_zh.md +29 -21
- rsplotlib-0.2.6/build_wheel.sh +155 -0
- rsplotlib-0.2.6/ci/smoke_test.py +17 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/pyproject.toml +3 -5
- rsplotlib-0.2.6/python/rsplotlib/__init__.py +23 -0
- rsplotlib-0.2.6/python/rsplotlib/colors.py +147 -0
- rsplotlib-0.2.6/python/rsplotlib/core/__init__.py +2 -0
- {rsplotlib-0.1.6/python/rsplotlib → rsplotlib-0.2.6/python/rsplotlib/core}/api.py +75 -42
- rsplotlib-0.2.6/python/rsplotlib/dates.py +85 -0
- rsplotlib-0.2.6/python/rsplotlib/figure/__init__.py +2 -0
- rsplotlib-0.1.6/python/rsplotlib/_figure_defaults.py → rsplotlib-0.2.6/python/rsplotlib/figure/_defaults.py +5 -2
- rsplotlib-0.2.6/python/rsplotlib/gridspec.py +6 -0
- rsplotlib-0.2.6/python/rsplotlib/layout/__init__.py +2 -0
- rsplotlib-0.2.6/python/rsplotlib/layout/gridspec.py +161 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/python/rsplotlib/pylab.py +3 -1
- rsplotlib-0.2.6/python/rsplotlib/pyplot.py +3016 -0
- rsplotlib-0.2.6/python/rsplotlib/ticker.py +6 -0
- rsplotlib-0.2.6/python/rsplotlib/ticks/__init__.py +2 -0
- rsplotlib-0.2.6/python/rsplotlib/ticks/ticker.py +269 -0
- rsplotlib-0.2.6/python/rsplotlib/utils/__init__.py +2 -0
- rsplotlib-0.2.6/python/rsplotlib/utils/_font_resolver.py +34 -0
- rsplotlib-0.2.6/python/rsplotlib/utils/_rcparams.py +103 -0
- {rsplotlib-0.1.6/python/rsplotlib → rsplotlib-0.2.6/python/rsplotlib/utils}/style.py +20 -9
- rsplotlib-0.2.6/src/core/colormap.rs +559 -0
- rsplotlib-0.2.6/src/core/colors.rs +240 -0
- rsplotlib-0.2.6/src/core/elements.rs +232 -0
- rsplotlib-0.2.6/src/core/marker.rs +199 -0
- rsplotlib-0.2.6/src/core/mod.rs +4 -0
- rsplotlib-0.2.6/src/figure/axes.rs +3304 -0
- rsplotlib-0.2.6/src/figure/axes_bounds.rs +593 -0
- rsplotlib-0.2.6/src/figure/axes_colorbar.rs +529 -0
- {rsplotlib-0.1.6/src → rsplotlib-0.2.6/src/figure}/axes_grid.rs +57 -24
- rsplotlib-0.2.6/src/figure/axes_legend.rs +580 -0
- {rsplotlib-0.1.6/src → rsplotlib-0.2.6/src/figure}/axes_mesh.rs +174 -33
- rsplotlib-0.2.6/src/figure/axes_render_elements.rs +2505 -0
- rsplotlib-0.2.6/src/figure/axes_secondary.rs +388 -0
- rsplotlib-0.2.6/src/figure/axes_title.rs +216 -0
- rsplotlib-0.2.6/src/figure/axis.rs +356 -0
- rsplotlib-0.2.6/src/figure/figure.rs +2137 -0
- rsplotlib-0.2.6/src/figure/mod.rs +12 -0
- rsplotlib-0.2.6/src/layout/gridspec.rs +268 -0
- rsplotlib-0.2.6/src/layout/mod.rs +1 -0
- rsplotlib-0.2.6/src/lib.rs +293 -0
- rsplotlib-0.2.6/src/ticks/mod.rs +1 -0
- rsplotlib-0.2.6/src/ticks/ticker.rs +485 -0
- rsplotlib-0.2.6/src/utils/font_resolver.rs +615 -0
- rsplotlib-0.2.6/src/utils/font_stack.rs +238 -0
- rsplotlib-0.2.6/src/utils/mathtext.rs +1097 -0
- rsplotlib-0.2.6/src/utils/mod.rs +5 -0
- rsplotlib-0.2.6/src/utils/pyfuncs.rs +1387 -0
- rsplotlib-0.2.6/src/utils/style.rs +53 -0
- rsplotlib-0.2.6/tutorial.css +1721 -0
- rsplotlib-0.2.6/tutorial.html +2398 -0
- rsplotlib-0.2.6/tutorial.js +313 -0
- rsplotlib-0.1.6/.github/ci.yml +0 -60
- rsplotlib-0.1.6/.github/release.yml +0 -84
- rsplotlib-0.1.6/Cargo.toml +0 -14
- rsplotlib-0.1.6/build_wheel.sh +0 -83
- rsplotlib-0.1.6/python/rsplotlib/__init__.py +0 -15
- rsplotlib-0.1.6/python/rsplotlib/_rcparams.py +0 -58
- rsplotlib-0.1.6/python/rsplotlib/gridspec.py +0 -122
- rsplotlib-0.1.6/python/rsplotlib/pyplot.py +0 -996
- rsplotlib-0.1.6/python/rsplotlib/ticker.py +0 -278
- rsplotlib-0.1.6/src/axes.rs +0 -1668
- rsplotlib-0.1.6/src/axes_bounds.rs +0 -377
- rsplotlib-0.1.6/src/axes_legend.rs +0 -200
- rsplotlib-0.1.6/src/axes_render_elements.rs +0 -1117
- rsplotlib-0.1.6/src/axes_title.rs +0 -60
- rsplotlib-0.1.6/src/axis.rs +0 -288
- rsplotlib-0.1.6/src/colormap.rs +0 -166
- rsplotlib-0.1.6/src/colors.rs +0 -85
- rsplotlib-0.1.6/src/elements.rs +0 -179
- rsplotlib-0.1.6/src/figure.rs +0 -411
- rsplotlib-0.1.6/src/lib.rs +0 -219
- rsplotlib-0.1.6/src/marker.rs +0 -144
- rsplotlib-0.1.6/src/pyfuncs.rs +0 -859
- rsplotlib-0.1.6/src/text_utils.rs +0 -264
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/LICENSE +0 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/python/rsplotlib/_font_resolver.py +0 -0
- {rsplotlib-0.1.6 → rsplotlib-0.2.6}/rust-toolchain.toml +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
# 同一分支/PR 的新推送会取消仍在进行的旧运行,节省 CI 时间。
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
test:
|
|
19
|
+
name: Test (${{ matrix.os }}, py${{ matrix.python-version }})
|
|
20
|
+
runs-on: ${{ matrix.os }}
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
25
|
+
python-version: ["3.10", "3.13", "3.14"]
|
|
26
|
+
# 补测最低支持版本 3.8;macOS(arm64) 对 3.8 支持不稳定,故仅在 Linux/Windows 上测。
|
|
27
|
+
include:
|
|
28
|
+
- os: ubuntu-latest
|
|
29
|
+
python-version: "3.10"
|
|
30
|
+
- os: windows-latest
|
|
31
|
+
python-version: "3.10"
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v4
|
|
34
|
+
|
|
35
|
+
# Linux runner 默认不带字体,plotters 渲染文本会报 FontUnavailable。
|
|
36
|
+
# DejaVu 会安装到 /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf,正是解析器的 Linux 首选路径。
|
|
37
|
+
- name: Install fonts (Linux)
|
|
38
|
+
if: runner.os == 'Linux'
|
|
39
|
+
run: sudo apt-get update && sudo apt-get install -y fonts-dejavu-core
|
|
40
|
+
|
|
41
|
+
- uses: actions/setup-python@v5
|
|
42
|
+
with:
|
|
43
|
+
python-version: ${{ matrix.python-version }}
|
|
44
|
+
|
|
45
|
+
- name: Build wheel
|
|
46
|
+
uses: PyO3/maturin-action@v1
|
|
47
|
+
with:
|
|
48
|
+
command: build
|
|
49
|
+
# -i python 绑定到当前矩阵版本;container:'off' 让 Linux 也直接在宿主机构建,
|
|
50
|
+
# 从而与 setup-python 的版本一致(CI 只需能导入运行,无需 manylinux 合规)。
|
|
51
|
+
args: --release --out dist -i python
|
|
52
|
+
container: "off"
|
|
53
|
+
sccache: "true"
|
|
54
|
+
|
|
55
|
+
- name: Install built wheel
|
|
56
|
+
run: python -m pip install --no-index --find-links dist rsplotlib
|
|
57
|
+
|
|
58
|
+
- name: Run smoke test
|
|
59
|
+
run: python ci/smoke_test.py
|
|
60
|
+
|
|
61
|
+
lint:
|
|
62
|
+
name: Lint (rustfmt + clippy)
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
steps:
|
|
65
|
+
- uses: actions/checkout@v4
|
|
66
|
+
|
|
67
|
+
# pyo3 的 build script 需要一个 Python 解释器来探测 ABI。
|
|
68
|
+
- uses: actions/setup-python@v5
|
|
69
|
+
with:
|
|
70
|
+
python-version: "3.13"
|
|
71
|
+
|
|
72
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
73
|
+
with:
|
|
74
|
+
components: rustfmt, clippy
|
|
75
|
+
|
|
76
|
+
- uses: Swatinem/rust-cache@v2
|
|
77
|
+
|
|
78
|
+
- name: Check formatting
|
|
79
|
+
run: cargo fmt --all -- --check
|
|
80
|
+
|
|
81
|
+
- name: Run clippy
|
|
82
|
+
run: cargo clippy -- -D warnings
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
name: Build and Publish Wheels
|
|
2
|
+
|
|
3
|
+
# 触发方式:推送 v* 标签(如 v0.1.8)或在 GitHub 上 Publish 一个 Release。
|
|
4
|
+
# 也可在 Actions 页手动触发(workflow_dispatch)——手动触发只构建、不发布。
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
release:
|
|
10
|
+
types: [published]
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
# ---------------- Linux: x86_64 + aarch64 ----------------
|
|
18
|
+
# manylinux 容器内含全部 CPython,--find-interpreter 自动为每个版本各产出一个 wheel。
|
|
19
|
+
linux:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
target: [x86_64, aarch64]
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
|
|
28
|
+
- name: Build wheels (${{ matrix.target }})
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
target: ${{ matrix.target }}
|
|
32
|
+
manylinux: auto
|
|
33
|
+
args: --release --out dist --find-interpreter
|
|
34
|
+
|
|
35
|
+
- uses: actions/upload-artifact@v4
|
|
36
|
+
with:
|
|
37
|
+
name: wheels-linux-${{ matrix.target }}
|
|
38
|
+
path: dist
|
|
39
|
+
|
|
40
|
+
# ---------------- Windows: x64,按 Python 版本矩阵 ----------------
|
|
41
|
+
windows:
|
|
42
|
+
runs-on: windows-latest
|
|
43
|
+
strategy:
|
|
44
|
+
fail-fast: false
|
|
45
|
+
matrix:
|
|
46
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
47
|
+
steps:
|
|
48
|
+
- uses: actions/checkout@v4
|
|
49
|
+
|
|
50
|
+
- uses: actions/setup-python@v5
|
|
51
|
+
with:
|
|
52
|
+
python-version: ${{ matrix.python-version }}
|
|
53
|
+
architecture: x64
|
|
54
|
+
|
|
55
|
+
- name: Build wheel (py${{ matrix.python-version }})
|
|
56
|
+
uses: PyO3/maturin-action@v1
|
|
57
|
+
with:
|
|
58
|
+
# -i python 指向 setup-python 激活的解释器,确保为当前矩阵版本构建。
|
|
59
|
+
args: --release --out dist -i python
|
|
60
|
+
|
|
61
|
+
- uses: actions/upload-artifact@v4
|
|
62
|
+
with:
|
|
63
|
+
name: wheels-windows-${{ matrix.python-version }}
|
|
64
|
+
path: dist
|
|
65
|
+
|
|
66
|
+
# ---------------- macOS: universal2(Intel + Apple Silicon),按版本矩阵 ----------------
|
|
67
|
+
# macos-13(Intel) runner 已退役,改在 arm64 runner 上交叉编译 universal2,
|
|
68
|
+
# 一个 wheel 同时兼容 x86_64 与 arm64,无需 Intel 机器。
|
|
69
|
+
macos:
|
|
70
|
+
runs-on: macos-latest
|
|
71
|
+
strategy:
|
|
72
|
+
fail-fast: false
|
|
73
|
+
matrix:
|
|
74
|
+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v4
|
|
77
|
+
|
|
78
|
+
- uses: actions/setup-python@v5
|
|
79
|
+
with:
|
|
80
|
+
python-version: ${{ matrix.python-version }}
|
|
81
|
+
|
|
82
|
+
- name: Build universal2 wheel (py${{ matrix.python-version }})
|
|
83
|
+
uses: PyO3/maturin-action@v1
|
|
84
|
+
with:
|
|
85
|
+
target: universal2-apple-darwin
|
|
86
|
+
args: --release --out dist -i python
|
|
87
|
+
|
|
88
|
+
- uses: actions/upload-artifact@v4
|
|
89
|
+
with:
|
|
90
|
+
name: wheels-macos-${{ matrix.python-version }}
|
|
91
|
+
path: dist
|
|
92
|
+
|
|
93
|
+
# ---------------- 源码分发(sdist)----------------
|
|
94
|
+
# 当某平台/版本无预编译 wheel 时,pip 可用 sdist 从源码构建(需目标机器有 Rust)。
|
|
95
|
+
sdist:
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
steps:
|
|
98
|
+
- uses: actions/checkout@v4
|
|
99
|
+
|
|
100
|
+
- name: Build sdist
|
|
101
|
+
uses: PyO3/maturin-action@v1
|
|
102
|
+
with:
|
|
103
|
+
command: sdist
|
|
104
|
+
args: --out dist
|
|
105
|
+
|
|
106
|
+
- uses: actions/upload-artifact@v4
|
|
107
|
+
with:
|
|
108
|
+
name: wheels-sdist
|
|
109
|
+
path: dist
|
|
110
|
+
|
|
111
|
+
# ---------------- 发布到 PyPI(仅标签 / Release 触发)----------------
|
|
112
|
+
publish:
|
|
113
|
+
name: Publish to PyPI
|
|
114
|
+
runs-on: ubuntu-latest
|
|
115
|
+
needs: [linux, windows, macos, sdist]
|
|
116
|
+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
|
|
117
|
+
steps:
|
|
118
|
+
- name: Download all artifacts
|
|
119
|
+
uses: actions/download-artifact@v4
|
|
120
|
+
with:
|
|
121
|
+
pattern: wheels-*
|
|
122
|
+
path: dist
|
|
123
|
+
merge-multiple: true
|
|
124
|
+
|
|
125
|
+
- name: Publish
|
|
126
|
+
uses: PyO3/maturin-action@v1
|
|
127
|
+
env:
|
|
128
|
+
# 仓库 Settings → Secrets and variables → Actions 中的 secret 名(值为 PyPI token,以 pypi- 开头)。
|
|
129
|
+
MATURIN_PYPI_TOKEN: ${{ secrets.YJ_NIU }}
|
|
130
|
+
with:
|
|
131
|
+
command: upload
|
|
132
|
+
args: --non-interactive --skip-existing dist/*
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
name: Rust Checks
|
|
2
|
+
|
|
3
|
+
# dev 分支的快速 Rust 静态检查(fmt + clippy)。
|
|
4
|
+
# 完整的 maturin 构建 / wheel / 冒烟测试由 main 分支的 ci.yml 负责。
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [dev]
|
|
8
|
+
pull_request:
|
|
9
|
+
branches: [dev]
|
|
10
|
+
|
|
11
|
+
# 同一分支/PR 的新推送会取消仍在进行的旧运行,节省 CI 时间。
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
env:
|
|
20
|
+
CARGO_TERM_COLOR: always
|
|
21
|
+
RUST_BACKTRACE: 1
|
|
22
|
+
|
|
23
|
+
jobs:
|
|
24
|
+
checks:
|
|
25
|
+
name: fmt + clippy (${{ matrix.os }})
|
|
26
|
+
runs-on: ${{ matrix.os }}
|
|
27
|
+
strategy:
|
|
28
|
+
fail-fast: false
|
|
29
|
+
# 三大平台都跑 clippy:src/lib.rs 中的字体注册逻辑按
|
|
30
|
+
# #[cfg(target_os = "macos" / "linux" / "windows")] 分支实现,
|
|
31
|
+
# 只有在对应平台上 clippy 才会真正检查到这些代码。
|
|
32
|
+
matrix:
|
|
33
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
34
|
+
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
|
|
38
|
+
# pyo3 的 build script 需要一个 Python 解释器来探测 ABI / 版本,
|
|
39
|
+
# 否则 cargo clippy / check 无法编译(找不到 Python 配置)。
|
|
40
|
+
- uses: actions/setup-python@v5
|
|
41
|
+
with:
|
|
42
|
+
python-version: "3.13"
|
|
43
|
+
|
|
44
|
+
- name: Install Rust toolchain
|
|
45
|
+
uses: dtolnay/rust-toolchain@stable
|
|
46
|
+
with:
|
|
47
|
+
components: clippy, rustfmt
|
|
48
|
+
|
|
49
|
+
# 按操作系统自动隔离缓存,rust-cache 默认已区分 runner OS。
|
|
50
|
+
- uses: Swatinem/rust-cache@v2
|
|
51
|
+
|
|
52
|
+
# 格式检查与平台无关,只需在一个平台上跑一次。
|
|
53
|
+
- name: Check formatting
|
|
54
|
+
if: matrix.os == 'ubuntu-latest'
|
|
55
|
+
run: cargo fmt --all -- --check
|
|
56
|
+
|
|
57
|
+
# clippy 走 cargo check 模式(不做最终链接),因此无需 extension-module,
|
|
58
|
+
# 也不会去链接 libpython。不加 --target:直接用各 runner 的原生架构
|
|
59
|
+
# (修复原先在 arm64 的 macos-latest 上交叉编译 x86_64-apple-darwin 的问题)。
|
|
60
|
+
- name: Run clippy
|
|
61
|
+
run: cargo clippy --all-targets -- -D warnings
|
|
@@ -36,6 +36,12 @@ version = "1.3.2"
|
|
|
36
36
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
37
37
|
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
38
38
|
|
|
39
|
+
[[package]]
|
|
40
|
+
name = "bitflags"
|
|
41
|
+
version = "2.13.0"
|
|
42
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
43
|
+
checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8"
|
|
44
|
+
|
|
39
45
|
[[package]]
|
|
40
46
|
name = "bumpalo"
|
|
41
47
|
version = "3.20.3"
|
|
@@ -75,6 +81,37 @@ dependencies = [
|
|
|
75
81
|
"cfg-if",
|
|
76
82
|
]
|
|
77
83
|
|
|
84
|
+
[[package]]
|
|
85
|
+
name = "crossbeam-deque"
|
|
86
|
+
version = "0.8.7"
|
|
87
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
88
|
+
checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb"
|
|
89
|
+
dependencies = [
|
|
90
|
+
"crossbeam-epoch",
|
|
91
|
+
"crossbeam-utils",
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
[[package]]
|
|
95
|
+
name = "crossbeam-epoch"
|
|
96
|
+
version = "0.9.20"
|
|
97
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
98
|
+
checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f"
|
|
99
|
+
dependencies = [
|
|
100
|
+
"crossbeam-utils",
|
|
101
|
+
]
|
|
102
|
+
|
|
103
|
+
[[package]]
|
|
104
|
+
name = "crossbeam-utils"
|
|
105
|
+
version = "0.8.22"
|
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
107
|
+
checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
|
|
108
|
+
|
|
109
|
+
[[package]]
|
|
110
|
+
name = "either"
|
|
111
|
+
version = "1.16.0"
|
|
112
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
113
|
+
checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e"
|
|
114
|
+
|
|
78
115
|
[[package]]
|
|
79
116
|
name = "fdeflate"
|
|
80
117
|
version = "0.3.7"
|
|
@@ -135,7 +172,7 @@ dependencies = [
|
|
|
135
172
|
"color_quant",
|
|
136
173
|
"jpeg-decoder",
|
|
137
174
|
"num-traits",
|
|
138
|
-
"png",
|
|
175
|
+
"png 0.17.16",
|
|
139
176
|
]
|
|
140
177
|
|
|
141
178
|
[[package]]
|
|
@@ -143,16 +180,24 @@ name = "jpeg-decoder"
|
|
|
143
180
|
version = "0.3.2"
|
|
144
181
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
145
182
|
checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07"
|
|
183
|
+
dependencies = [
|
|
184
|
+
"rayon",
|
|
185
|
+
]
|
|
186
|
+
|
|
187
|
+
[[package]]
|
|
188
|
+
name = "jpeg-encoder"
|
|
189
|
+
version = "0.7.0"
|
|
190
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
+
checksum = "0b0b36cbb4e6704f12f5b5d7b01dac593982c6550859ebd5a66fb15c9ea27fd5"
|
|
146
192
|
|
|
147
193
|
[[package]]
|
|
148
194
|
name = "js-sys"
|
|
149
|
-
version = "0.3.
|
|
195
|
+
version = "0.3.103"
|
|
150
196
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
151
|
-
checksum = "
|
|
197
|
+
checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102"
|
|
152
198
|
dependencies = [
|
|
153
199
|
"cfg-if",
|
|
154
200
|
"futures-util",
|
|
155
|
-
"once_cell",
|
|
156
201
|
"wasm-bindgen",
|
|
157
202
|
]
|
|
158
203
|
|
|
@@ -249,7 +294,20 @@ version = "0.17.16"
|
|
|
249
294
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
295
|
checksum = "82151a2fc869e011c153adc57cf2789ccb8d9906ce52c0b39a6b5697749d7526"
|
|
251
296
|
dependencies = [
|
|
252
|
-
"bitflags",
|
|
297
|
+
"bitflags 1.3.2",
|
|
298
|
+
"crc32fast",
|
|
299
|
+
"fdeflate",
|
|
300
|
+
"flate2",
|
|
301
|
+
"miniz_oxide",
|
|
302
|
+
]
|
|
303
|
+
|
|
304
|
+
[[package]]
|
|
305
|
+
name = "png"
|
|
306
|
+
version = "0.18.1"
|
|
307
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
308
|
+
checksum = "60769b8b31b2a9f263dae2776c37b1b28ae246943cf719eb6946a1db05128a61"
|
|
309
|
+
dependencies = [
|
|
310
|
+
"bitflags 2.13.0",
|
|
253
311
|
"crc32fast",
|
|
254
312
|
"fdeflate",
|
|
255
313
|
"flate2",
|
|
@@ -330,27 +388,50 @@ dependencies = [
|
|
|
330
388
|
|
|
331
389
|
[[package]]
|
|
332
390
|
name = "quote"
|
|
333
|
-
version = "1.0.
|
|
391
|
+
version = "1.0.46"
|
|
334
392
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
335
|
-
checksum = "
|
|
393
|
+
checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368"
|
|
336
394
|
dependencies = [
|
|
337
395
|
"proc-macro2",
|
|
338
396
|
]
|
|
339
397
|
|
|
398
|
+
[[package]]
|
|
399
|
+
name = "rayon"
|
|
400
|
+
version = "1.12.0"
|
|
401
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
402
|
+
checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
|
|
403
|
+
dependencies = [
|
|
404
|
+
"either",
|
|
405
|
+
"rayon-core",
|
|
406
|
+
]
|
|
407
|
+
|
|
408
|
+
[[package]]
|
|
409
|
+
name = "rayon-core"
|
|
410
|
+
version = "1.13.0"
|
|
411
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
412
|
+
checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
|
|
413
|
+
dependencies = [
|
|
414
|
+
"crossbeam-deque",
|
|
415
|
+
"crossbeam-utils",
|
|
416
|
+
]
|
|
417
|
+
|
|
340
418
|
[[package]]
|
|
341
419
|
name = "rsplotlib"
|
|
342
|
-
version = "0.
|
|
420
|
+
version = "0.2.6"
|
|
343
421
|
dependencies = [
|
|
422
|
+
"jpeg-decoder",
|
|
423
|
+
"jpeg-encoder",
|
|
424
|
+
"owned_ttf_parser",
|
|
344
425
|
"plotters",
|
|
345
|
-
"png",
|
|
426
|
+
"png 0.18.1",
|
|
346
427
|
"pyo3",
|
|
347
428
|
]
|
|
348
429
|
|
|
349
430
|
[[package]]
|
|
350
431
|
name = "rustversion"
|
|
351
|
-
version = "1.0.
|
|
432
|
+
version = "1.0.23"
|
|
352
433
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
353
|
-
checksum = "
|
|
434
|
+
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
|
354
435
|
|
|
355
436
|
[[package]]
|
|
356
437
|
name = "simd-adler32"
|
|
@@ -366,9 +447,9 @@ checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
|
|
|
366
447
|
|
|
367
448
|
[[package]]
|
|
368
449
|
name = "syn"
|
|
369
|
-
version = "2.0.
|
|
450
|
+
version = "2.0.118"
|
|
370
451
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
371
|
-
checksum = "
|
|
452
|
+
checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422"
|
|
372
453
|
dependencies = [
|
|
373
454
|
"proc-macro2",
|
|
374
455
|
"quote",
|
|
@@ -395,9 +476,9 @@ checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
|
|
|
395
476
|
|
|
396
477
|
[[package]]
|
|
397
478
|
name = "wasm-bindgen"
|
|
398
|
-
version = "0.2.
|
|
479
|
+
version = "0.2.126"
|
|
399
480
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
400
|
-
checksum = "
|
|
481
|
+
checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4"
|
|
401
482
|
dependencies = [
|
|
402
483
|
"cfg-if",
|
|
403
484
|
"once_cell",
|
|
@@ -408,9 +489,9 @@ dependencies = [
|
|
|
408
489
|
|
|
409
490
|
[[package]]
|
|
410
491
|
name = "wasm-bindgen-macro"
|
|
411
|
-
version = "0.2.
|
|
492
|
+
version = "0.2.126"
|
|
412
493
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
413
|
-
checksum = "
|
|
494
|
+
checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1"
|
|
414
495
|
dependencies = [
|
|
415
496
|
"quote",
|
|
416
497
|
"wasm-bindgen-macro-support",
|
|
@@ -418,9 +499,9 @@ dependencies = [
|
|
|
418
499
|
|
|
419
500
|
[[package]]
|
|
420
501
|
name = "wasm-bindgen-macro-support"
|
|
421
|
-
version = "0.2.
|
|
502
|
+
version = "0.2.126"
|
|
422
503
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
423
|
-
checksum = "
|
|
504
|
+
checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e"
|
|
424
505
|
dependencies = [
|
|
425
506
|
"bumpalo",
|
|
426
507
|
"proc-macro2",
|
|
@@ -431,18 +512,18 @@ dependencies = [
|
|
|
431
512
|
|
|
432
513
|
[[package]]
|
|
433
514
|
name = "wasm-bindgen-shared"
|
|
434
|
-
version = "0.2.
|
|
515
|
+
version = "0.2.126"
|
|
435
516
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
436
|
-
checksum = "
|
|
517
|
+
checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24"
|
|
437
518
|
dependencies = [
|
|
438
519
|
"unicode-ident",
|
|
439
520
|
]
|
|
440
521
|
|
|
441
522
|
[[package]]
|
|
442
523
|
name = "web-sys"
|
|
443
|
-
version = "0.3.
|
|
524
|
+
version = "0.3.103"
|
|
444
525
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
445
|
-
checksum = "
|
|
526
|
+
checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141"
|
|
446
527
|
dependencies = [
|
|
447
528
|
"js-sys",
|
|
448
529
|
"wasm-bindgen",
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "rsplotlib"
|
|
3
|
+
version = "0.2.6"
|
|
4
|
+
edition = "2024"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
|
|
7
|
+
[lib]
|
|
8
|
+
name = "rsplotlib"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
pyo3 = "0.29.0"
|
|
13
|
+
plotters = { version = "0.3.7", default-features = false, features = ["svg_backend", "bitmap_backend", "bitmap_encoder", "ab_glyph", "line_series", "point_series"] }
|
|
14
|
+
png = "0.18.1"
|
|
15
|
+
owned_ttf_parser = "0.25.1"
|
|
16
|
+
jpeg-encoder = "0.7.0"
|
|
17
|
+
jpeg-decoder = "0.3.2"
|
|
18
|
+
|
|
19
|
+
[profile.release]
|
|
20
|
+
lto = "fat"
|
|
21
|
+
codegen-units = 1
|
|
22
|
+
opt-level = 3
|
|
23
|
+
strip = "symbols"
|
|
24
|
+
|
|
25
|
+
[profile.dev]
|
|
26
|
+
opt-level = 0
|
|
27
|
+
debug = true
|
|
28
|
+
|
|
29
|
+
[lints.clippy]
|
|
30
|
+
too_many_arguments = "allow"
|
|
31
|
+
type_complexity = "allow"
|
|
32
|
+
cast_precision_loss = "allow"
|
|
33
|
+
cast_sign_loss = "allow"
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rsplotlib
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
7
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
9
7
|
Classifier: Programming Language :: Python :: 3.10
|
|
10
8
|
Classifier: Programming Language :: Python :: 3.11
|
|
11
9
|
Classifier: Programming Language :: Python :: 3.12
|
|
12
10
|
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
13
12
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
14
13
|
Classifier: License :: OSI Approved :: MIT License
|
|
15
14
|
Classifier: Operating System :: MacOS
|
|
@@ -21,15 +20,15 @@ Summary: A high-performance matplotlib-compatible plotting library powered by Ru
|
|
|
21
20
|
Keywords: plotting,matplotlib,visualization,rust,scientific
|
|
22
21
|
Author: YJ-Niu
|
|
23
22
|
License: MIT
|
|
24
|
-
Requires-Python: >=3.
|
|
23
|
+
Requires-Python: >=3.10
|
|
25
24
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
26
25
|
|
|
27
26
|
# rsplotlib
|
|
28
27
|
|
|
29
28
|
> 一个由 Rust 强力驱动的高性能 Python 绘图库,提供 Matplotlib 兼容 API
|
|
30
29
|
|
|
31
|
-
[](https://www.python.org/)
|
|
31
|
+
[](https://www.rust-lang.org/)
|
|
33
32
|
[](https://opensource.org/licenses/MIT)
|
|
34
33
|
[](https://pyo3.rs/)
|
|
35
34
|
[](https://github.com/plotters-rs/plotters)
|
|
@@ -121,11 +120,19 @@ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
|
121
120
|
|
|
122
121
|
| 依赖 | 版本要求 | 说明 |
|
|
123
122
|
| ------- | -------- | ---------------------- |
|
|
124
|
-
| Python | 3.
|
|
123
|
+
| Python | 3.10+ | CPython 实现 |
|
|
125
124
|
| Rust | 1.70+ | 从源码构建时需要 |
|
|
126
125
|
| maturin | 1.13+ | Rust-Python 包构建工具 |
|
|
127
126
|
|
|
128
|
-
###
|
|
127
|
+
### 方法一:从 PyPI 安装(推荐)
|
|
128
|
+
|
|
129
|
+
已为 Linux(x86_64/aarch64)、macOS(universal2)、Windows(x64)在 Python 3.10-3.14 上发布预编译 wheel,无需 Rust 工具链:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pip install rsplotlib
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### 方法二:使用 maturin 从源码构建(推荐开发者)
|
|
129
136
|
|
|
130
137
|
```bash
|
|
131
138
|
# 1. 克隆项目
|
|
@@ -137,17 +144,17 @@ pip install maturin
|
|
|
137
144
|
maturin develop --release
|
|
138
145
|
```
|
|
139
146
|
|
|
140
|
-
###
|
|
147
|
+
### 方法三:构建 wheel 包
|
|
141
148
|
|
|
142
149
|
```bash
|
|
143
|
-
#
|
|
150
|
+
# 使用项目提供的构建脚本(macOS/Linux 直接运行;Windows 请在 Git Bash 或 WSL 中运行)
|
|
144
151
|
./build_wheel.sh
|
|
145
152
|
|
|
146
153
|
# 安装生成的 wheel
|
|
147
154
|
pip install target/wheels/rsplotlib-*.whl
|
|
148
155
|
```
|
|
149
156
|
|
|
150
|
-
###
|
|
157
|
+
### 方法四:仅编译 Rust 扩展(调试用)
|
|
151
158
|
|
|
152
159
|
```bash
|
|
153
160
|
# 编译 Rust cdylib
|
|
@@ -385,19 +392,19 @@ plt.savefig('module_level.png')
|
|
|
385
392
|
|
|
386
393
|
### 图表配置
|
|
387
394
|
|
|
388
|
-
| 函数 | 说明
|
|
389
|
-
| -------------------------------------- |
|
|
390
|
-
| `title()` / `ax.set_title()` |
|
|
391
|
-
| `xlabel()` / `ax.set_xlabel()` | 设置 X
|
|
392
|
-
| `ylabel()` / `ax.set_ylabel()` | 设置 Y
|
|
393
|
-
| `grid()` | 显示/隐藏网格
|
|
394
|
-
| `legend()` | 显示图例
|
|
395
|
-
| `xlim()` / `ylim()` | 设置坐标轴范围
|
|
396
|
-
| `xticks()` / `yticks()` | 设置刻度位置和标签
|
|
397
|
-
| `xscale()` / `yscale()` | 设置坐标缩放(`linear` / `log`)
|
|
398
|
-
| `margins()` | 设置自动缩放边距
|
|
399
|
-
| `box()` | 设置坐标轴边框显示
|
|
400
|
-
| `minorticks_on()` / `minorticks_off()` | 次要刻度显示控制
|
|
395
|
+
| 函数 | 说明 |
|
|
396
|
+
| -------------------------------------- | ---------------------------------------------- |
|
|
397
|
+
| `title()` / `ax.set_title()` | 设置图表标题(`loc='left'/'center'/'right'`) |
|
|
398
|
+
| `xlabel()` / `ax.set_xlabel()` | 设置 X 轴标签(`loc='left'/'center'/'right'`) |
|
|
399
|
+
| `ylabel()` / `ax.set_ylabel()` | 设置 Y 轴标签(`loc='top'/'center'/'bottom'`) |
|
|
400
|
+
| `grid()` | 显示/隐藏网格 |
|
|
401
|
+
| `legend()` | 显示图例 |
|
|
402
|
+
| `xlim()` / `ylim()` | 设置坐标轴范围 |
|
|
403
|
+
| `xticks()` / `yticks()` | 设置刻度位置和标签 |
|
|
404
|
+
| `xscale()` / `yscale()` | 设置坐标缩放(`linear` / `log`) |
|
|
405
|
+
| `margins()` | 设置自动缩放边距 |
|
|
406
|
+
| `box()` | 设置坐标轴边框显示 |
|
|
407
|
+
| `minorticks_on()` / `minorticks_off()` | 次要刻度显示控制 |
|
|
401
408
|
|
|
402
409
|
### 子图与布局
|
|
403
410
|
|
|
@@ -771,5 +778,5 @@ MIT License — 详见 [LICENSE](LICENSE) 文件。
|
|
|
771
778
|
|
|
772
779
|
---
|
|
773
780
|
|
|
774
|
-
_最后更新:2026-
|
|
781
|
+
_最后更新:2026-07-03 · 版本 v0.1.9_
|
|
775
782
|
|