You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two of our five runtime dependencies serve one peripheral call site each, and both imports are already function-local:
sympy (heavy; pulls mpmath, roughly 40 MB) is imported once, lazily, at quad.py:171, to run sym.primerange(0, 7920) — the first 1,000 primes for Weyl/Haber equidistributed sequences in qnwequi, and only when the caller didn't pass equidist_pp.
requests serves only util/notebooks.py::fetch_nb_dependencies, the notebook support-file downloader.
Every pip install quantecon pays both costs; neither touches the numerical core. Because the imports are already lazy, moving them behind extras is close to mechanical.
Proposed change
sympy: replace the call with a ~10-line sieve or a hardcoded constant array (the primes are fixed; regression-test the first/last values against the sympy output) and drop the dependency entirely. Fallback option: an extras group quantecon[quad] with a clear ImportError message.
requests: move to an extras group (quantecon[notebooks]) with a lazy import and actionable error — or, if fetch_nb_dependencies has no remaining constituency, fold its retirement into the Deprecate tic,tac, toc timers #786 utility-deprecation conversation (weigh the open fix issue for that function first).
Acceptance criteria
Fresh-venv pip install quantecon no longer installs sympy (and, per decision, requests); import quantecon and the full suite green in that venv
qnwequi output unchanged (regression test on default equidist_pp)
Changelog notes the lighter footprint and any new extras
From the July 2026 technical-debt audit (AI-assisted; claims verified against 28d4b3b on 2026-07-25).
Problem
Two of our five runtime dependencies serve one peripheral call site each, and both imports are already function-local:
sympy(heavy; pulls mpmath, roughly 40 MB) is imported once, lazily, atquad.py:171, to runsym.primerange(0, 7920)— the first 1,000 primes for Weyl/Haber equidistributed sequences inqnwequi, and only when the caller didn't passequidist_pp.requestsserves onlyutil/notebooks.py::fetch_nb_dependencies, the notebook support-file downloader.Every
pip install quanteconpays both costs; neither touches the numerical core. Because the imports are already lazy, moving them behind extras is close to mechanical.Proposed change
sympy: replace the call with a ~10-line sieve or a hardcoded constant array (the primes are fixed; regression-test the first/last values against the sympy output) and drop the dependency entirely. Fallback option: an extras groupquantecon[quad]with a clearImportErrormessage.requests: move to an extras group (quantecon[notebooks]) with a lazy import and actionable error — or, iffetch_nb_dependencieshas no remaining constituency, fold its retirement into the Deprecatetic,tac,toctimers #786 utility-deprecation conversation (weigh the open fix issue for that function first).Acceptance criteria
pip install quanteconno longer installs sympy (and, per decision, requests);import quanteconand the full suite green in that venvqnwequioutput unchanged (regression test on defaultequidist_pp)From the July 2026 technical-debt audit (AI-assisted; claims verified against
28d4b3bon 2026-07-25).