ezmsg.baseproc.util.deprecation#

Deprecation of the per-processor axis setting.

A processor that carries state between messages – filter initial conditions, a running mean, a sample buffer, a previous-sample cache – can only do so along the dimension messages accumulate along. Carrying it along a static axis is not a smaller error but a different operation: that axis has the same length every message, so the carried state applies message N’s tail to message N+1’s head at the same coordinate, forever.

Which dimension that is belongs to the producer, and stream_dim is where it says so. A setting that lets a consumer disagree can only be used to be wrong, so it is going away; see resolve_stream_dim().

During the deprecation window the setting is still honoured, so nothing changes behaviour until it is removed. Two warnings partition the call sites:

  • This module’s construction-time FutureWarning fires for every use, including a harmless axis="time" on a raw stream. It means “delete this”.

  • resolve_configured_stream_dim()’s runtime warning fires only when the configured axis disagrees with a declared stream_dim. It means “deleting this will change what this stage computes”.

To find every remaining call site in a pipeline, run its tests with -W error::FutureWarning.

Module Attributes

DEFAULT_REMOVAL

it is the difference between "this will break someday" and something a user can plan against.

Functions

suppress_axis_deprecation()[source]#

Silence the construction-time warning while forwarding a setting internally.

A stage that builds a child processor from its own already-warned settings (a scaler and its two child EWMAs, a decimator and its anti-alias filter) would otherwise warn a second time for one user-visible setting – and, since some of that forwarding happens in _reset_state, would warn mid-stream pointing at whatever is driving the pipeline rather than at any call site.

Deleted along with the settings themselves.

Return type:

Iterator[None]

warn_axis_deprecated(settings, field='axis', *, package='this package', removal='a future release')[source]#

Warn that settingsfield is deprecated, if it was actually set.

Call from a __post_init__: ez.Settings classes are frozen dataclasses and every construction path – the settings class, the transformer, the unit, and the functional factory – funnels through their __init__, so one hook covers all four.

Parameters:
  • package (str) – Distribution name to quote, since each releases separately.

  • removal (str) – Version that drops the setting.

  • settings (Any)

  • field (str)

Return type:

None