Skip to content

Comments

refactor: handle n_leaves edge cases for sampling#95

Merged
Neclow merged 1 commit intosbhattlab:mainfrom
Neclow:sampling_edgecases
Aug 7, 2025
Merged

refactor: handle n_leaves edge cases for sampling#95
Neclow merged 1 commit intosbhattlab:mainfrom
Neclow:sampling_edgecases

Conversation

@Neclow
Copy link
Collaborator

@Neclow Neclow commented Aug 7, 2025

Handle a few edge cases on vector/matrix sampling. Noticed that in Python, when entering n_leaves = -x would create underflowe errors, while entering n_leaves = 0 would hang (presumably because n_leaves - 1 would flip to usize::MAX). So I added a condition to handle and throw errors if n_leaves <= 2 in the python and R lib.rs

Added tests for sample_matrix in python.

@Neclow Neclow merged commit 5d73044 into sbhattlab:main Aug 7, 2025
7 checks passed
@Neclow Neclow deleted the sampling_edgecases branch August 7, 2025 09:43
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