Take the chunk-dim helpers from ezmsg-baseproc - #240
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_hashalready resolves the same thing — and where every ezmsg package can reach them.ezmsg-blackrockdoesn't depend on sigproc (only transitively via ezmsg-event) andezmsg-toolshas 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.messagere-exports the four resolvers, so existingfrom ezmsg.sigproc.util.message import resolve_chunk_dimkeeps working.ezmsg.sigproc.util.deprecationkeeps 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.dataclassesbuilds the settings__init__with globals taken fromsys.modules[cls.__module__], so a class whose module isn't insys.modules— defined byexec, 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.pykeeps its resolver tests, which now also verify the re-export surface.