QuantEcon / QuantEcon/QuantEcon.py
MAINT: Modernization sweep: idioms that postdate their reasons
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.4k
- Forks
- 2.3k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 3
Description
Problem
Accumulated idioms whose motivating constraints have expired; none affects behavior:
- The codebase splits almost 50/50 between two spellings of the same thing: 55
@njitvs 57@jit(nopython=True. The keyword has been the default (and a no-op) since numba 0.59. Normalize to one spelling. Coordinate with the coverage-measurement fix in this milestone first —.coveragerccurrently keys its exclusions on these decorator spellings, so changing them independently would silently move which code is measured. _ivp.py:46: Py2-stylesuper(IVP, self).__init__(moot if thesolve_ivpmigration lands first — sequence accordingly).util/compat.py: theNumpyVersion < "1.28.0"branch is dead once the install-metadata issue raises the NumPy floor to ≥2 — the module collapses tocopy_if_needed = None(keep the seam; shrink the body).- 16 ambiguous single-letter
lvariables (E741) in numerical code; 18 lambda assignments (E731); printf-style formatting → f-strings. quad.py:140— the comment "TODO: I don't know what this does": archaeology against Miranda–Fackler's CompEcon (the module's cited source), then either explain or link.
Proposed change
Batch by kind, one small PR each, after the lint-gate ratchet in this milestone lands (its baseline makes these diffs enforceable). Several batches are self-contained enough for newcomers once the gate exists.
Acceptance criteria
-
nopython=Trueoccurrences at 0 (excluding signatures that genuinely require it); one decorator spelling throughout,cache=True/parallel=Truepreserved - E741/E731 counts at 0 or baselined with a comment
-
quad.py:140TODO resolved to an explanation or a reference
From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the coverage-measurement fix and lint-gate ratchet referenced in the milestone, since decorator and lint changes depend on them. Then inspect .coveragerc, _ivp.py, util/compat.py, and quad.py:140, along with the listed E741/E731 and formatting occurrences. Done means the agreed batches preserve cache/parallel options, meet the stated lint counts or document a baseline, and replace the quad.py TODO with an explanation or reference.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100