Pipelines
A spec names the recordings, the operations and the output. It’s data, so the same spec runs from Python, the command line and the app, and it’s saved beside each result.
{ "dspk_pipeline": 1, "nodes": { "raw": {"op": "read", "path": "recording.bin"}, "hp": {"op": "iir", "band": "highpass", "cutoff": [300.0], "mode": "forward"}, "out": {"op": "write", "path": "filtered.zarr", "format": "zarr"} }, "edges": [["raw", "hp"], ["hp", "out"]]}dspk_pipeline = 1edges = [["raw", "hp"], ["hp", "out"]]
[nodes.raw]op = "read"path = "recording.bin"
[nodes.hp]op = "iir"band = "highpass"cutoff = [300.0]mode = "forward"
[nodes.out]op = "write"path = "filtered.zarr"format = "zarr"import dspk
dspk.pipeline.plan("spec.toml") # what it would do, without touching the devicereports = dspk.pipeline.run("spec.toml")Progress and cancelling
Section titled “Progress and cancelling”def progress(input, inputs, done, windows): print(f"file {input + 1}/{inputs}: {done}/{windows}") # return False to cancel
dspk.pipeline.run("spec.toml", progress=progress)Cancelling (or Ctrl+C) raises KeyboardInterrupt, removes the unfinished output and keeps inputs
already finished.
More on specs: Pipelines and the spec reference.