FIX: remove unused numerical locals - #923
Conversation
Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
Each removed binding was verified to be genuinely unused within its function scope, with no behavioral change and passing tests.
Pull request overview
This PR removes eight unused local variable bindings (flake8/ruff F841 findings) across four numerical modules, as tracked in issue #883. Each removed binding was a stale local alias or unused tuple element left behind by earlier refactoring; the surrounding numerical logic is untouched. This is a small technical-debt cleanup that improves code hygiene without changing any behavior.
Changes:
- In
_robustlq.py, drop unusedQ,R(andbeta) aliases inrobust_rule_simpleand unusedQ,Rinevaluate_F. - In
_matrix_eqn.py,_lss.py, and_kalman.py, drop unused unpacked values (k,H,krespectively).
File summaries
| File | Description |
|---|---|
quantecon/_robustlq.py |
Removes unused Q, R, beta aliases in robust_rule_simple and unused Q, R in evaluate_F; retained aliases remain in use. |
quantecon/_matrix_eqn.py |
Drops unused k from the shape unpacking in solve_discrete_riccati_system. |
quantecon/_lss.py |
Drops unused H alias in impulse_response. |
quantecon/_kalman.py |
Drops unused lowercase k from the matrix-size unpacking in whitener_lss. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Thanks @kocaemre — I've verified this one independently: flake8 reports 8 F841 findings on main and 0 here, none of the removed names is referenced anywhere else in its own function, and the four affected test files pass. It's exactly what #883 asked for, and CI is running now. Another question: We're in the process of drafting an AI disclosure policy for QuantEcon — QEP-5, still in draft at QuantEcon/qeps#13 — and we're asking informally while we work out what it should require. If AI tools helped with the code, tests or the PR description here, would you let us know, and in particular which model or tool you used? Knowing what contributors are actually working with is genuinely useful input as we settle the policy. |
|
Thanks for asking, and happy to disclose. AI tools assisted with this PR. The work was prepared through Hermes Agent running as an autonomous OSS sprint assistant for Emre; in this environment the active model is OpenAI GPT-5.5 via the Hermes Agent runtime. The agent was used to inspect the issue/PR context, make the small unused-local cleanup, run the local validation, and draft the PR text. Claude Code was checked in this cron environment but was not usable for this cycle because it is not logged in here. Local evidence previously run for this PR: python -m pip install -e .[dev]
python -m flake8 quantecon --select=F841
python -m pytest quantecon/tests/test_robustlq.py quantecon/tests/test_matrix_eqn.py quantecon/tests/test_lss.py quantecon/tests/test_kalman.pyI appreciate QuantEcon working on QEP-5; I am happy to follow whatever disclosure format you settle on. |
|
thanks for the reply @kocaemre. Just FYI. We are likely to incorporate a ban on AI use for I'll mark this as ready. cc: @oyamad |
Summary
Verification
ruff check quantecon/_robustlq.py quantecon/_kalman.py quantecon/_lss.py quantecon/_matrix_eqn.py --select F841reported the eight unused-local findings from FIX: Review the eight F841 unused-local findings in numerical modules #883.ruff check quantecon/_robustlq.py quantecon/_kalman.py quantecon/_lss.py quantecon/_matrix_eqn.py --select F841pytest quantecon/tests/test_kalman.py quantecon/tests/test_lss.py quantecon/tests/test_matrix_eqn.py quantecon/tests/test_robustlq.py -q(22 passed)pytest quantecon/tests -q(221 passed)Closes #883.