• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

QuantEcon / QuantEcon.py / 35817899786
94%

Build:
DEFAULT BRANCH: main
Ran 23 Sep 2026 04:24AM UTC
Jobs 1
Files 94
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Sep 2026 04:19AM UTC coverage: 93.992% (+0.01%) from 93.981%
35817899786

push

github

web-flow
WASM: defer Numba gufunc compilation to first call (#930) (#957)

* WASM: Defer Numba gufunc compilation to first call

`import quantecon` compiled four `guvectorize` functions eagerly because
of their explicit type signatures. In the in-browser (Emscripten) Numba
build, where `cache=True` is disabled for gufuncs, that cost was paid on
every session on the import path. Defer all four to first call:

* `_ints_arr_to_bits` and `_sample_without_replacement` become dynamic
  (signature-less) gufuncs; the callers now supply the output array.

* `_probvec_parallel` and `_probvec_cpu` are constructed on first call
  by `functools.cache`d factories, keeping their explicit signatures.
  The parallel target requires one, and the cpu variant keeps one too:
  an explicit-signature gufunc and a dynamic gufunc of the same kernel
  share an incompatible cache entry when `cache=True`, which crashes
  the process.

Public API is unchanged. `functools.cache` requires Python 3.9, so
`requires-python` is raised from 3.7 to 3.9.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* MAINT: use lru_cache and leave requires-python to #864

Two adjustments to the cherry-picked implementation, neither changing
its behaviour.

`functools.cache` is an alias for `functools.lru_cache(maxsize=None)`
added in 3.9 purely for convenience, so using `lru_cache` directly gives
identical memoisation without imposing a version floor.

That removes the need for the `requires-python` bump to 3.9, which is
reverted here: the floor is stale at ">=3.7" while CI tests 3.12-3.14,
but correcting it is #864's business and does not belong in a WASM
change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Use `functools.cache` for `functools.lru_cache(maxsize=None)`

* MAINT: keep TypeError for non-integer n in sample_without_replacement

With the explicit `(i8, f8[:], i8[:])` signature, NumPy rejected a
float `n` with a TypeError before the kernel ran. The dynamic gufunc
c... (continued)

20 of 20 new or added lines in 3 files covered. (100.0%)

5507 of 5859 relevant lines covered (93.99%)

0.94 hits per line

Jobs
ID Job ID Ran Files Coverage
1 35817899786.1 23 Sep 2026 04:24AM UTC 94
93.99
GitHub Action Run
Source Files on build 35817899786
  • Tree
  • List 94
  • Changed 3
  • Source Changed 3
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35817899786
  • 79360d64 on github
  • Prev Build on main (#35817078287)
  • Next Build on main (#35821365257)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc