Skip to content

Changelog

Unreleased

Changed

  • Breaking: "the array is the backend". An element's array backend (NumPy/PyTorch) is inferred from its data via the Python Array API, not configured. The backend= argument is removed from every element and from AdapterConfig; choose the backend at a source, or insert a Converter where backends cross. See docs/user/use-array-backends.md.
  • Elements declare a backends capability (ClassVar, default frozenset({"numpy"}), or ANY_BACKEND); data in an undeclared backend raises BackendError at runtime, naming the pad and the fix.
  • An element declares its output backend/dtype by example with output_prototype(self, pad) (built from input_prototype(name, dtype=, device=)). Most transforms override nothing (dtype is inherited); a source returns a literal prototype; a Converter (which sets changes_backend = True) is the only element that may change namespace/device.
  • TSFrame.filleddata() takes no arguments (it uses the frame's spec); SeriesBuffer.filleddata(reference) fills a single buffer's gap to match a reference array.

Added

  • sgnts.base.backend (re-exported via sgnts.base.array_ops): namespace primitives array_namespace, backend_name, device, new_zeros, normalize_dtype, the ANY_BACKEND sentinel, and BackendError.
  • sgnts.base.signal for ops outside the Array API standard (notably pad).
  • Converter element to change backend / dtype / device at an explicit edge.

Removed

  • The ArrayBackend / NumpyBackend / TorchBackend / NumpyArray / TorchArray abstractions and the set_dtype / set_device globals — dtype and device now travel with the data.

Deprecated

  • SeriesBuffer.filleddata() with no reference, and scalar data=0/1 buffer construction (both can only numpy-default): pass a real array or a reference array of the intended backend.

0.9.2 - 2026-06-04

Added

  • Add FileRetentionMixin to sgnts.sinks.retention, providing reusable count-based and time-based file cleanup policies for sinks that write files in stride mode, including a directory-scan method for recovering after restart

0.9.1 - 2026-05-19

Changed

  • Declare capable elements as thread safe across sources, transforms, and sinks

0.9.0 - 2026-05-07

Added

  • Add one_to_many transform decorator for single-input, multi-output elements
  • Add bit_map and on_bits properties to BitVector

Changed

  • BitVector now interprets input data values as truthy (not just gap/buffer state)
  • Rename bit_gen module to bit_vector to match element name
  • Preserve buffer gap/non-gap boundaries when using stride/align_to, so downstream elements can see transitions in mixed segments
  • Improve Audioadapter error messages with offset deltas and consistent formatting
  • Add functools.wraps to the ensure_nonempty decorator

0.8.0 - 2026-04-17

Added

  • Add TSPipeline class with a configurable stride attribute
  • Add dtype specifier to FakeSeriesSource

Changed

  • When a source reaches its requested end, emit heartbeats instead of raising an error, so downstream elements can drain cleanly
  • AudioAdapter now raises a clear error when its stride is incompatible with the application stride, instead of failing obscurely later
  • Elements now read adapter settings (stride, overlap, skip_gaps, offset_shift, pad_zeros_startup) directly from adapter_config rather than cached copies on the element; user code that accessed these as element attributes should switch to adapter_config.*
  • Format large offset integers with _ digit separators in assertion messages for readability

Fixed

  • Fix Ctrl-C hangs in pipelines using TSResourceSource under SignalEOS; the source now cooperatively drains on interrupt
  • Fix TSResourceSource emitting spurious heartbeats when the worker produces data in blocks smaller than the application stride; data is now accumulated until a full stride is ready
  • Fix pad_zeros_startup accounting for multi-sink elements
  • Fix adapter alignment producing 0-duration gap buffers, which caused cross-pad duration mismatches in multi-pad elements

0.7.0 - 2026-03-12

Changed

  • Internal type-checking and test coverage improvements; no user-facing API changes

0.6.0 - 2026-02-23

Added

  • Add py.typed marker to declare sgn-ts as a typed library
  • Add masked array methods to TSFrame
  • Add offset validation checks
  • Expose extra internal source pads in composed transforms

Changed

  • Overhaul documentation: restructure into User Guide, Developer Guide, Background, and Reference sections following Divio guidelines; add dedicated offset background page; split built-in elements reference into Sources, Transforms, and Sinks; add testable code snippets throughout
  • Standardize on seconds for time quantities, expose _ns properties for nanosecond equivalents
  • Standardize start/end parameters for TSSource and TSResourceSource
  • Change TSResourceSource base class from ParallelizeSourceElement to ParallelizeBase
  • Have TSResourceSource derive from TSSource
  • Simplify TSCompose to wrap Compose while keeping the public API
  • Add TS-enabled support to TSFrameCollectSink
  • Bump minimum sgn version to 0.6

Fixed

  • Fix EventBuffer gap detection check
  • Fix make_ts_element hanging by defining pull()/internal() methods
  • Fix typing issues: add type: ignore in array checks, use re-exports in array_ops module, explicitly declare NumpyArray as type alias

0.5.0 - 2026-01-20

Added

  • Add TSCompose wrappers (TSComposedSourceElement, TSComposedTransformElement, TSComposedSinkElement)
  • Add TSFrameCollectSink for collecting input streams into frames
  • Add TSAppSink for user-defined buffer callbacks
  • Add TSPlotSink and plotting utilities (plot_buffer(), plot_frame())
  • Add TSIterSource for iterating through pre-built frames
  • Add TSCollectFrame context manager for atomic buffer appends
  • Add BitVector transform for bit-level operations
  • Add NaryTransform for N-ary reduction operations
  • Add TSFrame.tarr and TSFrame.samples properties
  • Add static pad configuration for elements
  • Add opt-in process() API for simplified element implementation

Changed

  • Redesign EventFrame and TSFrame to share a TimeSpanFrame parent class
  • Replace SeriesBuffer.replace() with copy()
  • Switch AdapterConfig from disable to enable/is_enabled flag

Fixed

  • Fix gap handling in AdaptiveCorrelate
  • Fix offset shift when skip_gaps or align_buffers is set

0.4.0 - 2025-11-07

Added

  • Add SegmentSource for time-segment-based data production
  • Add ANDTransform for logical AND across inputs
  • Add align_to option in AdapterConfig for offset boundary alignment
  • Add make_ts_element() factory function for wrapping SGN elements
  • Add element entry point registration
  • Add Average element (mean/median)

Changed

  • Update TSResourceSource to use ParallelizeSourceElement
  • Bump minimum sgn version to 0.4

Fixed

  • Fix Correlate latency handling
  • Fix offset-to-sample rounding during alignment
  • Fix pad name in Align
  • Propagate worker exceptions in TSResourceSource

0.3.0 - 2025-05-11

Added

  • Add DataSpec for time-series validation
  • Add per-pad signal parameters for FakeSeriesSource
  • Add EventBuffer default start/end times

0.2.0 - 2025-04-17

Added

  • SeriesBuffer, TSFrame, EventBuffer, EventFrame data types
  • Offset system for precise time bookkeeping
  • Time constants for nanosecond-based conversions
  • TSSlice and TSSlices for time interval operations
  • Audioadapter and AdapterConfig for streaming buffer management
  • ArrayBackend abstraction with NumpyBackend and TorchBackend
  • FakeSeriesSource with white noise, sine, impulse, and constant signals
  • TSResourceSource for data-driven sources
  • Amplify, Adder, Align, Correlate, AdaptiveCorrelate, Converter, Gate, Matmul, Resampler, SumIndex, Threshold transforms
  • DumpSeriesSink, NullSeriesSink sinks
  • TimeSeriesMixin for cross-channel frame alignment