Skip to content

FIX: remove unused numerical locals - #923

Merged
mmcky merged 1 commit into
QuantEcon:mainfrom
kocaemre:fix/remove-unused-numerical-locals
Sep 9, 2026
Merged

FIX: remove unused numerical locals#923
mmcky merged 1 commit into
QuantEcon:mainfrom
kocaemre:fix/remove-unused-numerical-locals

Conversation

@kocaemre

Copy link
Copy Markdown
Contributor

Summary

Verification

  • RED: ruff check quantecon/_robustlq.py quantecon/_kalman.py quantecon/_lss.py quantecon/_matrix_eqn.py --select F841 reported the eight unused-local findings from FIX: Review the eight F841 unused-local findings in numerical modules #883.
  • GREEN: ruff check quantecon/_robustlq.py quantecon/_kalman.py quantecon/_lss.py quantecon/_matrix_eqn.py --select F841
  • pytest 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.

Signed-off-by: Emre K <110906681+kocaemre@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 unused Q, R (and beta) aliases in robust_rule_simple and unused Q, R in evaluate_F.
  • In _matrix_eqn.py, _lss.py, and _kalman.py, drop unused unpacked values (k, H, k respectively).
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.

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 90.546%. remained the same — kocaemre:fix/remove-unused-numerical-locals into QuantEcon:main

@mmcky

mmcky commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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.

@kocaemre

kocaemre commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

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.py

I appreciate QuantEcon working on QEP-5; I am happy to follow whatever disclosure format you settle on.

@mmcky

mmcky commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

thanks for the reply @kocaemre.

Just FYI. We are likely to incorporate a ban on AI use for good first issue types so we can use those for teaching and training. So we will incorporate elements of https://llvm.org/docs/AIToolPolicy.html in our thinking.

I'll mark this as ready.

cc: @oyamad

@mmcky mmcky added the ready label Sep 9, 2026
@mmcky
mmcky merged commit 0c7c816 into QuantEcon:main Sep 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FIX: Review the eight F841 unused-local findings in numerical modules

4 participants