Skip to content

Commit 7c3bf06

Browse files
authored
Merge pull request #119 from ezmsg-org/dev
Add coordinate spaces conversions and reorganize docs
2 parents 703d741 + ef4ca3e commit 7c3bf06

43 files changed

Lines changed: 840 additions & 424 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 27 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,42 @@
1-
# ezmsg.sigproc
1+
# ezmsg-sigproc
22

3-
## Overview
3+
Signal processing primitives for the [ezmsg](https://www.ezmsg.org) message-passing framework.
44

5-
ezmsg-sigproc offers timeseries signal‑processing primitives built atop the ezmsg message‑passing framework. Core dependencies include ezmsg, numpy, scipy, pywavelets, and sparse; the project itself is managed through hatchling and uses VCS hooks to populate __version__.py.
5+
## Features
66

7-
## Installation
8-
9-
Install the latest release from pypi with: `pip install ezmsg-sigproc` (or `uv add ...` or `poetry add ...`).
10-
11-
You can install pre-release versions directly from GitHub:
7+
* **Filtering** - Chebyshev, comb filters, and more
8+
* **Spectral analysis** - Spectrogram, spectrum, and wavelet transforms
9+
* **Resampling** - Downsample, decimate, and resample operations
10+
* **Windowing** - Sliding windows and buffering utilities
11+
* **Math operations** - Arithmetic, log, abs, difference, and more
12+
* **Signal generation** - Synthetic signal generators
1213

13-
* Using `pip`: `pip install git+https://github.com/ezmsg-org/ezmsg-sigproc.git@dev`
14-
* Using `uv`: `uv add git+https://github.com/ezmsg-org/ezmsg-sigproc --branch dev`
15-
* Using `poetry`: `poetry add "git+https://github.com/ezmsg-org/ezmsg-sigproc.git@dev"`
14+
All modules use `AxisArray` as the primary data structure for passing signals between components.
1615

17-
> See the [Development](#development) section below for installing with the intention of developing.
18-
19-
## Source layout & key modules
20-
* All source resides under src/ezmsg/sigproc, which contains a suite of processors (for example, filter.py, spectrogram.py, spectrum.py, sampler.py) and math and util subpackages.
21-
* The framework’s backbone is base.py, defining standard protocols—Processor, Producer, Consumer, and Transformer—that enable both stateless and stateful processing chains.
22-
* Filtering is implemented in filter.py, providing settings dataclasses and a stateful transformer that applies supplied coefficients to incoming data.
23-
* Spectral analysis uses a composite spectrogram transformer chaining windowing, spectrum computation, and axis adjustments.
16+
## Installation
2417

25-
## Operating styles: Standalone processors vs. ezmsg pipelines
26-
While each processor is designed to be assembled into an ezmsg pipeline, the components are also well‑suited for offline, ad‑hoc analysis. You can instantiate processors directly in scripts or notebooks for quick prototyping or to validate results from other code. The companion Unit wrappers, however, are meant for assembling processors into a full ezmsg pipeline.
18+
Install from PyPI:
2719

28-
A fully defined ezmsg pipeline shines in online streaming scenarios where message routing, scheduling, and latency handling are crucial. Nevertheless, you can run the same pipeline offline—say, within a Jupyter notebook—if your analysis benefits from ezmsg’s structured execution model. Deciding between a standalone processor and a full pipeline comes down to the trade‑off between simplicity and the operational overhead of the pipeline:
20+
```bash
21+
pip install ezmsg-sigproc
22+
```
2923

30-
* Standalone processors: Low overhead, ideal for one‑off or exploratory offline tasks.
31-
* Pipeline + Unit wrappers: Additional setup cost but bring concurrency, standardized interfaces, and automatic message flow—useful when your offline experiment mirrors a live system or when you require fine‑grained pipeline behavior.
24+
Or install from GitHub for the latest development version:
3225

33-
## Documentation & tests
34-
* `docs/ProcessorsBase.md` details the processor hierarchy and generic type patterns, providing a solid foundation for custom components.
35-
* Unit tests (e.g., `tests/unit/test_sampler.py`) offer concrete examples of usage, showcasing sampler generation, windowing, and message handling.
26+
```bash
27+
pip install git+https://github.com/ezmsg-org/ezmsg-sigproc.git@dev
28+
```
3629

37-
## Where to learn next
38-
* Study docs/ProcessorsBase.md to master the processor architecture.
39-
* Explore unit tests for hands‑on examples of composing processors and Units.
40-
* Review the ezmsg framework in pyproject.toml to understand the surrounding ecosystem.
41-
* Experiment with the code—try running processors standalone and then integrate them into a small pipeline to observe the trade‑offs firsthand.
30+
## Documentation
4231

43-
This approach equips newcomers to choose the right level of abstraction—raw processor, Unit wrapper, or full pipeline—based on the demands of their analysis or streaming application.
32+
Full documentation is available at [ezmsg.org](https://www.ezmsg.org).
4433

4534
## Development
4635

47-
We use [`uv`](https://docs.astral.sh/uv/getting-started/installation/) for development. It is not strictly required, but if you intend to contribute to ezmsg-sigproc then using `uv` will lead to the smoothest collaboration.
36+
We use [`uv`](https://docs.astral.sh/uv/) for development.
4837

49-
1. Install [`uv`](https://docs.astral.sh/uv/getting-started/installation/) if not already installed.
50-
2. Fork ezmsg-sigproc and clone your fork to your local computer.
51-
3. Open a terminal and `cd` to the cloned folder.
52-
4. `uv sync` to create a .venv and install dependencies.
53-
5. `uv run pre-commit install` to install pre-commit hooks to do linting and formatting.
54-
6. Run the test suite before finalizing your edits: `uv run pytest tests`
55-
7. Make a PR against the `dev` branch of the main repo.
38+
1. Fork and clone the repository
39+
2. `uv sync` to create a virtual environment and install dependencies
40+
3. `uv run pre-commit install` to set up linting and formatting hooks
41+
4. `uv run pytest tests` to run the test suite
42+
5. Submit a PR against the `dev` branch

docs/source/api/index.rst

Lines changed: 3 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,11 @@
11
API Reference
22
=============
33

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.
4+
This page contains auto-generated API reference documentation.
1525

1536
.. autosummary::
1547
:toctree: generated
1558
:recursive:
9+
:template: autosummary/module.rst
15610

157-
ezmsg.sigproc.util
11+
ezmsg.sigproc

docs/source/guides/ProcessorsBase.md

Lines changed: 0 additions & 58 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
Architecture & Usage Patterns
2+
=============================
3+
4+
This page describes the architecture of ezmsg-sigproc and different ways to use its components.
5+
6+
Operating Styles: Standalone vs. Pipelines
7+
------------------------------------------
8+
9+
While each processor is designed to be assembled into an ezmsg pipeline, the components are also well-suited for offline, ad-hoc analysis. You can instantiate processors directly in scripts or notebooks for quick prototyping or to validate results from other code. The companion Unit wrappers, however, are meant for assembling processors into a full ezmsg pipeline.
10+
11+
A fully defined ezmsg pipeline shines in online streaming scenarios where message routing, scheduling, and latency handling are crucial. Nevertheless, you can run the same pipeline offline—say, within a Jupyter notebook—if your analysis benefits from ezmsg's structured execution model.
12+
13+
Deciding between a standalone processor and a full pipeline comes down to the trade-off between simplicity and the operational overhead of the pipeline:
14+
15+
* **Standalone processors**: Low overhead, ideal for one-off or exploratory offline tasks.
16+
* **Pipeline + Unit wrappers**: Additional setup cost but bring concurrency, standardized interfaces, and automatic message flow—useful when your offline experiment mirrors a live system or when you require fine-grained pipeline behavior.
17+
18+
Source Layout
19+
-------------
20+
21+
All source resides under ``src/ezmsg/sigproc``, which contains:
22+
23+
* A suite of processors (for example, ``filter.py``, ``spectrogram.py``, ``spectrum.py``, ``sampler.py``)
24+
* ``math/`` and ``util/`` subpackages for mathematical operations and utilities
25+
26+
Key Modules
27+
^^^^^^^^^^^
28+
29+
* **base.py** (via ``ezmsg.baseproc``): Defines standard protocols—Processor, Producer, Consumer, and Transformer—that enable both stateless and stateful processing chains.
30+
* **filter.py**: Provides settings dataclasses and a stateful transformer that applies supplied coefficients to incoming data.
31+
* **spectrogram.py**: Implements spectral analysis using a composite transformer chaining windowing, spectrum computation, and axis adjustments.
32+
33+
Where to Learn Next
34+
-------------------
35+
36+
* Study the :doc:`base` page to master the processor architecture.
37+
* Explore unit tests in the repository for hands-on examples of composing processors and Units.
38+
* Review the `ezmsg framework <https://www.ezmsg.org>`_ to understand the surrounding ecosystem.
39+
* Experiment with the code—try running processors standalone and then integrate them into a small pipeline to observe the trade-offs firsthand.
40+
41+
This approach equips newcomers to choose the right level of abstraction—raw processor, Unit wrapper, or full pipeline—based on the demands of their analysis or streaming application.

docs/source/guides/sigproc/content-sigproc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ This may occur when the generator receives inadequate data to produce a valid ou
1717
.. toctree::
1818
:maxdepth: 1
1919

20+
architecture
2021
base
2122
units
2223
processors

docs/source/index.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
```{include} ../../README.md
2+
```
3+
4+
## Documentation
5+
6+
```{toctree}
7+
:maxdepth: 2
8+
:caption: Contents:
9+
10+
guides/sigproc/content-sigproc
11+
guides/HybridBuffer
12+
guides/how-tos/signalprocessing/content-signalprocessing
13+
guides/tutorials/signalprocessing
14+
api/index
15+
```
16+
17+
## Indices and tables
18+
19+
- {ref}`genindex`
20+
- {ref}`modindex`

0 commit comments

Comments
 (0)