tensorderiv 0.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.
@@ -0,0 +1,5 @@
1
+ # Compile for the processor of this machine, including its fused multiply-add (FMA) instruction.
2
+ # Fine for local development and benchmarks; the published wheels use a portable baseline
3
+ # instead, set per platform in .github/workflows/CI.yml.
4
+ [build]
5
+ rustflags = ["-C", "target-cpu=native", "-C", "symbol-mangling-version=v0"]
@@ -0,0 +1,190 @@
1
+ # Generated by maturin v1.15.0 (maturin generate-ci github), then adapted, as for convinterp:
2
+ # - RUSTFLAGS per platform: a portable CPU baseline instead of .cargo/config.toml's target-cpu=native
3
+ # (x86-64-v3 on x86_64: AVX2 and FMA, every Intel and AMD processor since about 2015)
4
+ # - 64-bit platforms only, all with hardware fused multiply-add
5
+ # - trusted publishing to PyPI: no stored token
6
+ name: CI
7
+
8
+ on:
9
+ push:
10
+ branches:
11
+ - main
12
+ - master
13
+ tags:
14
+ - '*'
15
+ paths-ignore:
16
+ - 'docs/**' # documentation-only changes don't need new wheels
17
+ pull_request:
18
+ paths-ignore:
19
+ - 'docs/**'
20
+ workflow_dispatch:
21
+
22
+ permissions:
23
+ contents: read
24
+
25
+ jobs:
26
+ linux:
27
+ runs-on: ${{ matrix.platform.runner }}
28
+ strategy:
29
+ matrix:
30
+ platform:
31
+ - runner: ubuntu-22.04
32
+ target: x86_64
33
+ rustflags: -C target-cpu=x86-64-v3
34
+ - runner: ubuntu-22.04
35
+ target: aarch64
36
+ rustflags: -C symbol-mangling-version=v0
37
+ steps:
38
+ - uses: actions/checkout@v6
39
+ - uses: actions/setup-python@v6
40
+ with:
41
+ python-version: "3.9"
42
+ - name: Build wheels
43
+ uses: PyO3/maturin-action@v1
44
+ env:
45
+ RUSTFLAGS: ${{ matrix.platform.rustflags }}
46
+ with:
47
+ target: ${{ matrix.platform.target }}
48
+ args: --release --out dist --find-interpreter
49
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
50
+ manylinux: auto
51
+ - name: Upload wheels
52
+ uses: actions/upload-artifact@v6
53
+ with:
54
+ name: wheels-linux-${{ matrix.platform.target }}
55
+ path: dist
56
+
57
+ musllinux:
58
+ runs-on: ${{ matrix.platform.runner }}
59
+ strategy:
60
+ matrix:
61
+ platform:
62
+ - runner: ubuntu-22.04
63
+ target: x86_64
64
+ rustflags: -C target-cpu=x86-64-v3
65
+ - runner: ubuntu-22.04
66
+ target: aarch64
67
+ rustflags: -C symbol-mangling-version=v0
68
+ steps:
69
+ - uses: actions/checkout@v6
70
+ - uses: actions/setup-python@v6
71
+ with:
72
+ python-version: "3.9"
73
+ - name: Build wheels
74
+ uses: PyO3/maturin-action@v1
75
+ env:
76
+ RUSTFLAGS: ${{ matrix.platform.rustflags }}
77
+ with:
78
+ target: ${{ matrix.platform.target }}
79
+ args: --release --out dist --find-interpreter
80
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
81
+ manylinux: musllinux_1_2
82
+ - name: Upload wheels
83
+ uses: actions/upload-artifact@v6
84
+ with:
85
+ name: wheels-musllinux-${{ matrix.platform.target }}
86
+ path: dist
87
+
88
+ windows:
89
+ runs-on: ${{ matrix.platform.runner }}
90
+ strategy:
91
+ matrix:
92
+ platform:
93
+ - runner: windows-latest
94
+ target: x64
95
+ python_arch: x64
96
+ rustflags: -C target-cpu=x86-64-v3
97
+ - runner: windows-11-arm
98
+ target: aarch64
99
+ python_arch: arm64
100
+ rustflags: -C symbol-mangling-version=v0
101
+ steps:
102
+ - uses: actions/checkout@v6
103
+ - uses: actions/setup-python@v6
104
+ with:
105
+ python-version: "3.13"
106
+ architecture: ${{ matrix.platform.python_arch }}
107
+ - name: Build wheels
108
+ uses: PyO3/maturin-action@v1
109
+ env:
110
+ RUSTFLAGS: ${{ matrix.platform.rustflags }}
111
+ with:
112
+ target: ${{ matrix.platform.target }}
113
+ args: --release --out dist --find-interpreter
114
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
115
+ - name: Upload wheels
116
+ uses: actions/upload-artifact@v6
117
+ with:
118
+ name: wheels-windows-${{ matrix.platform.target }}
119
+ path: dist
120
+
121
+ macos:
122
+ runs-on: ${{ matrix.platform.runner }}
123
+ strategy:
124
+ matrix:
125
+ platform:
126
+ - runner: macos-15-intel
127
+ target: x86_64
128
+ rustflags: -C target-cpu=x86-64-v3
129
+ - runner: macos-latest
130
+ target: aarch64
131
+ rustflags: -C symbol-mangling-version=v0
132
+ steps:
133
+ - uses: actions/checkout@v6
134
+ - uses: actions/setup-python@v6
135
+ with:
136
+ python-version: "3.9"
137
+ - name: Build wheels
138
+ uses: PyO3/maturin-action@v1
139
+ env:
140
+ RUSTFLAGS: ${{ matrix.platform.rustflags }}
141
+ with:
142
+ target: ${{ matrix.platform.target }}
143
+ args: --release --out dist --find-interpreter
144
+ sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
145
+ - name: Upload wheels
146
+ uses: actions/upload-artifact@v6
147
+ with:
148
+ name: wheels-macos-${{ matrix.platform.target }}
149
+ path: dist
150
+
151
+ sdist:
152
+ runs-on: ubuntu-latest
153
+ steps:
154
+ - uses: actions/checkout@v6
155
+ - name: Build sdist
156
+ uses: PyO3/maturin-action@v1
157
+ with:
158
+ command: sdist
159
+ args: --out dist
160
+ - name: Upload sdist
161
+ uses: actions/upload-artifact@v6
162
+ with:
163
+ name: wheels-sdist
164
+ path: dist
165
+
166
+ release:
167
+ name: Release
168
+ runs-on: ubuntu-latest
169
+ if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
170
+ needs: [linux, musllinux, windows, macos, sdist]
171
+ permissions:
172
+ # Used for trusted publishing to PyPI and to sign the release artifacts
173
+ id-token: write
174
+ # Used to upload release artifacts
175
+ contents: write
176
+ # Used to generate artifact attestation
177
+ attestations: write
178
+ steps:
179
+ - uses: actions/download-artifact@v7
180
+ - name: Generate artifact attestation
181
+ uses: actions/attest@v4
182
+ with:
183
+ subject-path: 'wheels-*/*'
184
+ - name: Install uv
185
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
186
+ uses: astral-sh/setup-uv@v7
187
+ - name: Publish to PyPI
188
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
189
+ # trusted publishing: uv authenticates with the id-token GitHub issues to this job
190
+ run: uv publish 'wheels-*/*'
@@ -0,0 +1,14 @@
1
+ # Rust build output
2
+ target/
3
+ # Python virtual environment and caches
4
+ .venv/
5
+ __pycache__/
6
+ .pytest_cache/
7
+ # compiled extension module and its debug symbols (rebuilt by maturin develop)
8
+ *.pyd
9
+ *.pdb
10
+ *.so
11
+ # documentation build output (published by CI, never committed)
12
+ docs/_site/
13
+ docs/.quarto/
14
+ check_python.py
@@ -0,0 +1,280 @@
1
+ # This file is automatically @generated by Cargo.
2
+ # It is not intended for manual editing.
3
+ version = 4
4
+
5
+ [[package]]
6
+ name = "autocfg"
7
+ version = "1.5.1"
8
+ source = "registry+https://github.com/rust-lang/crates.io-index"
9
+ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
10
+
11
+ [[package]]
12
+ name = "crossbeam-deque"
13
+ version = "0.8.8"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "622f3fc73690be383c7214310406f28a90e6edeadc3cea882f9d71e495b9711a"
16
+ dependencies = [
17
+ "crossbeam-epoch",
18
+ "crossbeam-utils",
19
+ ]
20
+
21
+ [[package]]
22
+ name = "crossbeam-epoch"
23
+ version = "0.9.21"
24
+ source = "registry+https://github.com/rust-lang/crates.io-index"
25
+ checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d"
26
+ dependencies = [
27
+ "crossbeam-utils",
28
+ ]
29
+
30
+ [[package]]
31
+ name = "crossbeam-utils"
32
+ version = "0.8.23"
33
+ source = "registry+https://github.com/rust-lang/crates.io-index"
34
+ checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6"
35
+
36
+ [[package]]
37
+ name = "either"
38
+ version = "1.18.0"
39
+ source = "registry+https://github.com/rust-lang/crates.io-index"
40
+ checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34"
41
+
42
+ [[package]]
43
+ name = "heck"
44
+ version = "0.5.0"
45
+ source = "registry+https://github.com/rust-lang/crates.io-index"
46
+ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
47
+
48
+ [[package]]
49
+ name = "libc"
50
+ version = "0.2.189"
51
+ source = "registry+https://github.com/rust-lang/crates.io-index"
52
+ checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2"
53
+
54
+ [[package]]
55
+ name = "matrixmultiply"
56
+ version = "0.3.11"
57
+ source = "registry+https://github.com/rust-lang/crates.io-index"
58
+ checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7"
59
+ dependencies = [
60
+ "autocfg",
61
+ "rawpointer",
62
+ ]
63
+
64
+ [[package]]
65
+ name = "ndarray"
66
+ version = "0.17.2"
67
+ source = "registry+https://github.com/rust-lang/crates.io-index"
68
+ checksum = "520080814a7a6b4a6e9070823bb24b4531daac8c4627e08ba5de8c5ef2f2752d"
69
+ dependencies = [
70
+ "matrixmultiply",
71
+ "num-complex",
72
+ "num-integer",
73
+ "num-traits",
74
+ "portable-atomic",
75
+ "portable-atomic-util",
76
+ "rawpointer",
77
+ ]
78
+
79
+ [[package]]
80
+ name = "num-complex"
81
+ version = "0.4.6"
82
+ source = "registry+https://github.com/rust-lang/crates.io-index"
83
+ checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
84
+ dependencies = [
85
+ "num-traits",
86
+ ]
87
+
88
+ [[package]]
89
+ name = "num-integer"
90
+ version = "0.1.47"
91
+ source = "registry+https://github.com/rust-lang/crates.io-index"
92
+ checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b"
93
+ dependencies = [
94
+ "num-traits",
95
+ ]
96
+
97
+ [[package]]
98
+ name = "num-traits"
99
+ version = "0.2.19"
100
+ source = "registry+https://github.com/rust-lang/crates.io-index"
101
+ checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841"
102
+ dependencies = [
103
+ "autocfg",
104
+ ]
105
+
106
+ [[package]]
107
+ name = "numpy"
108
+ version = "0.29.0"
109
+ source = "registry+https://github.com/rust-lang/crates.io-index"
110
+ checksum = "6a5b15d63a5ff39e378daed0e1340d3a5964703ea9712eb09a0dc66fade996f4"
111
+ dependencies = [
112
+ "libc",
113
+ "ndarray",
114
+ "num-complex",
115
+ "num-integer",
116
+ "num-traits",
117
+ "pyo3",
118
+ "pyo3-build-config",
119
+ "rustc-hash",
120
+ ]
121
+
122
+ [[package]]
123
+ name = "once_cell"
124
+ version = "1.21.4"
125
+ source = "registry+https://github.com/rust-lang/crates.io-index"
126
+ checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50"
127
+
128
+ [[package]]
129
+ name = "portable-atomic"
130
+ version = "1.15.0"
131
+ source = "registry+https://github.com/rust-lang/crates.io-index"
132
+ checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85"
133
+
134
+ [[package]]
135
+ name = "portable-atomic-util"
136
+ version = "0.2.8"
137
+ source = "registry+https://github.com/rust-lang/crates.io-index"
138
+ checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715"
139
+ dependencies = [
140
+ "portable-atomic",
141
+ ]
142
+
143
+ [[package]]
144
+ name = "proc-macro2"
145
+ version = "1.0.107"
146
+ source = "registry+https://github.com/rust-lang/crates.io-index"
147
+ checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9"
148
+ dependencies = [
149
+ "unicode-ident",
150
+ ]
151
+
152
+ [[package]]
153
+ name = "pyo3"
154
+ version = "0.29.3"
155
+ source = "registry+https://github.com/rust-lang/crates.io-index"
156
+ checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
157
+ dependencies = [
158
+ "libc",
159
+ "once_cell",
160
+ "portable-atomic",
161
+ "pyo3-build-config",
162
+ "pyo3-ffi",
163
+ "pyo3-macros",
164
+ ]
165
+
166
+ [[package]]
167
+ name = "pyo3-build-config"
168
+ version = "0.29.3"
169
+ source = "registry+https://github.com/rust-lang/crates.io-index"
170
+ checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
171
+ dependencies = [
172
+ "target-lexicon",
173
+ ]
174
+
175
+ [[package]]
176
+ name = "pyo3-ffi"
177
+ version = "0.29.3"
178
+ source = "registry+https://github.com/rust-lang/crates.io-index"
179
+ checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
180
+ dependencies = [
181
+ "libc",
182
+ "pyo3-build-config",
183
+ ]
184
+
185
+ [[package]]
186
+ name = "pyo3-macros"
187
+ version = "0.29.3"
188
+ source = "registry+https://github.com/rust-lang/crates.io-index"
189
+ checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
190
+ dependencies = [
191
+ "proc-macro2",
192
+ "pyo3-macros-backend",
193
+ "quote",
194
+ "syn",
195
+ ]
196
+
197
+ [[package]]
198
+ name = "pyo3-macros-backend"
199
+ version = "0.29.3"
200
+ source = "registry+https://github.com/rust-lang/crates.io-index"
201
+ checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
202
+ dependencies = [
203
+ "heck",
204
+ "proc-macro2",
205
+ "quote",
206
+ "syn",
207
+ ]
208
+
209
+ [[package]]
210
+ name = "quote"
211
+ version = "1.0.47"
212
+ source = "registry+https://github.com/rust-lang/crates.io-index"
213
+ checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001"
214
+ dependencies = [
215
+ "proc-macro2",
216
+ ]
217
+
218
+ [[package]]
219
+ name = "rawpointer"
220
+ version = "0.2.1"
221
+ source = "registry+https://github.com/rust-lang/crates.io-index"
222
+ checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3"
223
+
224
+ [[package]]
225
+ name = "rayon"
226
+ version = "1.12.0"
227
+ source = "registry+https://github.com/rust-lang/crates.io-index"
228
+ checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d"
229
+ dependencies = [
230
+ "either",
231
+ "rayon-core",
232
+ ]
233
+
234
+ [[package]]
235
+ name = "rayon-core"
236
+ version = "1.13.0"
237
+ source = "registry+https://github.com/rust-lang/crates.io-index"
238
+ checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91"
239
+ dependencies = [
240
+ "crossbeam-deque",
241
+ "crossbeam-utils",
242
+ ]
243
+
244
+ [[package]]
245
+ name = "rustc-hash"
246
+ version = "2.1.3"
247
+ source = "registry+https://github.com/rust-lang/crates.io-index"
248
+ checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d"
249
+
250
+ [[package]]
251
+ name = "syn"
252
+ version = "2.0.119"
253
+ source = "registry+https://github.com/rust-lang/crates.io-index"
254
+ checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
255
+ dependencies = [
256
+ "proc-macro2",
257
+ "quote",
258
+ "unicode-ident",
259
+ ]
260
+
261
+ [[package]]
262
+ name = "target-lexicon"
263
+ version = "0.13.5"
264
+ source = "registry+https://github.com/rust-lang/crates.io-index"
265
+ checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
266
+
267
+ [[package]]
268
+ name = "tensorderiv"
269
+ version = "0.1.0"
270
+ dependencies = [
271
+ "numpy",
272
+ "pyo3",
273
+ "rayon",
274
+ ]
275
+
276
+ [[package]]
277
+ name = "unicode-ident"
278
+ version = "1.0.26"
279
+ source = "registry+https://github.com/rust-lang/crates.io-index"
280
+ checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
@@ -0,0 +1,23 @@
1
+ # The Rust package. Cargo is Rust's build tool and package manager, like Julia's Pkg.
2
+ [package]
3
+ name = "tensorderiv"
4
+ version = "0.1.0"
5
+ edition = "2021" # the Rust language edition (a stable set of language rules)
6
+ description = "Rust core of tensorderiv: gradient, divergence, curl and Laplacian on scattered points"
7
+ license = "MIT"
8
+ repository = "https://github.com/NikoBiele/tensorderiv"
9
+ readme = "README.md"
10
+
11
+ [lib]
12
+ name = "_core" # the compiled module; Python imports it as tensorderiv._core
13
+ crate-type = ["cdylib"] # build a shared library that Python can load
14
+
15
+ [dependencies]
16
+ pyo3 = "0.29" # Rust ↔ Python bindings
17
+ numpy = "0.29" # NumPy arrays in Rust (must match the PyO3 version)
18
+ rayon = "1.12" # data parallelism: spreads loops over all cores, like Julia's threaded tasks
19
+
20
+ # Release builds (maturin develop --release, and the published wheels)
21
+ [profile.release]
22
+ lto = true # link-time optimization: optimize across crates (pyo3, numpy, rayon)
23
+ codegen-units = 1 # compile as one unit, so the optimizer sees the whole crate at once
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 NikoBiele
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.