Skip to content

Take the chunk-dim helpers from ezmsg-baseproc - #240

Merged
cboulay merged 1 commit into
devfrom
cboulay/share-chunkdim-helpers
Sep 7, 2026
Merged

Take the chunk-dim helpers from ezmsg-baseproc#240
cboulay merged 1 commit into
devfrom
cboulay/share-chunkdim-helpers

Conversation

@cboulay

@cboulay cboulay commented Sep 7, 2026

Copy link
Copy Markdown
Member

Follow-up to #239. Requires ezmsg-baseproc 1.13.0 (ezmsg-baseproc#15).

What moves

The three resolution rules and the deprecation machinery landed in ezmsg-baseproc, where _message_hash already resolves the same thing — and where every ezmsg package can reach them. ezmsg-blackrock doesn't depend on sigproc (only transitively via ezmsg-event) and ezmsg-tools has it in a dev group, not at runtime. Keeping private copies here would let the rule drift between packages, which is the failure mode this whole line of work exists to fix.

  • ezmsg.sigproc.util.message re-exports the four resolvers, so existing from ezmsg.sigproc.util.message import resolve_chunk_dim keeps working.
  • ezmsg.sigproc.util.deprecation keeps what is genuinely sigproc's — AXIS_REMOVAL_VERSION = "4.0" and the distribution name — and wraps baseproc's warner so the ~27 call sites stay a single line.

No behaviour change beyond the fix below; the deprecation policy is unchanged.

One fix comes along

The stacklevel walk treated a frame with no __name__ in its globals as user code. dataclasses builds the settings __init__ with globals taken from sys.modules[cls.__module__], so a class whose module isn't in sys.modules — defined by exec, or during a partially-initialised import — leaves that frame with no module identity at all. The warning then pointed at a synthetic frame with no source line to show.

Such a frame is never the user's code, so it now keeps the walk going. Found by writing baseproc's test for the property rather than by reasoning about it.

Testing

4285 unit + 51 integration pass against the shared helpers; ruff clean. tests/unit/test_chunk_dim_resolution.py keeps its resolver tests, which now also verify the re-export surface.

The resolution rules and the deprecation mechanism moved to
ezmsg-baseproc 1.13.0, where `_message_hash` already resolves the same thing
and where every ezmsg package can reach them -- ezmsg-blackrock does not
depend on sigproc, and ezmsg-tools has it only in a dev group. Keeping
private copies here would have let the rule drift between packages.

`ezmsg.sigproc.util.message` re-exports the four resolvers so existing
imports keep working. `ezmsg.sigproc.util.deprecation` keeps what is
genuinely sigproc's -- the removal release, and the fact that it is this
distribution making the promise -- and wraps baseproc's warner so the call
sites stay a single line.

Picks up a fix found while porting the tests: the stacklevel walk treated a
frame with no `__name__` in its globals as user code. `dataclasses` builds
the settings `__init__` with globals from `sys.modules[cls.__module__]`, so a
class whose module is not in sys.modules leaves that frame with no module
identity, and the warning pointed at a synthetic frame with no source line to
show. Such a frame is never the user's, so it now keeps the walk going.
@cboulay
cboulay merged commit aba2b43 into dev Sep 7, 2026
14 checks passed
@cboulay
cboulay deleted the cboulay/share-chunkdim-helpers branch September 7, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant