ezmsg-sigproc 2.2.0__tar.gz → 2.4.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 (143) hide show
  1. ezmsg_sigproc-2.4.0/.github/workflows/docs.yml +65 -0
  2. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/.gitignore +3 -0
  3. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/PKG-INFO +1 -1
  4. ezmsg_sigproc-2.4.0/docs/Makefile +20 -0
  5. ezmsg_sigproc-2.4.0/docs/make.bat +35 -0
  6. ezmsg_sigproc-2.4.0/docs/source/_templates/autosummary/module.rst +64 -0
  7. ezmsg_sigproc-2.4.0/docs/source/api/index.rst +157 -0
  8. ezmsg_sigproc-2.4.0/docs/source/conf.py +127 -0
  9. ezmsg_sigproc-2.4.0/docs/source/guides/HybridBuffer.md +87 -0
  10. ezmsg_sigproc-2.4.0/docs/source/guides/explanations/sigproc.rst +365 -0
  11. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/adaptive.rst +4 -0
  12. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/checkpoint.rst +4 -0
  13. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/composite.rst +4 -0
  14. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/content-signalprocessing.rst +13 -0
  15. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/processor.rst +4 -0
  16. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/standalone.rst +4 -0
  17. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/stateful.rst +4 -0
  18. ezmsg_sigproc-2.4.0/docs/source/guides/how-tos/signalprocessing/unit.rst +11 -0
  19. ezmsg_sigproc-2.4.0/docs/source/guides/img/HybridBufferBasic.svg +4 -0
  20. ezmsg_sigproc-2.4.0/docs/source/guides/img/HybridBufferOverflow.svg +4 -0
  21. ezmsg_sigproc-2.4.0/docs/source/guides/sigproc/base.rst +65 -0
  22. ezmsg_sigproc-2.4.0/docs/source/guides/sigproc/content-sigproc.rst +22 -0
  23. ezmsg_sigproc-2.4.0/docs/source/guides/sigproc/processors.rst +149 -0
  24. ezmsg_sigproc-2.4.0/docs/source/guides/sigproc/units.rst +29 -0
  25. ezmsg_sigproc-2.4.0/docs/source/guides/tutorials/signalprocessing.rst +615 -0
  26. ezmsg_sigproc-2.4.0/docs/source/index.rst +82 -0
  27. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/pyproject.toml +11 -0
  28. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/__version__.py +16 -3
  29. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/aggregate.py +69 -0
  30. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/denormalize.py +86 -0
  31. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/fbcca.py +332 -0
  32. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/filter.py +16 -0
  33. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/filterbankdesign.py +136 -0
  34. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/firfilter.py +119 -0
  35. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/kaiser.py +110 -0
  36. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/resample.py +299 -0
  37. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/sampler.py +71 -83
  38. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/util/axisarray_buffer.py +379 -0
  39. ezmsg_sigproc-2.4.0/src/ezmsg/sigproc/util/buffer.py +470 -0
  40. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/window.py +12 -10
  41. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/helpers/util.py +1 -1
  42. ezmsg_sigproc-2.4.0/tests/unit/buffer/test_axisarray_buffer.py +589 -0
  43. ezmsg_sigproc-2.4.0/tests/unit/buffer/test_buffer.py +442 -0
  44. ezmsg_sigproc-2.4.0/tests/unit/buffer/test_buffer_overflow.py +203 -0
  45. ezmsg_sigproc-2.4.0/tests/unit/test_aggregate.py +411 -0
  46. ezmsg_sigproc-2.4.0/tests/unit/test_denormalize.py +245 -0
  47. ezmsg_sigproc-2.4.0/tests/unit/test_fbcca.py +766 -0
  48. ezmsg_sigproc-2.4.0/tests/unit/test_filterbankdesign.py +692 -0
  49. ezmsg_sigproc-2.4.0/tests/unit/test_firfilter.py +287 -0
  50. ezmsg_sigproc-2.4.0/tests/unit/test_kaiser.py +426 -0
  51. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_resample.py +12 -5
  52. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_sampler.py +10 -10
  53. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_window.py +106 -68
  54. ezmsg_sigproc-2.2.0/src/ezmsg/sigproc/resample.py +0 -298
  55. ezmsg_sigproc-2.2.0/tests/unit/test_aggregate.py +0 -161
  56. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/.github/workflows/python-publish-ezmsg-sigproc.yml +0 -0
  57. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/.github/workflows/python-tests.yml +0 -0
  58. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/.pre-commit-config.yaml +0 -0
  59. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/LICENSE.txt +0 -0
  60. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/README.md +0 -0
  61. {ezmsg_sigproc-2.2.0/docs → ezmsg_sigproc-2.4.0/docs/source/guides}/ProcessorsBase.md +0 -0
  62. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/__init__.py +0 -0
  63. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/activation.py +0 -0
  64. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/adaptive_lattice_notch.py +0 -0
  65. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/affinetransform.py +0 -0
  66. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/bandpower.py +0 -0
  67. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/base.py +0 -0
  68. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/butterworthfilter.py +0 -0
  69. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/cheby.py +0 -0
  70. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/combfilter.py +0 -0
  71. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/decimate.py +0 -0
  72. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/detrend.py +0 -0
  73. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/diff.py +0 -0
  74. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/downsample.py +0 -0
  75. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/ewma.py +0 -0
  76. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/ewmfilter.py +0 -0
  77. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/extract_axis.py +0 -0
  78. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/filterbank.py +0 -0
  79. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/gaussiansmoothing.py +0 -0
  80. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/__init__.py +0 -0
  81. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/abs.py +0 -0
  82. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/clip.py +0 -0
  83. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/difference.py +0 -0
  84. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/invert.py +0 -0
  85. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/log.py +0 -0
  86. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/math/scale.py +0 -0
  87. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/messages.py +0 -0
  88. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/quantize.py +0 -0
  89. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/scaler.py +0 -0
  90. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/signalinjector.py +0 -0
  91. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/slicer.py +0 -0
  92. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/spectral.py +0 -0
  93. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/spectrogram.py +0 -0
  94. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/spectrum.py +0 -0
  95. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/synth.py +0 -0
  96. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/transpose.py +0 -0
  97. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/__init__.py +0 -0
  98. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/asio.py +0 -0
  99. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/message.py +0 -0
  100. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/profile.py +0 -0
  101. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/sparse.py +0 -0
  102. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/util/typeresolution.py +0 -0
  103. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/src/ezmsg/sigproc/wavelets.py +0 -0
  104. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/__init__.py +0 -0
  105. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/conftest.py +0 -0
  106. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/helpers/__init__.py +0 -0
  107. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/bytewax/test_spectrum_bytewax.py +0 -0
  108. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/bytewax/test_window_bytewax.py +0 -0
  109. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_butterworth_system.py +0 -0
  110. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_decimate_system.py +0 -0
  111. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_downsample_system.py +0 -0
  112. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_filter_system.py +0 -0
  113. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_sampler_system.py +0 -0
  114. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_scaler_system.py +0 -0
  115. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_spectrum_system.py +0 -0
  116. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_synth_system.py +0 -0
  117. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/integration/ezmsg/test_window_system.py +0 -0
  118. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/resources/xform.csv +0 -0
  119. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/test_profile.py +0 -0
  120. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_activation.py +0 -0
  121. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_adaptive_lattice_notch.py +0 -0
  122. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_affine_transform.py +0 -0
  123. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_bandpower.py +0 -0
  124. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_base.py +0 -0
  125. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_butter.py +0 -0
  126. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_combfilter.py +0 -0
  127. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_diff.py +0 -0
  128. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_downsample.py +0 -0
  129. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_ewma.py +0 -0
  130. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_extract_axis.py +0 -0
  131. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_filter.py +0 -0
  132. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_filterbank.py +0 -0
  133. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_gaussian_smoothing_filter.py +0 -0
  134. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_math.py +0 -0
  135. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_quantize.py +0 -0
  136. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_scaler.py +0 -0
  137. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_slicer.py +0 -0
  138. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_spectrogram.py +0 -0
  139. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_spectrum.py +0 -0
  140. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_synth.py +0 -0
  141. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_transpose.py +0 -0
  142. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_util.py +0 -0
  143. {ezmsg_sigproc-2.2.0 → ezmsg_sigproc-2.4.0}/tests/unit/test_wavelets.py +0 -0
