theislab / scib

Benchmarking analysis of data integration tools
MIT License
283 stars 62 forks source link

Skip labels before loop #394

Open johnarevalo opened 6 months ago

johnarevalo commented 6 months ago

When there are many labels to be skipped, having this validation inside the for loop makes kbet computation significantly slow:

https://github.com/theislab/scib/blob/ed3e2846414ca1e3dc07552c0eef1e68d82230d4/scib/metrics/kbet.py#L114-L122

This PR extract such checks outside the for loop to do them in a single pass.