fix(errors): stop naming the predecessor brand in messages participants see - #250
Merged
Conversation
…ts see
Four strings a caller can actually hit still said `WhestArray`, a class that
is not in the public API and that nobody using this package can look up: the
fail-closed RuntimeError on both the __array_ufunc__ and __array_function__
paths, and the auto-route UserWarning on each.
The RuntimeError's wording was wrong for its reader too, not just its nouns.
It said "Check the calling fnp wrapper and add a strip before the numpy call"
-- an instruction to go and edit a wrapper the participant did not write, for
a condition that is by definition a bug in flopscope rather than in their
code. It now says so, asks for a report, and keeps the maintainer detail in
a trailing parenthetical where it does not read as a task for the caller:
FlopscopeArray reached numpy.diff from inside a flopscope wrapper. This
is a bug in flopscope, not in your code - please report it with the call
that triggered it. (Internal: the wrapper is missing a
_to_base_ndarray() strip before the numpy call.)
A new guard walks every string literal in the package with ast, docstrings
included, and fails on the predecessor brand. It is a grep rather than a
behavioural test because the failure mode is textual: these names live in
strings that no import and no type checker ever touches, which is how they
survived the rename. `whestbench` is excluded -- that is a real, separate
package and naming it is correct.
The two tripwire tests that pinned the old text via `match=` move with it.
Three internal-identifier references remain and are fixed in the next commit.
Mechanical, no behaviour change. The names were invisible to participants, but three docstrings that DO reach `help()` and the docs site referenced them by name, so the guard added in the previous commit could not go green while they stood: _REDUCE_TO_WHEST -> _REDUCE_TO_FLOPSCOPE _ACCUMULATE_TO_WHEST -> _ACCUMULATE_TO_FLOPSCOPE inputs_were_whest -> inputs_were_tracked b_was_whest -> b_was_tracked whest_fn -> flopscope_fn `inputs_were_*` and `b_was_*` become `_tracked` rather than `_flopscope`: what they record is whether the caller passed a TRACKED array, which is the property the branch tests, and it does not need re-editing if the class is ever renamed again. Both class attributes are private and neither is referenced from tests or from the client/server surface, so nothing outside the package moves. `grep -i whest src/` is now empty apart from `whestbench`, which is a real separate package.
…ST_DIR The wheel-contract env var is a contract between exactly two places in this repo -- tests/test_release_contract.py reads it, pypi-publish.yml sets it -- so the rename is self-contained and both sides move together. Nothing outside the repository sets it: the publish workflow is its only producer. Also corrects two test comments that quoted the old RuntimeError text verbatim and were left inaccurate by the rewording, and the xfails.py comments naming the old class. Test FUNCTION names keep their old spelling: they are neither participant-visible nor package internals, and renaming them is churn against no reader -- the CI `-k` selection does not reference them.
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.
Four strings a caller can actually hit still said
WhestArray— a class that is not in the public API and that nobody using this package can look up: the fail-closedRuntimeErroron both the__array_ufunc__and__array_function__paths, and the auto-routeUserWarningon each.The
RuntimeError's wording was wrong for its reader, not just its nouns. It said "Check the calling fnp wrapper and add a strip before the numpy call" — an instruction to go and edit a wrapper the participant did not write, for a condition that is by definition a bug in flopscope rather than in their code. It now says so, asks for a report, and keeps the maintainer detail in a trailing parenthetical where it does not read as a task for the caller:A guard stops it coming back. It walks every string literal in the package with
ast, docstrings included, and fails on the predecessor brand. A grep rather than a behavioural test, because the failure mode is textual: these names live in strings that no import and no type checker ever touches, which is exactly how they survived the rename.whestbenchis excluded — that is a real, separate package and naming it is correct.Three further commits, kept separate so the reviewable change above stays distinct from mechanical churn: the internal identifiers (
_REDUCE_TO_WHEST,inputs_were_whest,whest_fn, …) are renamed — three docstrings that reachhelp()and the docs site referenced them by name, so the guard could not go green while they stood; and the wheel-contract env var becomesFLOPSCOPE_RELEASE_DIST_DIR, a contract between exactly two places in this repo which move together.grep -i whest src/is now empty apart fromwhestbench. Test function names keep their old spelling: neither participant-visible nor package internals, and renaming them is churn against no reader.No behaviour changes and no billing changes.