refactor(tilib): narrow ti_w fixture except → TilibParamError (#218) - #225
Merged
Conversation
…ror (#218) Completes the ti_w portion of #218 that was deferred in PR #220 (ti_ar narrowing only). The ti_w fixture lived on the feat/fixture-parity-215 branch (PR #219, merged at a12982d) so this follow-up was unblocked once #219 landed on develop. Same pattern as PR #220's commits 23d5b88 + 6ca586f: - Add `from tilib.errors import TilibParamError` import - Replace 4 `except Exception:` blocks with `except TilibParamError:` - All 4 sites: _apply_array dict branch, _apply_array list branch, apply SCALARS loop, apply MATRIX_ARRAYS loop Narrowing chain verified during #220 review (ti_api.h:27 / errors.py:46-51): - TI_ERR_INVALID = 1 → TilibParamError (unknown name OR invalid value) - TI_ERR_NOT_INIT = 2, CALC_FAILED = 3, NOT_IMPL = 4 now propagate instead of being silenced for UNREGISTERED_KEYS keys. ti_min_params.py has no try/except blocks (verified pre-#220) — no further ti narrowing pending. Closes #218 Local: 43 passed, 3 skipped (no regression). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4a986fe. Configure here.
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.
Summary
Completes the ti_w portion of #218 that was deferred in PR #220 (ti_ar only). Mirrors PR #220's commits
23d5b889+6ca586f7onpython/tilib/tests/fixtures/ti_w_params.py:from tilib.errors import TilibParamErrorimportexcept Exception:blocks withexcept TilibParamError:+ updated pragma commentCloses #218.
Why deferred (until now)
ti_w_params.py only existed on the #219 PR branch (`feat/fixture-parity-215`). #219 merged at `a12982dd` (2026-06-08), bringing the file onto develop. This follow-up was unblocked at that point.
PR #220 description noted this explicit deferral.
Pattern parity with PR #220
Same 4 narrowing sites, same import placement, same pragma comment string ("ierr=1 = invalid name or value; for UNREGISTERED_KEYS this is unknown-name and intentionally silenced"). ti_ar_params.py and ti_w_params.py now have identical exception-handling discipline.
ti_min_params.py has no try/except blocks (verified pre-#220) → #218 is fully closed.
Verified narrowing chain (re-confirmed during #220 review)
Other exception classes — `TilibStateError` (ierr=2), `TilibRunError` (ierr=3), `TilibNotImplementedError` (ierr=4) — now propagate instead of being silenced.
Test plan
Pre-push gate
🤖 Generated with Claude Code
Note
Low Risk
Test-fixture-only change with no production API or runtime logic modified; aligns error handling with an already-shipped
ti_arpattern.Overview
In
ti_w_params.py, the test fixture’sapply/_apply_arrayhelpers now catchTilibParamErrorinstead of bareExceptionwhen callingti.set_param, with the same pragma comment used inti_ar_params.py.Behavior for
UNREGISTERED_KEYSis unchanged: invalid-name failures are still swallowed only for those keys.TilibStateError,TilibRunError, and other non-param errors are no longer accidentally suppressed.Reviewed by Cursor Bugbot for commit 4a986fe. Bugbot is set up for automated code reviews on this repo. Configure here.