QuantEcon / QuantEcon/QuantEcon.py

MAINT: Add contract tests for the deprecation-shim layer (currently 0% covered)

Open
#875 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

maintenance
Dominant language
Python
Stars
2.4k
Forks
2.3k
Avg merge
3d 3h
Merged PRs (30d)
3

Description

Problem

All 21 base-level deprecation shims (quantecon/arma.pyrobustlq.py) sit at 0% test coverage — nothing asserts that (a) each emits DeprecationWarning on attribute access and (b) every name in each shim's __all__ actually resolves at the top level, which is what the warning text promises. The predictable failure already happened: six advertised names are missing from quantecon (#853 — ckron, gridmake, annotate_nodes, num_compositions_jit, simulate_linear_model, solve_discrete_riccati_system; independently re-verified during this audit).

This issue is the guard-rail, deliberately scoped apart from the fixes: #853 restores the six exports; #865 decides removal timing. Whichever way #865 concludes, the layer should be honest while it exists.

Proposed change

One parametrized test module (~40 lines): for each shim, import it, assert every __all__ name exists on quantecon, assert getattr emits DeprecationWarning, and assert an unknown attribute raises AttributeError. It lands red on the #853 six until that fix merges — coordinate ordering, or xfail those entries with a link.

Acceptance criteria
  • Shim modules no longer at 0%; the #853 class of regression cannot recur silently
  • The test module is trivially deletable in the same PR that deletes the shims

If #865 concludes with immediate removal, close this as wontfix with a link.


From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the 21 base-level shim modules under quantecon/, from arma.py through robustlq.py, and compare each all with the top-level exports. Add the proposed parametrized test module for warning behavior, advertised names, and unknown attributes. Check #853 and #865 before finalizing, since the tests may depend on the export fix or become unnecessary if the shims are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.