@@ -0,0 +1,65 @@
1
+ name: Documentation
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ tags:
8
+ - 'v*'
9
+ pull_request:
10
+ branches:
11
+ - dev
12
+ workflow_dispatch:
13
+
14
+ permissions:
15
+ contents: read
16
+ pages: write
17
+ id-token: write
18
+
19
+ # Allow only one concurrent deployment
20
+ concurrency:
21
+ group: "pages"
22
+ cancel-in-progress: false
23
+
24
+ jobs:
25
+ build:
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0 # Needed for hatch-vcs to determine version
31
+
32
+ - name: Install uv
33
+ uses: astral-sh/setup-uv@v6
34
+ with:
35
+ enable-cache: true
36
+ python-version: "3.12"
37
+
38
+ - name: Install the project
39
+ run: uv sync --only-group docs
40
+
41
+ - name: Build documentation
42
+ run: |
43
+ cd docs
44
+ uv run make html
45
+
46
+ - name: Add .nojekyll file
47
+ run: touch docs/build/html/.nojekyll
48
+
49
+ - name: Upload artifact
50
+ uses: actions/upload-pages-artifact@v3
51
+ with:
52
+ path: 'docs/build/html'
53
+
54
+ deploy:
55
+ # Only deploy on push to main or release tags
56
+ if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
57
+ environment:
58
+ name: github-pages
59
+ url: ${{ steps.deployment.outputs.page_url }}
60
+ runs-on: ubuntu-latest
61
+ needs: build
62
+ steps:
63
+ - name: Deploy to GitHub Pages
64
+ id: deployment
65
+ uses: actions/deploy-pages@v4
@@ -70,8 +70,10 @@ instance/
70
70
 
71
71
  # Sphinx documentation
72
72
  docs/_build/
73
+ docs/build/
73
74
  docs/source/_build
74
75
  docs/source/generated
76
+ docs/source/api/generated
75
77
 
76
78
  # PyBuilder
77
79
  .pybuilder/
@@ -144,3 +146,4 @@ cython_debug/
144
146
 
145
147
  src/ezmsg/sigproc/__version__.py
146
148
  uv.lock
149
+ *.local.json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ezmsg-sigproc
3
- Version: 2.2.0
3
+ Version: 2.4.0
4
4
  Summary: Timeseries signal processing implementations in ezmsg
5
5
  Author-email: Griffin Milsap <griffin.milsap@gmail.com>, Preston Peranich <pperanich@gmail.com>, Chadwick Boulay <chadwick.boulay@gmail.com>
6
6
  License-Expression: MIT
@@ -0,0 +1,20 @@
1
+ # Minimal makefile for Sphinx documentation
2
+ #
3
+
4
+ # You can set these variables from the command line, and also
5
+ # from the environment for the first two.
6
+ SPHINXOPTS ?=
7
+ SPHINXBUILD ?= sphinx-build
8
+ SOURCEDIR = source
9
+ BUILDDIR = build
10
+
11
+ # Put it first so that "make" without argument is like "make help".
12
+ help:
13
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14
+
15
+ .PHONY: help Makefile
16
+
17
+ # Catch-all target: route all unknown targets to Sphinx using the new
18
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19
+ %: Makefile
20
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,35 @@
1
+ @ECHO OFF
2
+
3
+ pushd %~dp0
4
+
5
+ REM Command file for Sphinx documentation
6
+
7
+ if "%SPHINXBUILD%" == "" (
8
+ set SPHINXBUILD=sphinx-build
9
+ )
10
+ set SOURCEDIR=source
11
+ set BUILDDIR=build
12
+
13
+ if "%1" == "" goto help
14
+
15
+ %SPHINXBUILD% >NUL 2>NUL
16
+ if errorlevel 9009 (
17
+ echo.
18
+ echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
19
+ echo.installed, then set the SPHINXBUILD environment variable to point
20
+ echo.to the full path of the 'sphinx-build' executable. Alternatively you
21
+ echo.may add the Sphinx directory to PATH.
22
+ echo.
23
+ echo.If you don't have Sphinx installed, grab it from
24
+ echo.http://sphinx-doc.org/
25
+ exit /b 1
26
+ )
27
+
28
+ %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29
+ goto end
30
+
31
+ :help
32
+ %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33
+
34
+ :end
35
+ popd
@@ -0,0 +1,64 @@
1
+ {{ fullname | escape | underline}}
2
+
3
+ .. automodule:: {{ fullname }}
4
+
5
+ {% block attributes %}
6
+ {% if attributes %}
7
+ .. rubric:: Module Attributes
8
+
9
+ .. autosummary::
10
+ :toctree:
11
+ {% for item in attributes %}
12
+ {{ item }}
13
+ {%- endfor %}
14
+ {% endif %}
15
+ {% endblock %}
16
+
17
+ {% block functions %}
18
+ {% if functions %}
19
+ .. rubric:: Functions
20
+
21
+ {% for item in functions %}
22
+ .. autofunction:: {{ item }}
23
+ {%- endfor %}
24
+ {% endif %}
25
+ {% endblock %}
26
+
27
+ {% block classes %}
28
+ {% if classes %}
29
+ .. rubric:: Classes
30
+
31
+ {% for item in classes %}
32
+ .. autoclass:: {{ item }}
33
+ :members:
34
+ :undoc-members:
35
+ :show-inheritance:
36
+ :special-members: __init__
37
+ {%- endfor %}
38
+ {% endif %}
39
+ {% endblock %}
40
+
41
+ {% block exceptions %}
42
+ {% if exceptions %}
43
+ .. rubric:: Exceptions
44
+
45
+ {% for item in exceptions %}
46
+ .. autoexception:: {{ item }}
47
+ :members:
48
+ :show-inheritance:
49
+ {%- endfor %}
50
+ {% endif %}
51
+ {% endblock %}
52
+
53
+ {% block modules %}
54
+ {% if modules %}
55
+ .. rubric:: Modules
56
+
57
+ .. autosummary::
58
+ :toctree:
59
+ :recursive:
60
+ {% for item in modules %}
61
+ {{ item }}
62
+ {%- endfor %}
63
+ {% endif %}
64
+ {% endblock %}
@@ -0,0 +1,157 @@
1
+ API Reference
2
+ =============
3
+
4
+ This page contains the complete API reference for ``ezmsg.sigproc``.
5
+
6
+ .. contents:: Modules
7
+ :local:
8
+ :depth: 1
9
+
10
+ Base Processors
11
+ ---------------
12
+
13
+ Core processor protocols and base classes.
14
+
15
+ .. autosummary::
16
+ :toctree: generated
17
+ :recursive:
18
+
19
+ ezmsg.sigproc.base
20
+
21
+ Filtering
22
+ ---------
23
+
24
+ Various filter implementations for signal processing.
25
+
26
+ .. autosummary::
27
+ :toctree: generated
28
+ :recursive:
29
+
30
+ ezmsg.sigproc.filter
31
+ ezmsg.sigproc.butterworthfilter
32
+ ezmsg.sigproc.cheby
33
+ ezmsg.sigproc.combfilter
34
+ ezmsg.sigproc.adaptive_lattice_notch
35
+ ezmsg.sigproc.firfilter
36
+ ezmsg.sigproc.kaiser
37
+ ezmsg.sigproc.ewmfilter
38
+ ezmsg.sigproc.filterbank
39
+ ezmsg.sigproc.filterbankdesign
40
+ ezmsg.sigproc.gaussiansmoothing
41
+
42
+ Spectral Analysis
43
+ -----------------
44
+
45
+ Spectral and frequency domain analysis tools.
46
+
47
+ .. autosummary::
48
+ :toctree: generated
49
+ :recursive:
50
+
51
+ ezmsg.sigproc.spectral
52
+ ezmsg.sigproc.spectrogram
53
+ ezmsg.sigproc.spectrum
54
+ ezmsg.sigproc.wavelets
55
+ ezmsg.sigproc.bandpower
56
+ ezmsg.sigproc.fbcca
57
+
58
+ Sampling & Resampling
59
+ ---------------------
60
+
61
+ Signal sampling, windowing, and resampling operations.
62
+
63
+ .. autosummary::
64
+ :toctree: generated
65
+ :recursive:
66
+
67
+ ezmsg.sigproc.sampler
68
+ ezmsg.sigproc.window
69
+ ezmsg.sigproc.resample
70
+ ezmsg.sigproc.downsample
71
+ ezmsg.sigproc.decimate
72
+
73
+ Signal Conditioning
74
+ -------------------
75
+
76
+ Signal preprocessing and conditioning operations.
77
+
78
+ .. autosummary::
79
+ :toctree: generated
80
+ :recursive:
81
+
82
+ ezmsg.sigproc.scaler
83
+ ezmsg.sigproc.detrend
84
+ ezmsg.sigproc.activation
85
+ ezmsg.sigproc.quantize
86
+ ezmsg.sigproc.ewma
87
+
88
+ Transformations
89
+ ---------------
90
+
91
+ Geometric and structural transformations.
92
+
93
+ .. autosummary::
94
+ :toctree: generated
95
+ :recursive:
96
+
97
+ ezmsg.sigproc.affinetransform
98
+ ezmsg.sigproc.transpose
99
+ ezmsg.sigproc.extract_axis
100
+ ezmsg.sigproc.slicer
101
+
102
+ Signal Operations
103
+ -----------------
104
+
105
+ Aggregation, difference, and other signal operations.
106
+
107
+ .. autosummary::
108
+ :toctree: generated
109
+ :recursive:
110
+
111
+ ezmsg.sigproc.aggregate
112
+ ezmsg.sigproc.diff
113
+
114
+ Signal Generation
115
+ -----------------
116
+
117
+ Synthetic signal generators and injectors.
118
+
119
+ .. autosummary::
120
+ :toctree: generated
121
+ :recursive:
122
+
123
+ ezmsg.sigproc.synth
124
+ ezmsg.sigproc.signalinjector
125
+
126
+ Messages & Data Structures
127
+ ---------------------------
128
+
129
+ Message types and data structures.
130
+
131
+ .. autosummary::
132
+ :toctree: generated
133
+ :recursive:
134
+
135
+ ezmsg.sigproc.messages
136
+
137
+ Math Utilities
138
+ --------------
139
+
140
+ Mathematical operations on signals.
141
+
142
+ .. autosummary::
143
+ :toctree: generated
144
+ :recursive:
145
+
146
+ ezmsg.sigproc.math
147
+
148
+ Utilities
149
+ ---------
150
+
151
+ Helper utilities for signal processing.
152
+
153
+ .. autosummary::
154
+ :toctree: generated
155
+ :recursive:
156
+
157
+ ezmsg.sigproc.util
@@ -0,0 +1,127 @@
1
+ # Configuration file for the Sphinx documentation builder.
2
+
3
+ import os
4
+ import sys
5
+
6
+ # Add the source directory to the path
7
+ sys.path.insert(0, os.path.abspath("../../src"))
8
+
9
+ # -- Project information --------------------------
10
+
11
+ project = "ezmsg.sigproc"
12
+ copyright = "2024, ezmsg Contributors"
13
+ author = "ezmsg Contributors"
14
+
15
+ # The version is managed by hatch-vcs and stored in __version__.py
16
+ try:
17
+ from ezmsg.sigproc.__version__ import version as release
18
+ except ImportError:
19
+ release = "unknown"
20
+
21
+ # For display purposes, extract the base version without git commit info
22
+ version = release.split("+")[0] if release != "unknown" else release
23
+
24
+ # -- General configuration --------------------------
25
+
26
+ extensions = [
27
+ "sphinx.ext.autodoc",
28
+ "sphinx.ext.autosummary",
29
+ "sphinx.ext.napoleon",
30
+ "sphinx.ext.intersphinx",
31
+ "sphinx.ext.viewcode",
32
+ "sphinx.ext.duration",
33
+ # "sphinx_autodoc_typehints", # Disabled due to compatibility issue
34
+ "sphinx_copybutton",
35
+ "myst_parser", # For markdown files
36
+ ]
37
+
38
+ templates_path = ["_templates"]
39
+ source_suffix = {
40
+ ".rst": "restructuredtext",
41
+ ".md": "markdown",
42
+ }
43
+ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
44
+
45
+ # The toctree master document
46
+ master_doc = "index"
47
+
48
+ # -- Autodoc configuration ------------------------------
49
+
50
+ # Auto-generate API docs
51
+ autosummary_generate = True
52
+ autosummary_imported_members = False
53
+ autodoc_typehints = "description"
54
+ autodoc_member_order = "bysource"
55
+ autodoc_typehints_format = "short"
56
+ python_use_unqualified_type_names = True
57
+ autodoc_default_options = {
58
+ "members": True,
59
+ "member-order": "bysource",
60
+ "special-members": "__init__",
61
+ "undoc-members": True,
62
+ "show-inheritance": True,
63
+ }
64
+
65
+ # Don't show the full module path in the docs
66
+ add_module_names = False
67
+
68
+ # -- Intersphinx configuration --------------------------
69
+
70
+ intersphinx_mapping = {
71
+ "python": ("https://docs.python.org/3/", None),
72
+ "numpy": ("https://numpy.org/doc/stable/", None),
73
+ "scipy": ("https://scipy.org/doc/scipy/", None),
74
+ "ezmsg": ("https://www.ezmsg.org/ezmsg/", None),
75
+ "ezmsg.learn": ("https://www.ezmsg.org/ezmsg-learn/", None),
76
+ "ezmsg.event": ("https://www.ezmsg.org/ezmsg-event/", None),
77
+ "ezmsg.lsl": ("https://www.ezmsg.org/ezmsg-lsl/", None),
78
+ "ezmsg.blackrock": ("https://www.ezmsg.org/ezmsg-blackrock/", None),
79
+ }
80
+ intersphinx_disabled_domains = ["std"]
81
+
82
+ # -- Options for HTML output -----------------------------
83
+
84
+ html_theme = "pydata_sphinx_theme"
85
+ html_static_path = ["_static"]
86
+
87
+ # Set the base URL for the documentation
88
+ html_baseurl = "https://www.ezmsg.org/ezmsg-sigproc/"
89
+
90
+ html_theme_options = {
91
+ "logo": {
92
+ "text": f"ezmsg.sigproc {version}",
93
+ "link": "https://ezmsg.org", # Link back to main site
94
+ },
95
+ "header_links_before_dropdown": 4,
96
+ "navbar_start": ["navbar-logo"],
97
+ "navbar_end": ["theme-switcher", "navbar-icon-links"],
98
+ "icon_links": [
99
+ {
100
+ "name": "GitHub",
101
+ "url": "https://github.com/ezmsg-org/ezmsg-sigproc",
102
+ "icon": "fa-brands fa-github",
103
+ },
104
+ {
105
+ "name": "ezmsg.org",
106
+ "url": "https://www.ezmsg.org",
107
+ "icon": "fa-solid fa-house",
108
+ },
109
+ ],
110
+ }
111
+
112
+ # Timestamp is inserted at every page bottom in this strftime format.
113
+ html_last_updated_fmt = "%Y-%m-%d"
114
+
115
+ # -- Options for linkcode -----------------------------
116
+
117
+ branch = "main"
118
+ code_url = f"https://github.com/ezmsg-org/ezmsg-sigproc/blob/{branch}/"
119
+
120
+
121
+ def linkcode_resolve(domain, info):
122
+ if domain != "py":
123
+ return None
124
+ if not info["module"]:
125
+ return None
126
+ filename = info["module"].replace(".", "/")
127
+ return f"{code_url}src/{filename}.py"
@@ -0,0 +1,87 @@
1
+ ## HybridBuffer
2
+
3
+ The HybridBuffer is a stateful, FIFO buffer that combines a deque for fast appends with a contiguous circular buffer for efficient, advancing reads. The synchronization between the deque and the circular buffer can be immediate, upon threshold reaching, or on demand, allowing for flexible data management strategies.
4
+
5
+ This buffer is designed to be agnostic to the array library used (e.g., NumPy, CuPy, PyTorch) via the Python Array API standard.
6
+
7
+ ### Basic Reading and Writing Behaviour
8
+
9
+ The following diagram illustrates the states of the HybridBuffer across data writes and reads when `update_strategy="on_demand"`:
10
+
11
+ ![HybridBuffer Basic States](img/HybridBufferBasic.svg)
12
+
13
+ **Figure 1**
14
+
15
+ A. In the initial state, the buffer is empty, with no data in either the deque or the circular buffer.
16
+ * deq_len=0; available=0, tell=0
17
+
18
+ B. After we `write()` 4 samples, the deque contains the new data, but the circular buffer is still empty.
19
+ * deq_len=4; available=4, tell=0
20
+
21
+ C. After we `write()` 4 more samples, the deque now has 2 messages, each with 4 samples, and the circular buffer remains untouched.
22
+ * deq_len=8; available=8, tell=0
23
+
24
+ D. Panels D-F depict a single call to `read(4)` which is implemented as calls to other methods. If we don't have 4 unread samples in the circular buffer, but we do have >= 4 samples 'available' (i.e., including the deque), then a `flush()` is performed: the entirety of the data in the deque are copied to the circular buffer and the deque is cleared.
25
+ * deq_len=0; available=8, tell=0
26
+ * TODO: Currently `flush()` copies the data twice, once from the deque to a contiguous array, and then from that contiguous array to the circular buffer. This should be optimized to copy directly from the deque to the circular buffer.
27
+
28
+ E. Next we `peek(4)` which returns the first 4 samples from the circular buffer; the return value may be a view on the data if the data are contiguous in the circular buffer, or a copy if the data are not contiguous. Note that the tail (read pointer) does not advance with `peek()`.
29
+ * deq_len=0; available=8, tell=0
30
+
31
+ F. Finally, we `seek(4)` to advance the tail.
32
+ * deq_len=0; available=4, tell=4
33
+
34
+ G. We `write()` 4 more samples, which are appended to the deque, leaving the circular buffer unchanged from the previous step.
35
+ * deq_len=4; available=8, tell=4
36
+
37
+ H. We then `read(4)` again. This time, a `flush()` is not triggered because we have enough unread samples in the circular buffer, but `peek(4)` and `seek(4)` are still called. The read pointer advances by 4, leaving 0 unread samples in the circular buffer and 4 in the deque.
38
+ * deq_len=4; available=0, tell=8
39
+
40
+ Note: `peek(n)` and `seek(n)`, where `n` > `n_available` will raise an error. However, `peek(None)` will return all available samples without error, and `seek(None)` will advance the tail to the end of the available data.
41
+
42
+ ### Overflow Behaviour
43
+
44
+ The criteria to trigger an overflow are as follows:
45
+ * the deque has more data than there is space in the circular buffer, where space is the combination of previously read samples and unwritten samples in the circular buffer.
46
+ * the caller triggers a flush either manually (`flush()`) or by requesting (via `read`, `peek`, or `seek`) more samples than are available in the circular buffer but not more than the total size of the available samples in the buffer + available samples in the deque.
47
+
48
+ ![HybridBuffer Overflow Behaviour](img/HybridBufferOverflow.svg)
49
+
50
+ **Figure 2**
51
+
52
+ A. We start with a circular buffer that has been running for a while (it has wrapped around several times). At this particular moment, we have more data in the deque (12) than we have room in the buffer (8). The remaining figures describe what happens when `flush()` is called with different overflow strategies. The samples are labeled to make it easier to follow the flow of data.
53
+ * deq_len=12; available=20, tell=1
54
+
55
+ B. "warn-overwrite": If the overflow_strategy is set to 'warn-overwrite', the HybridBuffer will log a warning and overwrite the oldest data in the circular buffer with the new data from the deque. Here, samples 'a-d' are lost.
56
+ * deq_len=0; available=16, tell=0
57
+
58
+ C. "drop": As much as possible of the data from the deque are copied into the circular buffer, but remaining data are dropped. In this case, samples 'q-t' are lost.
59
+ * deq_len=0; available=16, tell=0
60
+
61
+ D. "grow": The HybridBuffer will attempt to grow the circular buffer to the lesser of double its current size or the size required to accommodate all read + unread + deque data. If the buffer cannot grow (e.g., due to memory constraints; default max_size is 1GB), it will raise an error.
62
+ * deq_len=0; available=20, tell=8
63
+
64
+ Additionally, one can configure the HybridBuffer overflow_strategy to 'raise', which will raise an error if there is insufficient space (empty or read samples) in the buffer to perform the flush.
65
+
66
+ There are a few mitigations to defer flushing to help prevent overflows:
67
+
68
+ * If the requested number of samples to read, peek, or seek is less than the number of unread samples in the circular buffer, then no flush is performed.
69
+ * Helper methods `peek_at(k, allow_flush=False)` (False is default), and `peek_last()` will retrieve the target sample from the buffer-OR-deque without flushing.
70
+ * Be cautious relying on repeated calls to `peek_at(k, allow_flush=False)` as it scans over the items in the deque which can be slow.
71
+ * When calling `read(n)`, if a flush is necessary, and it will cause an overflow, and the overflow could be prevented with a pre-emptive read up to `n`, then it will do the read in 2 parts. First it will call `peek(n_unread_in_buffer)` and `seek(n_unread_in_buffer)` to read the unread samples in the circular buffer. Second, it will call `peek(n_remaining)` and `seek(n_remaining)` to trigger a flush -- which should no longer cause an overflow -- then read the remaining requested samples and stitch them together.
72
+
73
+ ### Advanced Pointer Manipulation
74
+
75
+ The previous section describes how `read`, `peek`, `seek`, and `peek_at` function in normal use cases. It is also possible to call `seek` with a negative value, which will attempt to move the tail pointer backwards over previously-read (or previously sought-over) data by that many samples. `seek` returns the number of samples that were actually moved, which may be less than the requested value if there was insufficient room. Negative seeks can only rewind into previously read data, and positive seeks can only advance into unread data, possibly including data that gets flushed from the deque.
76
+
77
+ ## HybridAxisBuffer
78
+
79
+ The `HybridAxisBuffer` carries the semantics of the `HybridBuffer` but it is designed to handle either a `LinearAxis` or a `CoordinateAxis`. Its `write` method expects an axis object and its `peek` and `read` methods return an axis, not just the data.
80
+
81
+ For a `LinearAxis`, the `HybridAxisBuffer` simply maintains the `gain`, the `offset`, and the 'number of samples available'. Since this does not store actual data, it has no capacity. If this object is intended to be synchronized with another `HybridBuffer`-using object that does have a capacity, then the other object should be manipulated first and then the number of samples actually moved should be used to call the `HybridAxisBuffer`'s methods, otherwise these objects will be out of sync.
82
+
83
+ For a `CoordinateAxis`, the `HybridAxisBuffer` maintains the `data` in a `HybridBuffer` and thus behaves like a `HybridBuffer` with respect to the capacity. The returned `CoordinateAxis` object might have its `.data` field as a view on the data in the buffer, so it should not be modified in place.
84
+
85
+ ## HybridAxisArrayBuffer
86
+
87
+ This is a convenience class that combines the `HybridAxisBuffer` and `HybridBuffer` into a single object that can be used to manage both axis and data in a single object. This class is particularly useful when you need to manage both the axis information and the data samples together, as is the case for an `AxisArray` object. Its `write` method expects an `AxisArary` object and its `peek` and `read` methods return an `AxisArray` object. Note that the return object's `.data` field might be a view on the data in the buffer so it should not be modified in place. Similarly so for the `CoordinateAxis` data.