zpybci 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 (107) hide show
  1. zpybci-0.2.0/.github/workflows/ci.yml +105 -0
  2. zpybci-0.2.0/.github/workflows/release.yml +85 -0
  3. zpybci-0.2.0/.gitignore +11 -0
  4. zpybci-0.2.0/Cargo.toml +28 -0
  5. zpybci-0.2.0/LICENSE +661 -0
  6. zpybci-0.2.0/PKG-INFO +111 -0
  7. zpybci-0.2.0/README.md +79 -0
  8. zpybci-0.2.0/benches/benchmarks.rs +2269 -0
  9. zpybci-0.2.0/ci-local.sh +65 -0
  10. zpybci-0.2.0/examples/benchmark_viz.rs +502 -0
  11. zpybci-0.2.0/examples/common/mod.rs +330 -0
  12. zpybci-0.2.0/examples/explore.rs +779 -0
  13. zpybci-0.2.0/examples/filter_demo.rs +531 -0
  14. zpybci-0.2.0/examples/pipeline_demo.rs +360 -0
  15. zpybci-0.2.0/examples/spatial_demo.rs +497 -0
  16. zpybci-0.2.0/explore.toml +101 -0
  17. zpybci-0.2.0/pyproject.toml +32 -0
  18. zpybci-0.2.0/python/.gitignore +20 -0
  19. zpybci-0.2.0/python/Cargo.lock +283 -0
  20. zpybci-0.2.0/python/Cargo.toml +14 -0
  21. zpybci-0.2.0/python/README.md +92 -0
  22. zpybci-0.2.0/python/examples/motor_imagery/__init__.py +0 -0
  23. zpybci-0.2.0/python/examples/motor_imagery/benchmark.py +255 -0
  24. zpybci-0.2.0/python/examples/motor_imagery/load_data.py +131 -0
  25. zpybci-0.2.0/python/examples/motor_imagery/sklearn_compat.py +310 -0
  26. zpybci-0.2.0/python/examples/motor_imagery/validate_pipeline.py +188 -0
  27. zpybci-0.2.0/python/src/analysis.rs +944 -0
  28. zpybci-0.2.0/python/src/artifact.rs +780 -0
  29. zpybci-0.2.0/python/src/csp.rs +579 -0
  30. zpybci-0.2.0/python/src/deconvolution.rs +219 -0
  31. zpybci-0.2.0/python/src/detection.rs +763 -0
  32. zpybci-0.2.0/python/src/filters.rs +999 -0
  33. zpybci-0.2.0/python/src/lib.rs +287 -0
  34. zpybci-0.2.0/python/src/notch.rs +338 -0
  35. zpybci-0.2.0/python/src/percentile.rs +264 -0
  36. zpybci-0.2.0/python/src/pipeline.rs +170 -0
  37. zpybci-0.2.0/python/src/resampling.rs +476 -0
  38. zpybci-0.2.0/python/src/riemannian.rs +186 -0
  39. zpybci-0.2.0/python/src/spatial.rs +955 -0
  40. zpybci-0.2.0/python/src/spectral.rs +762 -0
  41. zpybci-0.2.0/python/src/stats.rs +334 -0
  42. zpybci-0.2.0/python/src/sync.rs +402 -0
  43. zpybci-0.2.0/python/src/utils.rs +14 -0
  44. zpybci-0.2.0/python/src/wavelet.rs +398 -0
  45. zpybci-0.2.0/python/src/welch.rs +179 -0
  46. zpybci-0.2.0/python/src/window.rs +102 -0
  47. zpybci-0.2.0/python/src/xcorr.rs +285 -0
  48. zpybci-0.2.0/python/tests/test_analysis.py +325 -0
  49. zpybci-0.2.0/python/tests/test_artifact.py +322 -0
  50. zpybci-0.2.0/python/tests/test_csp.py +267 -0
  51. zpybci-0.2.0/python/tests/test_deconvolution.py +106 -0
  52. zpybci-0.2.0/python/tests/test_detection.py +284 -0
  53. zpybci-0.2.0/python/tests/test_filters.py +543 -0
  54. zpybci-0.2.0/python/tests/test_hilbert.py +153 -0
  55. zpybci-0.2.0/python/tests/test_iir.py +122 -0
  56. zpybci-0.2.0/python/tests/test_notch.py +115 -0
  57. zpybci-0.2.0/python/tests/test_online_cov.py +129 -0
  58. zpybci-0.2.0/python/tests/test_percentile.py +231 -0
  59. zpybci-0.2.0/python/tests/test_pipeline.py +342 -0
  60. zpybci-0.2.0/python/tests/test_resampling.py +267 -0
  61. zpybci-0.2.0/python/tests/test_riemannian.py +119 -0
  62. zpybci-0.2.0/python/tests/test_scipy_validation.py +513 -0
  63. zpybci-0.2.0/python/tests/test_sklearn_compat.py +366 -0
  64. zpybci-0.2.0/python/tests/test_spatial.py +366 -0
  65. zpybci-0.2.0/python/tests/test_spectral.py +398 -0
  66. zpybci-0.2.0/python/tests/test_stats.py +184 -0
  67. zpybci-0.2.0/python/tests/test_sync.py +231 -0
  68. zpybci-0.2.0/python/tests/test_wavelet.py +260 -0
  69. zpybci-0.2.0/python/tests/test_welch.py +175 -0
  70. zpybci-0.2.0/python/tests/test_window.py +138 -0
  71. zpybci-0.2.0/python/tests/test_xcorr.py +294 -0
  72. zpybci-0.2.0/python/validation/compare_scipy.py +497 -0
  73. zpybci-0.2.0/src/artifact.rs +921 -0
  74. zpybci-0.2.0/src/bandpower.rs +1032 -0
  75. zpybci-0.2.0/src/buffer.rs +296 -0
  76. zpybci-0.2.0/src/csp.rs +1129 -0
  77. zpybci-0.2.0/src/decimate.rs +354 -0
  78. zpybci-0.2.0/src/deconvolution.rs +705 -0
  79. zpybci-0.2.0/src/detector.rs +1758 -0
  80. zpybci-0.2.0/src/envelope.rs +406 -0
  81. zpybci-0.2.0/src/fft.rs +477 -0
  82. zpybci-0.2.0/src/filter/ac.rs +370 -0
  83. zpybci-0.2.0/src/filter/car.rs +401 -0
  84. zpybci-0.2.0/src/filter/fir.rs +285 -0
  85. zpybci-0.2.0/src/filter/iir.rs +575 -0
  86. zpybci-0.2.0/src/filter/laplacian.rs +908 -0
  87. zpybci-0.2.0/src/filter/lms.rs +697 -0
  88. zpybci-0.2.0/src/filter/median.rs +923 -0
  89. zpybci-0.2.0/src/filter/mod.rs +17 -0
  90. zpybci-0.2.0/src/filter/nlms.rs +627 -0
  91. zpybci-0.2.0/src/hilbert.rs +758 -0
  92. zpybci-0.2.0/src/interpolate.rs +575 -0
  93. zpybci-0.2.0/src/lib.rs +132 -0
  94. zpybci-0.2.0/src/linalg.rs +1029 -0
  95. zpybci-0.2.0/src/notch.rs +378 -0
  96. zpybci-0.2.0/src/percentile.rs +676 -0
  97. zpybci-0.2.0/src/pipeline.rs +905 -0
  98. zpybci-0.2.0/src/riemannian.rs +659 -0
  99. zpybci-0.2.0/src/rms.rs +545 -0
  100. zpybci-0.2.0/src/router.rs +584 -0
  101. zpybci-0.2.0/src/stats.rs +395 -0
  102. zpybci-0.2.0/src/stft.rs +697 -0
  103. zpybci-0.2.0/src/sync.rs +1184 -0
  104. zpybci-0.2.0/src/wavelet.rs +925 -0
  105. zpybci-0.2.0/src/welch.rs +614 -0
  106. zpybci-0.2.0/src/window.rs +558 -0
  107. zpybci-0.2.0/src/xcorr.rs +945 -0
