rsnumpy 1.0.2__tar.gz → 1.0.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.
Files changed (35) hide show
  1. rsnumpy-1.0.6/.github/workflows/ci.yml +89 -0
  2. rsnumpy-1.0.6/.github/workflows/release.yml +132 -0
  3. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/.gitignore +5 -3
  4. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/Cargo.lock +40 -294
  5. rsnumpy-1.0.6/Cargo.toml +42 -0
  6. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/PKG-INFO +13 -2
  7. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/RELEASE_NOTES.md +3 -3
  8. rsnumpy-1.0.6/build_wheel.sh +155 -0
  9. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/pyproject.toml +15 -2
  10. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/__init__.py +67 -9
  11. rsnumpy-1.0.6/rust-toolchain.toml +2 -0
  12. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/src/fft.rs +16 -16
  13. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/src/indexing.rs +151 -63
  14. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/src/lib.rs +1145 -411
  15. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/src/linalg.rs +340 -152
  16. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/src/random.rs +173 -79
  17. rsnumpy-1.0.6/test/run_test.py +1674 -0
  18. rsnumpy-1.0.2/.github/ci.yml +0 -140
  19. rsnumpy-1.0.2/.github/release.yml +0 -84
  20. rsnumpy-1.0.2/.github/workflows/rust-clippy.yml +0 -55
  21. rsnumpy-1.0.2/Cargo.toml +0 -36
  22. rsnumpy-1.0.2/build_wheel.sh +0 -93
  23. rsnumpy-1.0.2/plots.py +0 -1086
  24. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/LICENSE +0 -0
  25. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/README.md +0 -0
  26. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/array_methods.py +0 -0
  27. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/array_ops.py +0 -0
  28. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/char.py +0 -0
  29. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/io.py +0 -0
  30. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/linalg/__init__.py +0 -0
  31. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/math_functions.py +0 -0
  32. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/matlib.py +0 -0
  33. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/polynomial/__init__.py +0 -0
  34. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/random/__init__.py +0 -0
  35. {rsnumpy-1.0.2 → rsnumpy-1.0.6}/python/rsnumpy/statistics.py +0 -0
@@ -0,0 +1,89 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, master, dev, main-dev]
6
+ pull_request:
7
+ branches: [main, master, dev, main-dev]
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
+ env:
22
+ PYTHONUTF8: 1
23
+ PYTHONIOENCODING: utf-8
24
+ strategy:
25
+ fail-fast: false
26
+ matrix:
27
+ os: [ubuntu-latest, windows-latest, macos-latest]
28
+ python-version: ["3.10", "3.13", "3.14"]
29
+ include:
30
+ - os: ubuntu-latest
31
+ python-version: "3.10"
32
+ - os: windows-latest
33
+ python-version: "3.10"
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+
37
+ - name: Cache Rust build artifacts
38
+ uses: actions/cache@v4
39
+ with:
40
+ path: |
41
+ ~/.cargo/registry
42
+ ~/.cargo/git
43
+ target
44
+ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
45
+ restore-keys: |
46
+ ${{ runner.os }}-cargo-
47
+
48
+ - uses: actions/setup-python@v5
49
+ with:
50
+ python-version: ${{ matrix.python-version }}
51
+
52
+ - name: Build wheel
53
+ uses: PyO3/maturin-action@v1
54
+ with:
55
+ command: build
56
+ # -i python 绑定到当前矩阵版本;container:'off' 让 Linux 也直接在宿主机构建,
57
+ # 从而与 setup-python 的版本一致(CI 只需能导入运行,无需 manylinux 合规)。
58
+ args: --release --out dist -i python
59
+ container: "off"
60
+ sccache: "true"
61
+
62
+ - name: Install built wheel
63
+ run: python -m pip install --no-index --find-links dist rsnumpy
64
+
65
+ - name: Run smoke test
66
+ run: python test/run_test.py
67
+
68
+ lint:
69
+ name: Lint (rustfmt + clippy)
70
+ runs-on: ubuntu-latest
71
+ steps:
72
+ - uses: actions/checkout@v4
73
+
74
+ # pyo3 的 build script 需要一个 Python 解释器来探测 ABI。
75
+ - uses: actions/setup-python@v5
76
+ with:
77
+ python-version: "3.13"
78
+
79
+ - uses: dtolnay/rust-toolchain@stable
80
+ with:
81
+ components: rustfmt, clippy
82
+
83
+ - uses: Swatinem/rust-cache@v2
84
+
85
+ - name: Check formatting
86
+ run: cargo fmt --all -- --check
87
+
88
+ - name: Run clippy
89
+ 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/*
@@ -14,7 +14,6 @@ dist/
14
14
  build/
15
15
  *.egg
16
16
  .venv/
17
- test/
18
17
  venv/
19
18
  uv.lock
20
19
 
@@ -30,16 +29,19 @@ uv.lock
30
29
  Thumbs.db
31
30
 
32
31
  # Data / plots
32
+ debug.txt
33
+ test_old.txt
33
34
  out.txt
34
35
  outfile.npy
35
36
  runoob.npz
36
37
  outfile2
37
38
  push*.sh
38
39
  main*.py
39
- test*.py
40
- run*.py
41
40
  debug*.py
42
41
  check*.py
42
+ test2*.py
43
+ map*.jpeg
44
+ *.png
43
45
 
44
46
  # Environment
45
47
  .venv