Repository navigation
Fix: notebook form has no silent number clamp, and optional parameters can be left unset (F8 F9) - #46
Merged
Merged
Conversation
…and refused), optional parameters can be left unset Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
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.
Fixes the notebook-form theme of the round-trip findings; the skipped matrix cases now run as normal tests and F8/F9 are removed from
tests/roundtrip_known_failures.py.Before -> after (
notebook.py)Min/Maxsilently clamped integers and floats at +-109 (and the person was never told). Now integers with no bounds, or only one, use an unboundedIntText, floats an unboundedFloatText; a box with both bounds staysBoundedIntText/BoundedFloatText; a single bound is checked at run time by the shared validation. The explicit limit isMAX_FORM_INTEGER = 2**53 - 1(the largest integer a JSON number carries exactly: the form exchanges JSON numbers with the page); an integer beyond it is refused atrun()withinvalid_parameter, the message giving the value and the limit and saying to use a smaller number or the CLI or a snippet; the limit is also in the control's tooltip. Decided by you (one limit in every form): 253-1 is the reference for every host; the other hosts move to it in the host alignment work.form.set_toggles); unchecked (the start state, control greyed out) means the parameter is omitted and the tool receives None; ticking it sends the control's value including 0, "" and False. Required parameters and path boxes are unchanged.Tests: new
tests/test_notebook_unset_and_range.py(6 tests). Test support:roundtrip_harness.run_notebookticks the "set" box for any optional parameter a case sets;roundtrip_cases.pygets an oracle constantMAX_FORM_INTEGERand the notebook transport now carries integers up to +-(253-1) and every float inFLOAT_OK(before: ints up to 231, floats below 1e9). Docs:PROTOCOL.md("set" box and the number-limit rule),REGRESSION_LEDGER.md(replace "this PR" with this number).notebook_magic.pyneeded no change.Host follow-ups (not in this PR): Napari: Qt spin boxes limited to +-(231-1) / +-1e15 when the schema gives no bound; Fiji: refuses ints outside int32 only on the macro path, the dialog path needs the same message and limit; QuPath: the integer spinner accepts only +-
LcConst.INT_LIMITand casts to int. Each must show the 253-1 limit and refuse beyond it with the same message. The hosts' "set" boxes for nullable parameters already match the notebook.Verified by the author on Linux, Python 3.11: black, ruff, mypy; the full suite before the last merge (404 tests, only the two environmental sandbox failures); after merging
main, lint plus the notebook, known-failures and ledger tests. Not run separately: the sabotage test and coverage floor (CI runs both), Windows, macOS.🤖 Generated with Claude Code
https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Generated by Claude Code