@@ -0,0 +1,105 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main, dev]
6
+ pull_request:
7
+ branches: [main, dev]
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
+ - name: Install system dependencies
29
+ run: |
30
+ sudo apt-get update
31
+ sudo apt-get install -y libfontconfig1-dev
32
+ - uses: dtolnay/rust-toolchain@stable
33
+ with:
34
+ components: clippy
35
+ - uses: Swatinem/rust-cache@v2
36
+ - run: cargo clippy --all-targets -- -D warnings
37
+
38
+ test:
39
+ name: Test (${{ matrix.os }})
40
+ runs-on: ${{ matrix.os }}
41
+ strategy:
42
+ fail-fast: false
43
+ matrix:
44
+ os: [ubuntu-latest, macos-latest]
45
+ steps:
46
+ - uses: actions/checkout@v4
47
+ - name: Install system dependencies (Linux)
48
+ if: runner.os == 'Linux'
49
+ run: |
50
+ sudo apt-get update
51
+ sudo apt-get install -y libfontconfig1-dev
52
+ - uses: dtolnay/rust-toolchain@stable
53
+ - uses: Swatinem/rust-cache@v2
54
+ - run: cargo test
55
+
56
+ python:
57
+ name: Python Bindings (${{ matrix.os }})
58
+ runs-on: ${{ matrix.os }}
59
+ strategy:
60
+ fail-fast: false
61
+ matrix:
62
+ os: [ubuntu-latest, macos-latest]
63
+ python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ - name: Set up Python ${{ matrix.python-version }}
67
+ uses: actions/setup-python@v5
68
+ with:
69
+ python-version: ${{ matrix.python-version }}
70
+ - uses: dtolnay/rust-toolchain@stable
71
+ - uses: Swatinem/rust-cache@v2
72
+ - name: Install maturin and pytest
73
+ run: pip install maturin pytest numpy scikit-learn
74
+ - name: Clean old wheels
75
+ run: rm -rf python/target/wheels/
76
+ - name: Build Python wheel
77
+ working-directory: python
78
+ run: maturin build --release
79
+ env:
80
+ PYO3_USE_ABI3_FORWARD_COMPATIBILITY: 1
81
+ - name: Install wheel
82
+ run: pip install python/target/wheels/zpybci-*.whl --force-reinstall
83
+ - name: Run Python tests
84
+ run: pytest python/tests/ -v
85
+
86
+ doc:
87
+ name: Documentation
88
+ runs-on: ubuntu-latest
89
+ steps:
90
+ - uses: actions/checkout@v4
91
+ - uses: dtolnay/rust-toolchain@stable
92
+ - uses: Swatinem/rust-cache@v2
93
+ - run: cargo doc --no-deps
94
+ env:
95
+ RUSTDOCFLAGS: -D warnings
96
+
97
+ # Minimum supported Rust version check
98
+ msrv:
99
+ name: MSRV (1.70.0)
100
+ runs-on: ubuntu-latest
101
+ steps:
102
+ - uses: actions/checkout@v4
103
+ - uses: dtolnay/rust-toolchain@1.70.0
104
+ - uses: Swatinem/rust-cache@v2
105
+ - run: cargo check
@@ -0,0 +1,85 @@
1
+ name: Release to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*' # Trigger on version tags: v0.1.0, v1.2.3, etc.
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ build-wheels:
13
+ name: Build wheels (${{ matrix.os }}-${{ matrix.target }})
14
+ runs-on: ${{ matrix.os }}
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ # Linux x86_64
20
+ - os: ubuntu-latest
21
+ target: x86_64-unknown-linux-gnu
22
+ # Linux aarch64 (cross-compile)
23
+ - os: ubuntu-latest
24
+ target: aarch64-unknown-linux-gnu
25
+ # macOS universal2 (Intel + Apple Silicon in one wheel)
26
+ - os: macos-latest
27
+ target: universal2-apple-darwin
28
+ # Windows x86_64
29
+ - os: windows-latest
30
+ target: x86_64-pc-windows-msvc
31
+
32
+ steps:
33
+ - uses: actions/checkout@v4
34
+
35
+ - name: Build wheels
36
+ uses: PyO3/maturin-action@v1
37
+ with:
38
+ target: ${{ matrix.target }}
39
+ args: --release --out dist --manifest-path python/Cargo.toml
40
+ sccache: 'true'
41
+ manylinux: auto
42
+
43
+ - name: Upload wheels
44
+ uses: actions/upload-artifact@v4
45
+ with:
46
+ name: wheels-${{ matrix.os }}-${{ matrix.target }}
47
+ path: dist
48
+
49
+ build-sdist:
50
+ name: Build source distribution
51
+ runs-on: ubuntu-latest
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+
55
+ - name: Build sdist
56
+ uses: PyO3/maturin-action@v1
57
+ with:
58
+ command: sdist
59
+ args: --out dist --manifest-path python/Cargo.toml
60
+
61
+ - name: Upload sdist
62
+ uses: actions/upload-artifact@v4
63
+ with:
64
+ name: wheels-sdist
65
+ path: dist
66
+
67
+ publish:
68
+ name: Publish to PyPI
69
+ runs-on: ubuntu-latest
70
+ needs: [build-wheels, build-sdist]
71
+ environment:
72
+ name: pypi
73
+ url: https://pypi.org/project/zpybci/
74
+ permissions:
75
+ id-token: write # Required for trusted publishing
76
+ steps:
77
+ - name: Download all wheels
78
+ uses: actions/download-artifact@v4
79
+ with:
80
+ pattern: wheels-*
81
+ merge-multiple: true
82
+ path: dist
83
+
84
+ - name: Publish to PyPI
85
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,11 @@
1
+ # Added by cargo
2
+
3
+ /target
4
+ /python/target
5
+ Cargo.lock
6
+
7
+ # Claude Code settings and context (user-specific)
8
+ .claude/
9
+
10
+ # Generated output from examples (plots, CSV files)
11
+ /output/
@@ -0,0 +1,28 @@
1
+ [package]
2
+ name = "zerostone"
3
+ version = "0.1.0"
4
+ edition = "2021"
5
+ description = "High-performance, zero-allocation signal processing primitives for BCI and real-time systems"
6
+ license = "AGPL-3.0"
7
+ keywords = ["bci", "signal-processing", "dsp", "neuroscience", "no-std"]
8
+ categories = ["science", "no-std::no-alloc", "embedded"]
9
+ readme = "README.md"
10
+
11
+ [dependencies]
12
+ libm = "0.2"
13
+
14
+ [dev-dependencies]
15
+ criterion = { version = "0.5", default-features = false }
16
+ plotters = "0.3"
17
+ csv = "1.3"
18
+ clap = { version = "4.0", features = ["derive"] }
19
+ serde = { version = "1.0", features = ["derive"] }
20
+ toml = "0.8"
21
+
22
+ [[bench]]
23
+ name = "benchmarks"
24
+ harness = false
25
+
26
+ [[example]]
27
+ name = "filter_demo"
28
+ path = "examples/filter_demo.rs"