QuantEcon / QuantEcon/QuantEcon.py

MAINT: Modernization sweep: idioms that postdate their reasons

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

Nobody has claimed this yet.

low-priority maintenance
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 @njit vs 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.coveragerc currently keys its exclusions on these decorator spellings, so changing them independently would silently move which code is measured.
  • _ivp.py:46: Py2-style super(IVP, self).__init__ (moot if the solve_ivp migration lands first — sequence accordingly).
  • util/compat.py: the NumpyVersion < "1.28.0" branch is dead once the install-metadata issue raises the NumPy floor to ≥2 — the module collapses to copy_if_needed = None (keep the seam; shrink the body).
  • 16 ambiguous single-letter l variables (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=True occurrences at 0 (excluding signatures that genuinely require it); one decorator spelling throughout, cache=True/parallel=True preserved
  • E741/E731 counts at 0 or baselined with a comment
  • quad.py:140 TODO 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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.