Skip to content

subsample: Add helper function for setting --nthreads#1963

Open
victorlin wants to merge 1 commit intomasterfrom
victorlin/subsample-nthreads
Open

subsample: Add helper function for setting --nthreads#1963
victorlin wants to merge 1 commit intomasterfrom
victorlin/subsample-nthreads

Conversation

@victorlin
Copy link
Copy Markdown
Member

@victorlin victorlin commented Feb 21, 2026

This will be useful in Snakemake workflows to prevent over/under-allocating threads.

Downstream PRs

Checklist

  • Manually tested in rsv and measles
  • Automated checks pass changes aren't covered by checks
  • Check if you need to add a changelog message
  • Check if you need to add tests
  • Check if you need to update docs

@victorlin victorlin self-assigned this Feb 21, 2026
@victorlin victorlin added the enhancement New feature or request label Feb 21, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 21, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.41%. Comparing base (a974866) to head (4af0d31).
⚠️ Report is 28 commits behind head on master.

Files with missing lines Patch % Lines
augur/subsample.py 16.66% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1963      +/-   ##
==========================================
- Coverage   74.45%   74.41%   -0.04%     
==========================================
  Files          82       82              
  Lines        9102     9108       +6     
  Branches     1855     1856       +1     
==========================================
+ Hits         6777     6778       +1     
- Misses       2020     2025       +5     
  Partials      305      305              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +236 to +241
def get_parallelism(
config_file: str,
config_section: Optional[List[str]] = None,
limit: int = None
) -> int:
"""Compute the degree of parallelism (i.e., optimal value for ``--nthreads``).
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jameshadfield do you think this would still be feasible with the augur proximity integration in #1962?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we chat about this tomorrow?

I haven't yet implemented the --nthreads stuff yet, so proximity calculations just run with 1 thread. That's not good - the function is designed to parallalize really well, and without parallalization is unnecessarily slow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure!

This will be useful in Snakemake workflows to prevent
over/under-allocating threads.
@victorlin victorlin force-pushed the victorlin/subsample-nthreads branch from ad43e09 to 4af0d31 Compare February 25, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants