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
FutureWarningfires for every use, including a harmlessaxis="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 declaredstream_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
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.
- warn_axis_deprecated(settings, field='axis', *, package='this package', removal='a future release')[source]#
Warn that settings’
fieldis deprecated, if it was actually set.Call from a
__post_init__:ez.Settingsclasses 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.