dioptrin 0.7.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.
- dioptrin-0.7.0/.gitattributes +1 -0
- dioptrin-0.7.0/.github/workflows/ci.yml +63 -0
- dioptrin-0.7.0/.github/workflows/python-release.yml +129 -0
- dioptrin-0.7.0/.github/workflows/test.yml +136 -0
- dioptrin-0.7.0/.gitignore +19 -0
- dioptrin-0.7.0/.python-version +1 -0
- dioptrin-0.7.0/AGENTS.md +33 -0
- dioptrin-0.7.0/CHANGELOG.md +573 -0
- dioptrin-0.7.0/CLAUDE.md +79 -0
- dioptrin-0.7.0/Cargo.lock +1949 -0
- dioptrin-0.7.0/Cargo.toml +44 -0
- dioptrin-0.7.0/GEMINI.md +127 -0
- dioptrin-0.7.0/LICENSE +21 -0
- dioptrin-0.7.0/PKG-INFO +78 -0
- dioptrin-0.7.0/README-pypi.md +53 -0
- dioptrin-0.7.0/README.md +528 -0
- dioptrin-0.7.0/benches/build.rs +89 -0
- dioptrin-0.7.0/benches/integrate.rs +301 -0
- dioptrin-0.7.0/benches/integrator.rs +214 -0
- dioptrin-0.7.0/dioptrin.pyi +747 -0
- dioptrin-0.7.0/docs/HDF5_USAGE.md +289 -0
- dioptrin-0.7.0/docs/MULTI_DETECTOR.md +181 -0
- dioptrin-0.7.0/docs/benchmarks/2026-10-24-0.6.0-comparison.md +58 -0
- dioptrin-0.7.0/docs/benchmarks/2026-10-24-0.6.0.md +54 -0
- dioptrin-0.7.0/docs/benchmarks/2026-10-24-file-pipeline-optimization.md +41 -0
- dioptrin-0.7.0/docs/benchmarks/2026-10-24-file-pipeline.md +85 -0
- dioptrin-0.7.0/docs/benchmarks/2026-10-24-pyfai-2026.9.0.md +39 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-comparison-numerical.json +310 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-comparison-patterns.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-comparison-scaling.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-comparison-speed-memory.csv +65 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-measurement-record.json +9009 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-release-numerical.json +582 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-release-scaling.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-release-setup-memory.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-0.6.0-release-speed-memory.csv +65 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-file-vs-memory.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-measurement-record.json +16862 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-numerical.json +218 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-optimization-measurement-record.json +1575 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-optimization-memory.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-optimization-numerical.json +74 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-optimization-scaling.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-optimization-speed-memory.csv +17 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-queue-control.csv +9 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-scaling.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-speed-memory.csv +49 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-worker-times.csv +193 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-file-pipeline-workers.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-pyfai-2026.9.0-measurement-record.json +2309 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-pyfai-2026.9.0-numerical.json +582 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-pyfai-2026.9.0-scaling.png +0 -0
- dioptrin-0.7.0/docs/benchmarks/dioptrin-pyfai-2026.9.0-speed-memory.csv +65 -0
- dioptrin-0.7.0/examples/batch_api.rs +187 -0
- dioptrin-0.7.0/examples/benchmark_pipeline.rs +275 -0
- dioptrin-0.7.0/examples/benchmark_threads.rs +121 -0
- dioptrin-0.7.0/examples/integrate1d.rs +66 -0
- dioptrin-0.7.0/examples/integrate2d.rs +64 -0
- dioptrin-0.7.0/examples/timing1d.rs +77 -0
- dioptrin-0.7.0/libcommon.rlib +0 -0
- dioptrin-0.7.0/main.py +5 -0
- dioptrin-0.7.0/pyproject.toml +28 -0
- dioptrin-0.7.0/python_examples/README.md +104 -0
- dioptrin-0.7.0/python_examples/batch_api_smoke_test.py +53 -0
- dioptrin-0.7.0/python_examples/batch_api_speed_test.py +126 -0
- dioptrin-0.7.0/python_examples/batch_benchmark_comparison.py +315 -0
- dioptrin-0.7.0/python_examples/batch_pyfai_speed_test.py +144 -0
- dioptrin-0.7.0/python_examples/bench_azimuthal_std.py +38 -0
- dioptrin-0.7.0/python_examples/bench_eiger_integration.py +288 -0
- dioptrin-0.7.0/python_examples/bench_eiger_loading.py +246 -0
- dioptrin-0.7.0/python_examples/compare_to_pyfai.py +63 -0
- dioptrin-0.7.0/python_examples/geometry_test_check.py +222 -0
- dioptrin-0.7.0/python_examples/hdf5_chunked_batch.py +237 -0
- dioptrin-0.7.0/python_examples/integration_test_check_1d.py +172 -0
- dioptrin-0.7.0/python_examples/integration_test_check_2d.py +56 -0
- dioptrin-0.7.0/python_examples/mask_example.py +81 -0
- dioptrin-0.7.0/python_examples/multi_integrator_example.py +163 -0
- dioptrin-0.7.0/python_examples/multi_integrator_pyfai_comparison.py +215 -0
- dioptrin-0.7.0/python_examples/test_auto_calibrate_ceo2_side.py +163 -0
- dioptrin-0.7.0/python_examples/test_auto_calibrate_lab6.py +157 -0
- dioptrin-0.7.0/python_examples/test_azimuthal_std.py +146 -0
- dioptrin-0.7.0/python_examples/test_batch_array_borrowing.py +94 -0
- dioptrin-0.7.0/python_examples/test_calibration_dioptas_parity.py +249 -0
- dioptrin-0.7.0/python_examples/test_calibration_lab6.py +172 -0
- dioptrin-0.7.0/python_examples/test_fast_math.py +84 -0
- dioptrin-0.7.0/python_examples/test_generator_iter.py +135 -0
- dioptrin-0.7.0/python_examples/test_hdf5_arrays.py +123 -0
- dioptrin-0.7.0/python_examples/test_image_switching.py +50 -0
- dioptrin-0.7.0/python_examples/test_massif_dioptas_parity.py +141 -0
- dioptrin-0.7.0/python_examples/test_ransac_ellipses_lab6.py +215 -0
- dioptrin-0.7.0/python_examples/test_ring_identity_lab6.py +171 -0
- dioptrin-0.7.0/scripts/check_file_pipeline.py +165 -0
- dioptrin-0.7.0/scripts/check_release_wheels.py +45 -0
- dioptrin-0.7.0/scripts/check_unrestricted_install.py +64 -0
- dioptrin-0.7.0/src/batch/file_workers.rs +267 -0
- dioptrin-0.7.0/src/batch.rs +856 -0
- dioptrin-0.7.0/src/calibration/auto.rs +594 -0
- dioptrin-0.7.0/src/calibration/calibrant.rs +134 -0
- dioptrin-0.7.0/src/calibration/center.rs +345 -0
- dioptrin-0.7.0/src/calibration/ellipse.rs +610 -0
- dioptrin-0.7.0/src/calibration/grid_search.rs +542 -0
- dioptrin-0.7.0/src/calibration/inversion.rs +318 -0
- dioptrin-0.7.0/src/calibration/massif.rs +568 -0
- dioptrin-0.7.0/src/calibration/mod.rs +57 -0
- dioptrin-0.7.0/src/calibration/radial.rs +287 -0
- dioptrin-0.7.0/src/calibration/refinement.rs +812 -0
- dioptrin-0.7.0/src/calibration/ring_identity.rs +380 -0
- dioptrin-0.7.0/src/calibration/tests.rs +349 -0
- dioptrin-0.7.0/src/frame/tiff_input.rs +149 -0
- dioptrin-0.7.0/src/frame/tiff_tests.rs +155 -0
- dioptrin-0.7.0/src/frame.rs +182 -0
- dioptrin-0.7.0/src/geometry.rs +631 -0
- dioptrin-0.7.0/src/integration/arithmetic.rs +96 -0
- dioptrin-0.7.0/src/integration/cache.rs +409 -0
- dioptrin-0.7.0/src/integration/corrections.rs +92 -0
- dioptrin-0.7.0/src/integration/methods.rs +1165 -0
- dioptrin-0.7.0/src/integration/tests.rs +1284 -0
- dioptrin-0.7.0/src/integration/tiff_input.rs +163 -0
- dioptrin-0.7.0/src/integration.rs +360 -0
- dioptrin-0.7.0/src/lib.rs +16 -0
- dioptrin-0.7.0/src/lut/azimuthal.rs +252 -0
- dioptrin-0.7.0/src/lut/common.rs +65 -0
- dioptrin-0.7.0/src/lut/counting_csr.rs +244 -0
- dioptrin-0.7.0/src/lut/fast.rs +312 -0
- dioptrin-0.7.0/src/lut/fast_tests.rs +142 -0
- dioptrin-0.7.0/src/lut/integrate.rs +1276 -0
- dioptrin-0.7.0/src/lut/mod.rs +54 -0
- dioptrin-0.7.0/src/lut/pixel_split.rs +1003 -0
- dioptrin-0.7.0/src/lut/prepared.rs +492 -0
- dioptrin-0.7.0/src/lut/prepared_tests.rs +189 -0
- dioptrin-0.7.0/src/lut/supersampled.rs +516 -0
- dioptrin-0.7.0/src/lut/supersampled_parity_tests.rs +466 -0
- dioptrin-0.7.0/src/mask.rs +96 -0
- dioptrin-0.7.0/src/math/histogram.rs +270 -0
- dioptrin-0.7.0/src/math/matrix.rs +231 -0
- dioptrin-0.7.0/src/math/mod.rs +74 -0
- dioptrin-0.7.0/src/math/sparse/coo.rs +301 -0
- dioptrin-0.7.0/src/math/sparse/csr.rs +56 -0
- dioptrin-0.7.0/src/math/sparse/mod.rs +2 -0
- dioptrin-0.7.0/src/multi.rs +281 -0
- dioptrin-0.7.0/src/poni.rs +178 -0
- dioptrin-0.7.0/src/python/calibration.rs +854 -0
- dioptrin-0.7.0/src/python/integrator.rs +1730 -0
- dioptrin-0.7.0/src/python/mod.rs +65 -0
- dioptrin-0.7.0/src/python/multi_integrator.rs +234 -0
- dioptrin-0.7.0/src/python/results.rs +449 -0
- dioptrin-0.7.0/src/python/utils.rs +246 -0
- dioptrin-0.7.0/src/util.rs +96 -0
- dioptrin-0.7.0/test_data/CeO2_Pilatus1M.tif +3 -0
- dioptrin-0.7.0/test_data/LaB6_40keV_MarCCD.poni +24 -0
- dioptrin-0.7.0/test_data/LaB6_40keV_MarCCD.tif +0 -0
- dioptrin-0.7.0/test_data/calibrants/CeO2.D +63 -0
- dioptrin-0.7.0/test_data/calibrants/LaB6_SRM660b.D +96 -0
- dioptrin-0.7.0/test_data/ceo2_side.poni +12 -0
- dioptrin-0.7.0/test_data/ceo2_side.tif +0 -0
- dioptrin-0.7.0/test_data/nexus_test_file.nxs +0 -0
- dioptrin-0.7.0/test_data/test_reference/azimuth_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/d1_cart.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/d1_cart_poni.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/d2_cart.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/d2_cart_poni.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/pattern_int_pyFAI.txt +850 -0
- dioptrin-0.7.0/test_data/test_reference/pattern_tth_pyFAI.txt +850 -0
- dioptrin-0.7.0/test_data/test_reference/polarization_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/solid_angle_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/tth_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/x_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/y_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/test_reference/z_pyFAI.txt +200 -0
- dioptrin-0.7.0/test_data/v1.poni +12 -0
- dioptrin-0.7.0/test_data/v2.poni +12 -0
- dioptrin-0.7.0/test_examples.py +138 -0
- dioptrin-0.7.0/uv.lock +1068 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
test_data/CeO2_Pilatus1M.tif filter=lfs diff=lfs merge=lfs -text
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
CARGO_TERM_COLOR: always
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
fmt:
|
|
14
|
+
name: Format
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
19
|
+
with:
|
|
20
|
+
components: rustfmt
|
|
21
|
+
- run: cargo fmt --all -- --check
|
|
22
|
+
|
|
23
|
+
clippy:
|
|
24
|
+
name: Clippy
|
|
25
|
+
runs-on: ubuntu-latest
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v4
|
|
28
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
29
|
+
with:
|
|
30
|
+
components: clippy
|
|
31
|
+
- uses: Swatinem/rust-cache@v2
|
|
32
|
+
- run: cargo clippy --all-targets -- -D warnings
|
|
33
|
+
- run: cargo clippy --all-targets --features python -- -D warnings
|
|
34
|
+
|
|
35
|
+
test:
|
|
36
|
+
name: Test (${{ matrix.os }})
|
|
37
|
+
runs-on: ${{ matrix.os }}
|
|
38
|
+
strategy:
|
|
39
|
+
fail-fast: false
|
|
40
|
+
matrix:
|
|
41
|
+
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
with:
|
|
45
|
+
lfs: true
|
|
46
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
47
|
+
- uses: Swatinem/rust-cache@v2
|
|
48
|
+
- run: cargo build --all-targets
|
|
49
|
+
- run: cargo test
|
|
50
|
+
|
|
51
|
+
test-python:
|
|
52
|
+
name: Test Python bindings
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
steps:
|
|
55
|
+
- uses: actions/checkout@v4
|
|
56
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
57
|
+
- uses: Swatinem/rust-cache@v2
|
|
58
|
+
- uses: actions/setup-python@v5
|
|
59
|
+
with:
|
|
60
|
+
python-version: "3.12"
|
|
61
|
+
- run: pip install maturin
|
|
62
|
+
- run: cargo build --features python
|
|
63
|
+
- run: maturin build --features python
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
name: Python Build
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
tags: ['v*']
|
|
7
|
+
pull_request:
|
|
8
|
+
workflow_dispatch:
|
|
9
|
+
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
wheels:
|
|
15
|
+
name: Wheels (${{ matrix.os }}, Python ${{ matrix.python }})
|
|
16
|
+
runs-on: ${{ matrix.os }}
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-14, macos-15-intel]
|
|
21
|
+
python: ['3.11', '3.12', '3.13', '3.14', '3.15']
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v7
|
|
24
|
+
- uses: actions/setup-python@v7
|
|
25
|
+
with:
|
|
26
|
+
python-version: ${{ matrix.python }}
|
|
27
|
+
allow-prereleases: true
|
|
28
|
+
- name: Build unrestricted wheels
|
|
29
|
+
uses: PyO3/maturin-action@v1
|
|
30
|
+
with:
|
|
31
|
+
args: --release --out dist --features python -i ${{ matrix.python }}
|
|
32
|
+
sccache: 'true'
|
|
33
|
+
manylinux: '2_28'
|
|
34
|
+
- name: Check publication contents
|
|
35
|
+
run: python scripts/check_release_wheels.py dist
|
|
36
|
+
- name: Install and check unrestricted wheel
|
|
37
|
+
shell: bash
|
|
38
|
+
run: |
|
|
39
|
+
python -m pip install --only-binary=:all: dist/*.whl
|
|
40
|
+
python scripts/check_unrestricted_install.py
|
|
41
|
+
- uses: actions/upload-artifact@v7
|
|
42
|
+
with:
|
|
43
|
+
name: wheels-${{ matrix.os }}-${{ matrix.python }}
|
|
44
|
+
path: dist/*.whl
|
|
45
|
+
if-no-files-found: error
|
|
46
|
+
|
|
47
|
+
sdist:
|
|
48
|
+
name: Source distribution
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
steps:
|
|
51
|
+
- uses: actions/checkout@v7
|
|
52
|
+
- uses: actions/setup-python@v7
|
|
53
|
+
with:
|
|
54
|
+
python-version: '3.13'
|
|
55
|
+
- uses: dtolnay/rust-toolchain@stable
|
|
56
|
+
- run: python -m pip install maturin
|
|
57
|
+
- run: maturin sdist --out dist
|
|
58
|
+
- run: python scripts/check_release_wheels.py dist
|
|
59
|
+
- uses: actions/upload-artifact@v7
|
|
60
|
+
with:
|
|
61
|
+
name: sdist
|
|
62
|
+
path: dist/*.tar.gz
|
|
63
|
+
if-no-files-found: error
|
|
64
|
+
|
|
65
|
+
release:
|
|
66
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
67
|
+
needs: [wheels, sdist]
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
permissions:
|
|
70
|
+
contents: write
|
|
71
|
+
steps:
|
|
72
|
+
- uses: actions/checkout@v7
|
|
73
|
+
- uses: actions/download-artifact@v8
|
|
74
|
+
with:
|
|
75
|
+
pattern: wheels-*
|
|
76
|
+
path: dist
|
|
77
|
+
merge-multiple: true
|
|
78
|
+
- uses: actions/download-artifact@v8
|
|
79
|
+
with:
|
|
80
|
+
name: sdist
|
|
81
|
+
path: dist
|
|
82
|
+
- run: python scripts/check_release_wheels.py dist
|
|
83
|
+
- name: Create GitHub Release
|
|
84
|
+
env:
|
|
85
|
+
GH_TOKEN: ${{ github.token }}
|
|
86
|
+
run: |
|
|
87
|
+
python - <<'PYNOTES'
|
|
88
|
+
import os, re
|
|
89
|
+
from pathlib import Path
|
|
90
|
+
version = os.environ["GITHUB_REF_NAME"].removeprefix("v")
|
|
91
|
+
changelog = Path("CHANGELOG.md").read_text()
|
|
92
|
+
match = re.search(r"^## \[" + re.escape(version) + r"\].*?\n(.*?)(?=^## \[|\Z)",
|
|
93
|
+
changelog, flags=re.MULTILINE | re.DOTALL)
|
|
94
|
+
if match is None or not match.group(1).strip():
|
|
95
|
+
raise SystemExit("Missing release notes for " + version)
|
|
96
|
+
notes = match.group(1).strip()
|
|
97
|
+
root = "https://github.com/" + os.environ["GITHUB_REPOSITORY"]
|
|
98
|
+
root += "/blob/" + os.environ["GITHUB_REF_NAME"] + "/docs/"
|
|
99
|
+
notes = notes.replace("](docs/", "](" + root)
|
|
100
|
+
Path("RELEASE_NOTES.md").write_text(notes + "\n")
|
|
101
|
+
PYNOTES
|
|
102
|
+
gh release create "$GITHUB_REF_NAME" --verify-tag --notes-file RELEASE_NOTES.md dist/*.whl dist/*.tar.gz
|
|
103
|
+
|
|
104
|
+
pypi-publish:
|
|
105
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
106
|
+
needs: [wheels, sdist, release]
|
|
107
|
+
runs-on: ubuntu-latest
|
|
108
|
+
environment:
|
|
109
|
+
name: pypi
|
|
110
|
+
url: https://pypi.org/p/dioptrin/
|
|
111
|
+
permissions:
|
|
112
|
+
id-token: write
|
|
113
|
+
contents: read
|
|
114
|
+
steps:
|
|
115
|
+
- uses: actions/checkout@v7
|
|
116
|
+
- uses: actions/download-artifact@v8
|
|
117
|
+
with:
|
|
118
|
+
pattern: wheels-*
|
|
119
|
+
path: dist
|
|
120
|
+
merge-multiple: true
|
|
121
|
+
- uses: actions/download-artifact@v8
|
|
122
|
+
with:
|
|
123
|
+
name: sdist
|
|
124
|
+
path: dist
|
|
125
|
+
- run: python scripts/check_release_wheels.py dist
|
|
126
|
+
- name: Publish wheels and source distribution
|
|
127
|
+
uses: pypa/gh-action-pypi-publish@v1.14.2
|
|
128
|
+
with:
|
|
129
|
+
attestations: false
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
rust-tests:
|
|
11
|
+
name: Rust Tests
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
lfs: true
|
|
17
|
+
|
|
18
|
+
- name: Setup Rust
|
|
19
|
+
uses: dtolnay/rust-toolchain@stable
|
|
20
|
+
|
|
21
|
+
- name: Cache cargo registry
|
|
22
|
+
uses: actions/cache@v4
|
|
23
|
+
with:
|
|
24
|
+
path: ~/.cargo/registry
|
|
25
|
+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
26
|
+
|
|
27
|
+
- name: Cache cargo index
|
|
28
|
+
uses: actions/cache@v4
|
|
29
|
+
with:
|
|
30
|
+
path: ~/.cargo/git
|
|
31
|
+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
|
|
32
|
+
|
|
33
|
+
- name: Cache cargo build
|
|
34
|
+
uses: actions/cache@v4
|
|
35
|
+
with:
|
|
36
|
+
path: target
|
|
37
|
+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
|
38
|
+
|
|
39
|
+
- name: Run Rust tests
|
|
40
|
+
run: cargo test
|
|
41
|
+
|
|
42
|
+
- name: Check Rust formatting
|
|
43
|
+
run: cargo fmt -- --check
|
|
44
|
+
|
|
45
|
+
python-tests:
|
|
46
|
+
name: Python Tests & Examples
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
strategy:
|
|
49
|
+
matrix:
|
|
50
|
+
python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
|
|
51
|
+
|
|
52
|
+
steps:
|
|
53
|
+
- uses: actions/checkout@v4
|
|
54
|
+
with:
|
|
55
|
+
lfs: true
|
|
56
|
+
|
|
57
|
+
- name: Setup Python ${{ matrix.python-version }}
|
|
58
|
+
uses: actions/setup-python@v7
|
|
59
|
+
with:
|
|
60
|
+
python-version: ${{ matrix.python-version }}
|
|
61
|
+
allow-prereleases: true
|
|
62
|
+
|
|
63
|
+
- name: Setup Rust
|
|
64
|
+
uses: dtolnay/rust-toolchain@stable
|
|
65
|
+
|
|
66
|
+
- name: Cache cargo registry
|
|
67
|
+
uses: actions/cache@v4
|
|
68
|
+
with:
|
|
69
|
+
path: ~/.cargo/registry
|
|
70
|
+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
|
71
|
+
|
|
72
|
+
- name: Cache cargo index
|
|
73
|
+
uses: actions/cache@v4
|
|
74
|
+
with:
|
|
75
|
+
path: ~/.cargo/git
|
|
76
|
+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
|
|
77
|
+
|
|
78
|
+
- name: Cache cargo build
|
|
79
|
+
uses: actions/cache@v4
|
|
80
|
+
with:
|
|
81
|
+
path: target
|
|
82
|
+
key: ${{ runner.os }}-py${{ matrix.python-version }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}
|
|
83
|
+
|
|
84
|
+
- name: Install uv
|
|
85
|
+
uses: astral-sh/setup-uv@v4
|
|
86
|
+
|
|
87
|
+
- name: Install Python dependencies
|
|
88
|
+
run: |
|
|
89
|
+
uv venv .venv
|
|
90
|
+
source .venv/bin/activate
|
|
91
|
+
uv pip install maturin
|
|
92
|
+
|
|
93
|
+
- name: Build Python package
|
|
94
|
+
run: |
|
|
95
|
+
source .venv/bin/activate
|
|
96
|
+
maturin develop --features python
|
|
97
|
+
|
|
98
|
+
- name: Install test dependencies
|
|
99
|
+
run: |
|
|
100
|
+
source .venv/bin/activate
|
|
101
|
+
uv pip install .[test]
|
|
102
|
+
|
|
103
|
+
- name: Generate test output data
|
|
104
|
+
run: cargo test
|
|
105
|
+
|
|
106
|
+
- name: Test integration and array batch regressions
|
|
107
|
+
run: |
|
|
108
|
+
source .venv/bin/activate
|
|
109
|
+
python -m unittest python_examples.test_fast_math python_examples.test_batch_array_borrowing python_examples.test_image_switching python_examples.test_azimuthal_std
|
|
110
|
+
|
|
111
|
+
- name: Test typed TIFF input and persistent file workers
|
|
112
|
+
run: |
|
|
113
|
+
source .venv/bin/activate
|
|
114
|
+
python scripts/check_file_pipeline.py
|
|
115
|
+
|
|
116
|
+
- name: Run Python examples
|
|
117
|
+
run: |
|
|
118
|
+
source .venv/bin/activate
|
|
119
|
+
python test_examples.py
|
|
120
|
+
|
|
121
|
+
benchmarks:
|
|
122
|
+
name: Benchmarks (no regression check)
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@v4
|
|
126
|
+
with:
|
|
127
|
+
lfs: true
|
|
128
|
+
|
|
129
|
+
- name: Setup Rust
|
|
130
|
+
uses: dtolnay/rust-toolchain@stable
|
|
131
|
+
|
|
132
|
+
- name: Run benchmarks
|
|
133
|
+
run: |
|
|
134
|
+
cargo bench --bench integrate --no-run
|
|
135
|
+
cargo bench --bench build --no-run
|
|
136
|
+
cargo bench --bench integrator --no-run
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.vscode
|
|
2
|
+
|
|
3
|
+
/target
|
|
4
|
+
/Cargo.lock
|
|
5
|
+
|
|
6
|
+
test_data/*.tif
|
|
7
|
+
!test_data/CeO2_Pilatus1M.tif
|
|
8
|
+
!test_data/LaB6_40keV_MarCCD.tif
|
|
9
|
+
!test_data/ceo2_side.tif
|
|
10
|
+
test_data/*.tiff
|
|
11
|
+
test_data/*.h5
|
|
12
|
+
test_data/test_output/*.png
|
|
13
|
+
test_data/test_output/*.txt
|
|
14
|
+
|
|
15
|
+
*.ipynb
|
|
16
|
+
notebooks/.ipynb_checkpoints
|
|
17
|
+
|
|
18
|
+
keys/private.key
|
|
19
|
+
license.key
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.13
|
dioptrin-0.7.0/AGENTS.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Module Organization
|
|
4
|
+
- `src/` contains the Rust library code, organized by domain modules like `integration/`, `lut/`, `math/`, and core files such as `lib.rs`, `geometry.rs`, `frame.rs`, and `poni.rs`.
|
|
5
|
+
- `benches/` holds Criterion benchmarks (`integrate`, `build`) and their harness configs.
|
|
6
|
+
- `test_data/` stores PONI inputs and reference outputs; tests also create `test_data/test_output/`.
|
|
7
|
+
- `notebooks/` contains Python notebooks/scripts for validation checks.
|
|
8
|
+
- `target/` is Cargo build output and should not be edited manually.
|
|
9
|
+
|
|
10
|
+
## Build, Test, and Development Commands
|
|
11
|
+
- `cargo build` compiles the library.
|
|
12
|
+
- `cargo test` runs unit/integration tests in `src/`, including data-driven checks.
|
|
13
|
+
- `cargo bench --bench integrate` runs integration benchmarks.
|
|
14
|
+
- `cargo bench --bench build` runs LUT build benchmarks.
|
|
15
|
+
|
|
16
|
+
## Coding Style & Naming Conventions
|
|
17
|
+
- Rust 2021 edition; follow standard Rust formatting (`cargo fmt`) with default rustfmt settings (no repo-specific config).
|
|
18
|
+
- Use idiomatic naming: `snake_case` for functions/modules, `CamelCase` for types, `SCREAMING_SNAKE_CASE` for constants.
|
|
19
|
+
- Keep module boundaries aligned with the existing domain structure (e.g., integration logic under `src/integration/`).
|
|
20
|
+
|
|
21
|
+
## Testing Guidelines
|
|
22
|
+
- Tests live alongside code (e.g., `src/integration/tests.rs`) and use `#[test]`.
|
|
23
|
+
- Some tests download `test_data/CeO2_Pilatus1M.tif` from GitHub on first run; ensure network access is available.
|
|
24
|
+
- Generated comparison output is written to `test_data/test_output/`; keep this directory out of commits unless explicitly requested.
|
|
25
|
+
|
|
26
|
+
## Commit & Pull Request Guidelines
|
|
27
|
+
- Commit messages follow a simple type prefix: `feat:`, `fix:`, `refactor:`, `doc:`, `bench:` (lowercase), then a short imperative summary.
|
|
28
|
+
- PRs should describe the change, list affected modules (e.g., `src/lut/`), and include benchmark or test results when performance is touched.
|
|
29
|
+
- If behavior or outputs change, note any updated reference data under `test_data/test_reference/`.
|
|
30
|
+
|
|
31
|
+
## Configuration & Data Tips
|
|
32
|
+
- PONI geometry files live in `test_data/`; prefer adding new fixtures there with clear naming (e.g., `v3.poni`).
|
|
33
|
+
- For large artifacts or external datasets, document download sources rather than committing binaries.
|