convinterp 0.1.0__tar.gz → 0.2.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.
Files changed (46) hide show
  1. {convinterp-0.1.0 → convinterp-0.2.0}/.github/workflows/CI.yml +5 -1
  2. convinterp-0.2.0/.github/workflows/docs.yml +51 -0
  3. {convinterp-0.1.0 → convinterp-0.2.0}/.gitignore +4 -1
  4. convinterp-0.2.0/CITATION.cff +26 -0
  5. {convinterp-0.1.0 → convinterp-0.2.0}/Cargo.lock +1 -1
  6. {convinterp-0.1.0 → convinterp-0.2.0}/Cargo.toml +1 -1
  7. {convinterp-0.1.0 → convinterp-0.2.0}/PKG-INFO +30 -13
  8. {convinterp-0.1.0 → convinterp-0.2.0}/README.md +25 -11
  9. convinterp-0.2.0/docs/.gitignore +1 -0
  10. convinterp-0.2.0/docs/CNAME +1 -0
  11. convinterp-0.2.0/docs/_quarto.yml +54 -0
  12. convinterp-0.2.0/docs/about.qmd +59 -0
  13. convinterp-0.2.0/docs/accuracy.qmd +373 -0
  14. convinterp-0.2.0/docs/assets/logo.svg +163 -0
  15. convinterp-0.2.0/docs/guide.qmd +253 -0
  16. convinterp-0.2.0/docs/index.qmd +79 -0
  17. convinterp-0.2.0/docs/references.bib +32 -0
  18. convinterp-0.2.0/docs/theory.qmd +257 -0
  19. {convinterp-0.1.0 → convinterp-0.2.0}/pyproject.toml +5 -3
  20. {convinterp-0.1.0 → convinterp-0.2.0}/python/convinterp/__init__.py +16 -3
  21. convinterp-0.2.0/python/convinterp/derivation.py +203 -0
  22. {convinterp-0.1.0 → convinterp-0.2.0}/src/coefficients.rs +14 -3
  23. convinterp-0.2.0/src/integral.rs +229 -0
  24. {convinterp-0.1.0 → convinterp-0.2.0}/src/interpolant.rs +131 -24
  25. convinterp-0.2.0/src/interpolant_nd.rs +592 -0
  26. convinterp-0.2.0/src/kernels.rs +3675 -0
  27. {convinterp-0.1.0 → convinterp-0.2.0}/src/lib.rs +1 -0
  28. convinterp-0.2.0/tests/test_derivation.py +89 -0
  29. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_derivatives.py +3 -2
  30. convinterp-0.2.0/tests/test_integrals.py +73 -0
  31. convinterp-0.2.0/tests/test_integrals_nd.py +151 -0
  32. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_kernels.py +29 -1
  33. convinterp-0.2.0/tests/test_validation.py +55 -0
  34. convinterp-0.2.0/tools/export_kernels.jl +203 -0
  35. convinterp-0.1.0/src/interpolant_nd.rs +0 -329
  36. convinterp-0.1.0/src/kernels.rs +0 -798
  37. convinterp-0.1.0/tools/export_kernels.jl +0 -130
  38. {convinterp-0.1.0 → convinterp-0.2.0}/.cargo/config.toml +0 -0
  39. {convinterp-0.1.0 → convinterp-0.2.0}/LICENSE +0 -0
  40. {convinterp-0.1.0 → convinterp-0.2.0}/benchmarks/benchmark_1d.py +0 -0
  41. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_api_nd.py +0 -0
  42. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_coefficients.py +0 -0
  43. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_coefficients_nd.py +0 -0
  44. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_interpolation.py +0 -0
  45. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_interpolation_nd.py +0 -0
  46. {convinterp-0.1.0 → convinterp-0.2.0}/tests/test_skeleton.py +0 -0
@@ -12,9 +12,13 @@ on:
12
12
  - master
13
13
  tags:
14
14
  - '*'
15
+ paths-ignore:
16
+ - 'docs/**' # documentation-only changes don't need new wheels
15
17
  pull_request:
18
+ paths-ignore:
19
+ - 'docs/**'
16
20
  workflow_dispatch:
17
-
21
+
18
22
  permissions:
19
23
  contents: read
20
24
 
@@ -0,0 +1,51 @@
1
+ # Builds the documentation website from docs/ and publishes it to https://convinterp.org.
2
+ # The code cells run against convinterp compiled from this repository, so the pages always
3
+ # describe the code as it is on main.
4
+ name: Docs
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+ workflow_dispatch: # a "Run workflow" button in the Actions tab
11
+
12
+ permissions:
13
+ contents: read
14
+ pages: write # to publish to GitHub Pages
15
+ id-token: write # to authenticate the publishing
16
+
17
+ concurrency:
18
+ group: pages # one publication at a time; a newer push waits for the current one
19
+ cancel-in-progress: false
20
+
21
+ jobs:
22
+ build:
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v6
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: "3.12"
29
+ - name: Install convinterp from this repository, and the packages the pages use
30
+ run: |
31
+ python -m pip install --upgrade pip
32
+ pip install . jupyter matplotlib scipy sympy
33
+ - name: Set up Quarto
34
+ uses: quarto-dev/quarto-actions/setup@v2
35
+ - name: Render the website
36
+ run: quarto render docs
37
+ - name: Upload the website
38
+ uses: actions/upload-pages-artifact@v3
39
+ with:
40
+ path: docs/_site
41
+
42
+ deploy:
43
+ needs: build
44
+ runs-on: ubuntu-latest
45
+ environment:
46
+ name: github-pages
47
+ url: ${{ steps.deployment.outputs.page_url }}
48
+ steps:
49
+ - name: Deploy to GitHub Pages
50
+ id: deployment
51
+ uses: actions/deploy-pages@v4
@@ -8,4 +8,7 @@ __pycache__/
8
8
  *.pyd
9
9
  *.pdb
10
10
  *.so
11
- check_python.py
11
+ check_python.py
12
+ # documentation build output (published by CI, never committed)
13
+ docs/_site/
14
+ docs/.quarto/
@@ -0,0 +1,26 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use convinterp in your work, please cite it as below."
3
+ type: software
4
+ title: "convinterp: high-order convolution interpolation, derivatives and integrals on uniform grids"
5
+ authors:
6
+ - given-names: Nikolaj Maack
7
+ family-names: Bielefeld
8
+ orcid: "https://orcid.org/0009-0005-4385-6444"
9
+ abstract: >-
10
+ convinterp interpolates data on uniform grids in any number of dimensions, and differentiates
11
+ and integrates the interpolant exactly, with piecewise-polynomial convolution kernels of up to
12
+ 7th-order accuracy, evaluated in a compiled Rust core. It is a port of the Julia package
13
+ ConvolutionInterpolations.jl by the same author, and is tested against it.
14
+ license: MIT
15
+ version: 0.2.0
16
+ date-released: 2026-09-26
17
+ doi: "10.5281/zenodo.22972816"
18
+ url: "https://convinterp.org"
19
+ repository-code: "https://github.com/NikoBiele/convinterp"
20
+ keywords:
21
+ - interpolation
22
+ - convolution
23
+ - derivatives
24
+ - integration
25
+ - numerical methods
26
+ - scientific computing
@@ -16,7 +16,7 @@ checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797"
16
16
 
17
17
  [[package]]
18
18
  name = "convinterp"
