Skip to content

DM-55482: Improve coverage of disable_implicit_threading#245

Open
timj wants to merge 2 commits into
mainfrom
tickets/DM-55482
Open

DM-55482: Improve coverage of disable_implicit_threading#245
timj wants to merge 2 commits into
mainfrom
tickets/DM-55482

Conversation

@timj

@timj timj commented Jul 15, 2026

Copy link
Copy Markdown
Member

Add NUMBA_NUM_THREADS, ARROW_IO_THREADS, VECLIB_MAXIMUM_THREADS, RAYON_NUM_THREADS, POLARS_MAX_THREADS, and BLIS_NUM_THREADS to the environment variables set by set_thread_envvars.

Resize existing pyarrow thread pools explicitly since they are sized from the environment only when each pool is first used and do not react to environment variables after creation.

Log a warning when threadpoolctl is not installed since thread pools of already-loaded libraries can then no longer be limited.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

Add NUMBA_NUM_THREADS, ARROW_IO_THREADS, VECLIB_MAXIMUM_THREADS,
RAYON_NUM_THREADS, POLARS_MAX_THREADS, and BLIS_NUM_THREADS to the
environment variables set by set_thread_envvars.

Resize existing pyarrow thread pools explicitly since they are sized
from the environment only when each pool is first used and do not
react to environment variables after creation.

Log a warning when threadpoolctl is not installed since thread pools
of already-loaded libraries can then no longer be limited.

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

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.00000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.48%. Comparing base (dc8415d) to head (ca70172).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
tests/test_threads.py 70.96% 9 Missing ⚠️
python/lsst/utils/threads.py 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #245      +/-   ##
==========================================
- Coverage   94.73%   94.48%   -0.25%     
==========================================
  Files          51       51              
  Lines        4007     4047      +40     
==========================================
+ Hits         3796     3824      +28     
- Misses        211      223      +12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

numba reads NUMBA_NUM_THREADS only at import time, so setting the
environment variable in disable_implicit_threading has no effect on a
numba that is already imported. Call numba.set_num_threads(1) as well.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant