malariagen / malariagen-data-python

Analyse MalariaGEN data from Python
https://malariagen.github.io/malariagen-data-python/latest/
MIT License
13 stars 23 forks source link

Reduce memory usage when accessing SNP calls with site_class parameter #501

Closed alimanfoo closed 7 months ago

alimanfoo commented 7 months ago
review-notebook-app[bot] commented 7 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

alimanfoo commented 7 months ago

There are two separate optimisations here.

The first change is within the _snp_calls() method and reduces memory usage when requesting a relatively small genome region:

image

The second change is within the _locate_site_class() method and reduces memory usage even when accessing a large genome region:

image

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8f7f86f) 98.71% compared to head (9e7a859) 98.71%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #501 +/- ## ======================================= Coverage 98.71% 98.71% ======================================= Files 33 33 Lines 3274 3277 +3 ======================================= + Hits 3232 3235 +3 Misses 42 42 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.