19
- version = "0.1.0"
19
+ version = "0.2.0"
20
20
  dependencies = [
21
21
  "numpy",
22
22
  "pyo3",
@@ -1,7 +1,7 @@
1
1
  # The Rust package. Cargo is Rust's build tool and package manager, like Julia's Pkg.
2
2
  [package]
3
3
  name = "convinterp"
4
- version = "0.1.0"
4
+ version = "0.2.0"
5
5
  edition = "2021" # the Rust language edition (a stable set of language rules)
6
6
  description = "Rust core of convinterp: high-order convolution interpolation on uniform grids"
7
7
  license = "MIT"
@@ -1,17 +1,20 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: convinterp
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Classifier: Development Status :: 3 - Alpha
5
5
  Classifier: Intended Audience :: Science/Research
6
6
  Classifier: Programming Language :: Python :: 3
7
7
  Classifier: Programming Language :: Rust
8
8
  Classifier: Topic :: Scientific/Engineering :: Mathematics
9
9
  Requires-Dist: numpy
10
+ Requires-Dist: sympy ; extra == 'derivation'
10
11
  Requires-Dist: pytest ; extra == 'test'
11
12
  Requires-Dist: juliacall ; extra == 'test'
13
+ Requires-Dist: sympy ; extra == 'test'
14
+ Provides-Extra: derivation
12
15
  Provides-Extra: test
13
16
  License-File: LICENSE
14
- Summary: High-order convolution interpolation and derivatives on uniform grids in any dimension, with a Rust core
17
+ Summary: High-order convolution interpolation, derivatives and integrals on uniform grids in any dimension, with a Rust core
15
18
  Keywords: interpolation,convolution,derivatives,numerical methods,scientific computing
16
19
  Author: Nikolaj Maack Bielefeld
17
20
  License-Expression: MIT
@@ -24,14 +27,18 @@ Project-URL: Repository, https://github.com/NikoBiele/convinterp
24
27
  # convinterp
25
28
 
26
29
  High-order convolution interpolation on uniform grids in any number of dimensions, with
27
- derivatives, for Python. The core is written in Rust; the kernels are exact polynomials.
30
+ derivatives and integrals, for Python. The core is written in Rust; the kernels are exact
31
+ polynomials.
28
32
 
29
33
  convinterp is a port of the Julia package
30
34
  [ConvolutionInterpolations.jl](https://github.com/NikoBiele/ConvolutionInterpolations.jl), by the
31
35
  same author, and is tested against it.
32
36
 
33
- **Status: alpha.** Interpolation and derivatives on uniform grids work in any dimension.
34
- Integrals and scattered data are coming.
37
+ **Documentation: [convinterp.org](https://convinterp.org)**, with a user guide and accuracy and
38
+ speed comparisons with SciPy.
39
+
40
+ **Status: alpha.** Interpolation, derivatives and integrals on uniform grids work in any
41
+ dimension. Scattered data are coming.
35
42
 
36
43
  ## Installation
37
44
 
@@ -54,6 +61,10 @@ print(itp(1.0)) # ≈ sin(1) = 0.841471
54
61
  d_itp = convolution_interpolation(x, np.sin(x), derivative=1)
55
62
  print(d_itp(1.0)) # ≈ cos(1) = 0.540302
56
63
 
64
+ # integrals: a negative order, zero at the first knot x[0] = 0
65
+ i_itp = convolution_interpolation(x, np.sin(x), derivative=-1)
66
+ print(i_itp(1.0)) # ≈ 1 − cos(1) = 0.459698
67
+
57
68
  # 2D: one knot array per axis, and data whose axis d runs along knots[d]
58
69
  y = np.linspace(0.0, 1.0, 30) # knots of the second axis
59
70
  data = np.sin(x)[:, None] * np.exp(y)[None, :] # sin(x)·exp(y) on the 50 × 30 grid
@@ -75,12 +86,12 @@ print(itp2(xs, ys).shape) # (3, 4)
75
86
  `kernel="auto"` (the default) chooses by the number of dimensions: `"b7"` in 1D and 2D, `"b5"` in
76
87
  3D, and narrower kernels beyond. You can choose any of:
77
88
 
78
- | kernel | order of accuracy | highest derivative |
79
- |---|---|---|
80
- | `"a0"` | nearest neighbour | none |
81
- | `"a1"` | linear | none |
82
- | `"a3"`, `"a4"`, `"a5"`, `"a7"` | cubic and higher | 1 |
83
- | `"b5"`, `"b7"`, `"b9"`, `"b11"`, `"b13"` | high order | 3 to 7 |
89
+ | kernel | order of accuracy | highest derivative | highest integral |
90
+ |---|---|---|---|
91
+ | `"a0"` | nearest neighbour | none | 2 |
92
+ | `"a1"` | linear | none | 2 |
93
+ | `"a3"`, `"a4"`, `"a5"`, `"a7"` | cubic and higher | 1 | 4 |
94
+ | `"b5"`, `"b7"`, `"b9"`, `"b11"`, `"b13"` | high order | 3 to 7 | 6 to 8 |
84
95
 
85
96
  ## Boundary conditions
86
97
 
@@ -88,6 +99,12 @@ The data are extended beyond each boundary by extrapolation: `bc="detect"` (the
88
99
  polynomial extrapolation where the data near the boundary allow it and linear otherwise. You can
89
100
  also choose `"poly"`, `"linear"` or `"quadratic"`, separately for each side and each axis.
90
101
 
102
+ ## Citing
103
+
104
+ If you use convinterp in your work, please cite it:
105
+ [doi.org/10.5281/zenodo.22972816](https://doi.org/10.5281/zenodo.22972816) (always the latest
106
+ version). A BibTeX entry is on the [About page](https://convinterp.org/about.html).
107
+
91
108
  ## Declaration of AI Assistance
92
109
 
93
110
  The Rust core and much of the Python code of convinterp were written with substantial assistance
@@ -95,8 +112,8 @@ from Claude (Anthropic). The mathematical methods, the kernels and the reference
95
112
  come from the author's Julia package
96
113
  [ConvolutionInterpolations.jl](https://github.com/NikoBiele/ConvolutionInterpolations.jl), and the
97
114
  port is validated against it: the test suite compares convinterp with the Julia package across
98
- kernels, boundary conditions, derivative orders and dimensions, with the boundary coefficients
99
- agreeing bit for bit. The author has reviewed and is responsible for all code.
115
+ kernels, boundary conditions, derivative and integral orders and dimensions, with the boundary
116
+ coefficients agreeing bit for bit. The author has reviewed and is responsible for all code.
100
117
 
101
118
  ## License
102
119
 
@@ -1,14 +1,18 @@
1
1
  # convinterp
2
2
 
3
3
  High-order convolution interpolation on uniform grids in any number of dimensions, with
4
- derivatives, for Python. The core is written in Rust; the kernels are exact polynomials.
4
+ derivatives and integrals, for Python. The core is written in Rust; the kernels are exact
5
+ polynomials.
5
6
 
6
7
  convinterp is a port of the Julia package
7
8
  [ConvolutionInterpolations.jl](https://github.com/NikoBiele/ConvolutionInterpolations.jl), by the
8
9
  same author, and is tested against it.
9
10
 
10
- **Status: alpha.** Interpolation and derivatives on uniform grids work in any dimension.
11
- Integrals and scattered data are coming.
11
+ **Documentation: [convinterp.org](https://convinterp.org)**, with a user guide and accuracy and
12
+ speed comparisons with SciPy.
13
+
14
+ **Status: alpha.** Interpolation, derivatives and integrals on uniform grids work in any
15
+ dimension. Scattered data are coming.
12
16
 
13
17
  ## Installation
14
18
 
@@ -31,6 +35,10 @@ print(itp(1.0)) # ≈ sin(1) = 0.841471
31
35
  d_itp = convolution_interpolation(x, np.sin(x), derivative=1)
32
36
  print(d_itp(1.0)) # ≈ cos(1) = 0.540302
33
37
 
38
+ # integrals: a negative order, zero at the first knot x[0] = 0
39
+ i_itp = convolution_interpolation(x, np.sin(x), derivative=-1)
40
+ print(i_itp(1.0)) # ≈ 1 − cos(1) = 0.459698
41
+
34
42
  # 2D: one knot array per axis, and data whose axis d runs along knots[d]
35
43
  y = np.linspace(0.0, 1.0, 30) # knots of the second axis
36
44
  data = np.sin(x)[:, None] * np.exp(y)[None, :] # sin(x)·exp(y) on the 50 × 30 grid
@@ -52,12 +60,12 @@ print(itp2(xs, ys).shape) # (3, 4)
52
60
  `kernel="auto"` (the default) chooses by the number of dimensions: `"b7"` in 1D and 2D, `"b5"` in
53
61
  3D, and narrower kernels beyond. You can choose any of:
54
62
 
55
- | kernel | order of accuracy | highest derivative |
56
- |---|---|---|
57
- | `"a0"` | nearest neighbour | none |
58
- | `"a1"` | linear | none |
59
- | `"a3"`, `"a4"`, `"a5"`, `"a7"` | cubic and higher | 1 |
60
- | `"b5"`, `"b7"`, `"b9"`, `"b11"`, `"b13"` | high order | 3 to 7 |
63
+ | kernel | order of accuracy | highest derivative | highest integral |
64
+ |---|---|---|---|
65
+ | `"a0"` | nearest neighbour | none | 2 |
66
+ | `"a1"` | linear | none | 2 |
67
+ | `"a3"`, `"a4"`, `"a5"`, `"a7"` | cubic and higher | 1 | 4 |
68
+ | `"b5"`, `"b7"`, `"b9"`, `"b11"`, `"b13"` | high order | 3 to 7 | 6 to 8 |
61
69
 
62
70
  ## Boundary conditions
63
71
 
@@ -65,6 +73,12 @@ The data are extended beyond each boundary by extrapolation: `bc="detect"` (the
65
73
  polynomial extrapolation where the data near the boundary allow it and linear otherwise. You can
66
74
  also choose `"poly"`, `"linear"` or `"quadratic"`, separately for each side and each axis.
67
75
 
76
+ ## Citing
77
+
78
+ If you use convinterp in your work, please cite it:
79
+ [doi.org/10.5281/zenodo.22972816](https://doi.org/10.5281/zenodo.22972816) (always the latest
80
+ version). A BibTeX entry is on the [About page](https://convinterp.org/about.html).
81
+
68
82
  ## Declaration of AI Assistance
69
83
 
70
84
  The Rust core and much of the Python code of convinterp were written with substantial assistance
@@ -72,8 +86,8 @@ from Claude (Anthropic). The mathematical methods, the kernels and the reference
72
86
  come from the author's Julia package
73
87
  [ConvolutionInterpolations.jl](https://github.com/NikoBiele/ConvolutionInterpolations.jl), and the
74
88
  port is validated against it: the test suite compares convinterp with the Julia package across
75
- kernels, boundary conditions, derivative orders and dimensions, with the boundary coefficients
76
- agreeing bit for bit. The author has reviewed and is responsible for all code.
89
+ kernels, boundary conditions, derivative and integral orders and dimensions, with the boundary
90
+ coefficients agreeing bit for bit. The author has reviewed and is responsible for all code.
77
91
 
78
92
  ## License
79
93
 
@@ -0,0 +1 @@
1
+ /.quarto/
@@ -0,0 +1 @@
1
+ convinterp.org
@@ -0,0 +1,54 @@
1
+ # Quarto configuration of the convinterp documentation website (https://convinterp.org).
2
+ # Render locally from the repository root with: quarto render docs
3
+ project:
4
+ type: website
5
+ output-dir: _site # the built site; never committed, published by CI
6
+
7
+ website:
8
+ title: "convinterp"
9
+ description: "High-order convolution interpolation, derivatives and integrals on uniform grids, with a Rust core"
10
+ site-url: https://convinterp.org
11
+ repo-url: https://github.com/NikoBiele/convinterp
12
+ repo-subdir: docs # "edit this page" links point into docs/
13
+ repo-actions: [edit, issue] # links under each page's table of contents
14
+ search: true
15
+ favicon: assets/logo.svg # the icon in the browser tab
16
+ navbar:
17
+ logo: assets/logo.svg # the kernel, next to the site title
18
+ logo-alt: "convinterp logo: the b7 convolution kernel"
19
+ right:
20
+ - icon: github
21
+ href: https://github.com/NikoBiele/convinterp
22
+ aria-label: GitHub repository
23
+ sidebar:
24
+ style: floating # always visible on wide screens, as on gert.net
25
+ contents:
26
+ - href: index.qmd
27
+ text: Home
28
+ - href: guide.qmd
29
+ text: User guide
30
+ - href: accuracy.qmd
31
+ text: Accuracy and performance
32
+ - href: theory.qmd
33
+ text: Theory
34
+ - href: about.qmd
35
+ text: About
36
+ page-footer:
37
+ left: "© 2026 Nikolaj Maack Bielefeld · MIT license"
38
+ right: "Built with [Quarto](https://quarto.org)"
39
+
40
+ format:
41
+ html:
42
+ theme: cosmo # the same theme as gert.net
43
+ toc: true # a table of contents on every page
44
+ html-math-method: katex # fast math rendering, as on gert.net
45
+ code-copy: true # a copy button on every code block
46
+ code-overflow: wrap
47
+ grid:
48
+ body-width: 950px # a wider content column for figures (Quarto's default is 800px)
49
+
50
+ jupyter: python3 # code cells run in Python, against the convinterp built from this repository
51
+
52
+ execute:
53
+ echo: true # show the code next to its output
54
+ warning: false # keep library warnings out of the pages
@@ -0,0 +1,59 @@
1
+ ---
2
+ title: "About"
3
+ ---
4
+
5
+ ## convinterp and ConvolutionInterpolations.jl
6
+
7
+ convinterp is a Python port of the Julia package
8
+ [ConvolutionInterpolations.jl](https://github.com/NikoBiele/ConvolutionInterpolations.jl), by the
9
+ same author. Both packages implement the same methods: the b-series kernels, the polynomial
10
+ boundary conditions, and the compensated evaluation of ghost values. convinterp's core is written
11
+ in Rust, and its test suite compares it with the Julia package across kernels, boundary
12
+ conditions, derivative and integral orders and dimensions; the boundary coefficients of the two
13
+ packages agree bit for bit.
14
+
15
+ Features of the Julia package that convinterp does not provide yet, such as scattered data, are
16
+ listed at the end of the [user guide](guide.qmd#not-available-yet).
17
+
18
+ ## Citing convinterp
19
+
20
+ If you use convinterp in your work, please cite it. Each release is archived on Zenodo with its
21
+ own DOI; the DOI below always refers to the latest version:
22
+
23
+ > Bielefeld, N. M. (2026). *convinterp: high-order convolution interpolation, derivatives and
24
+ > integrals on uniform grids*. Zenodo. <https://doi.org/10.5281/zenodo.22972816>
25
+
26
+ ```bibtex
27
+ @software{bielefeld_convinterp,
28
+ author = {Bielefeld, Nikolaj Maack},
29
+ title = {convinterp: high-order convolution interpolation, derivatives and integrals on uniform grids},
30
+ year = {2026},
31
+ publisher = {Zenodo},
32
+ doi = {10.5281/zenodo.22972816},
33
+ url = {https://convinterp.org}
34
+ }
35
+ ```
36
+
37
+ To cite one specific version, use its own DOI, listed on the
38
+ [Zenodo record](https://doi.org/10.5281/zenodo.22972816). The GitHub repository also offers
39
+ these details under "Cite this repository".
40
+
41
+ ## Author
42
+
43
+ Nikolaj Maack Bielefeld ([ORCID 0009-0005-4385-6444](https://orcid.org/0009-0005-4385-6444)).
44
+ Questions, bug reports and suggestions are welcome as
45
+ [issues on GitHub](https://github.com/NikoBiele/convinterp/issues).
46
+
47
+ ## Declaration of AI assistance
48
+
49
+ The Rust core and much of the Python code of convinterp were written with substantial assistance
50
+ from Claude (Anthropic). The mathematical methods, the kernels and the reference implementation
51
+ come from the author's Julia package ConvolutionInterpolations.jl, and the port is validated
52
+ against it: the test suite compares convinterp with the Julia package across kernels, boundary
53
+ conditions, derivative orders and dimensions, with the boundary coefficients agreeing bit for bit.
54
+ The author has reviewed and is responsible for all code.
55
+
56
+ ## License
57
+
58
+ convinterp is free software under the
59
+ [MIT license](https://github.com/NikoBiele/convinterp/blob/main/LICENSE).